Cuda function __cudaRegisterLinkedBinary_XXX have a random number inside

After compiling the same cu file twice, check and compare its symbols and find that some function names have changed,

As shown in the
figure __cudaRegisterLinkedBinary_46_tmpxft_00039484_00000000_6_amr_encoder_cpp1_ii_8fb06ead will have a random number inside, may I ask why?

That’s the name of some intermediate file of the compilation process, isn’t it? Compiling with nvcc -v should show all the filenames produced.

ptxas -arch=sm_52 -m64 “/tmp/tmpxft_000210ff_00000000-6_main.ptx” -o “/tmp/tmpxft_000210ff_00000000-10_main.sm_52.cubin”

yes,you are right,But I want to keep the function name unchanged. can I make twice and not generate random numbers?

The nvcc -v output display is as follows:
gcc -E -x c++ -D__CUDACC__ -D__NVCC__ -D__CUDACC_RDC__ -fPIC “-I/usr/local/cuda-10.0/bin/…//include” -D__CUDACC_VER_MAJOR__=10 -D__CUDACC_VER_MINOR__=0 -D__CUDACC_VER_BUILD__=130 -include “cuda_runtime.h” -m64 “Interface/amr_encoder.cu” > “/tmp/tmpxft_0000ee5f_00000000-4_amr_encoder.cpp4.ii”
#$ cudafe++ --gnu_version=50400 --allow_managed --device-c --m64 --parse_templates --gen_c_file_name “/tmp/tmpxft_0000ee5f_00000000-5_amr_encoder.cudafe1.cpp” --stub_file_name “tmpxft_0000ee5f_00000000-5_amr_encoder.cudafe1.stub.c” --module_id_file_name “/tmp/tmpxft_0000ee5f_00000000-3_amr_encoder.module_id” “/tmp/tmpxft_0000ee5f_00000000-4_amr_encoder.cpp4.ii”
#$ gcc -D__CUDA_ARCH__=750 -c -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS -fPIC “-I/usr/local/cuda-10.0/bin/…//include” -m64 -o “Interface/amr_encoder.o” “/tmp/tmpxft_0000ee5f_00000000-5_amr_encoder.cudafe1.cpp”

those function names that begin with __ are internal implementation details. It’s not intended that you call them directly, therefore the name is not something that should matter for typical toolchain usage.

As already indicated, the random numbers are injected by the tool chain to avoid name clashes during the compilation process.

If you want to fully deconstruct the toolchain as indicated in the verbose output, it should be possible to remove some of the random numbers, at least from file naming (or further if you really want to get surgical). But there are no toolchain options to allow this and it would be generally unsupported usage of the toolchain.