Skip to content

Commit acdc01b

Browse files
[Offload][UnitTests] Fix incorrect CUDA path variable in CMake helper (#151820)
This PR fixes a minor bug in the `add_offload_test_device_code` CMake helper function in `offload/unittests/CMakeLists.txt`. The function was discovering the local CUDA Toolkit path and storing it in the `cuda_path` variable but was then using the incorrect `CUDA_ROOT` variable in the `add_custom_command` call for the NVPTX target. This change corrects the command to use the intended `cuda_path` variable.
1 parent 16a0892 commit acdc01b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

offload/unittests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function(add_offload_test_device_code test_filename test_name)
4040
OUTPUT ${output_file}
4141
COMMAND ${CMAKE_C_COMPILER}
4242
--target=nvptx64-nvidia-cuda -march=${nvptx_arch}
43-
-nogpulib --cuda-path=${CUDA_ROOT} -flto ${ARGN}
43+
-nogpulib --cuda-path=${cuda_path} -flto ${ARGN}
4444
${SRC_PATH} -o ${output_file}
4545
DEPENDS ${SRC_PATH}
4646
)

0 commit comments

Comments
 (0)