About distance acquisition of optix7.0

Hello. I am always indebted.
I am transitioning from optix6.0 to optix7.0 and studying.
Ask one basic question.
I want to get the distance of the latest point by ray tracing.
In optix6.0,
rtDeclareVariable (PerRayData_radiance, prd_radiance, rtPayload,);
I remember that I was able to get it.
Is there an equivalent variable in optix7.0?

Please start by reading through the OptiX 7 Programming Guide and API Reference: https://raytracing-docs.nvidia.com/

For the hit distance in OptiX 6 and earlier you needed to declare a float variable with the semantic rtIntersectionDistance.
Something like this: rtDeclareVariable(float, theIntersectionDistance, rtIntersectionDistance, );

In OptiX 7 there are no semantic variables. The way to get information from OptiX 7 inside device code is to call one of the provided device-side functions:
The online docs have a search functionality in the top right which works quite well. Try optixGet there.

For the intersection distance you query optixGetRayTmin() inside the closest hit program.
In OptiX 6 and earlier that was the float variable with semantic

Payloads in OptiX 7 are a maximum of eight unsigned int registers on the optixTrace() call.

Note that you need to define how many payload registers your OptixPipeline uses.

It’s recommended to use the registers if you do not need more data inside the payload.
Mans if you only need the intersection distance, you can put that 32-bit float value into one of these unsigned int palyoad register.

If you need more payload data you can encode a 64-bit pointer to a structure into two of these payload registers. The OptiX SDK examples show how. Just search for all optixTrace calls.

After reading the complete OptiX 7 Programming Guide, I would recommend to look through the OptiX 7 SIGGRAPH course examples, the OptiX SDK examples, and the OptiX 7 advanced examples.
Links here:

Thank you for your prompt reply.
I would like to continue learning optix7.0 based on your advice!