[Offload][UnitTests] Fix incorrect CUDA path variable in CMake helper#151820
Merged
Conversation
Member
|
@llvm/pr-subscribers-offload Author: Leandro Lacerda (leandrolcampos) ChangesThis PR fixes a minor bug in the The function was discovering the local CUDA Toolkit path and storing it in the This change corrects the command to use the intended Full diff: https://github.com/llvm/llvm-project/pull/151820.diff 1 Files Affected:
diff --git a/offload/unittests/CMakeLists.txt b/offload/unittests/CMakeLists.txt
index 6d165ffd4c53a..24826a1dcb756 100644
--- a/offload/unittests/CMakeLists.txt
+++ b/offload/unittests/CMakeLists.txt
@@ -40,7 +40,7 @@ function(add_offload_test_device_code test_filename test_name)
OUTPUT ${output_file}
COMMAND ${CMAKE_C_COMPILER}
--target=nvptx64-nvidia-cuda -march=${nvptx_arch}
- -nogpulib --cuda-path=${CUDA_ROOT} -flto ${ARGN}
+ -nogpulib --cuda-path=${cuda_path} -flto ${ARGN}
${SRC_PATH} -o ${output_file}
DEPENDS ${SRC_PATH}
)
|
jhuber6
approved these changes
Aug 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a minor bug in the
add_offload_test_device_codeCMake helper function inoffload/unittests/CMakeLists.txt.The function was discovering the local CUDA Toolkit path and storing it in the
cuda_pathvariable but was then using the incorrectCUDA_ROOTvariable in theadd_custom_commandcall for the NVPTX target.This change corrects the command to use the intended
cuda_pathvariable.