Skip to content

Commit 19c1b1a

Browse files
committed
fix
1 parent fffb54b commit 19c1b1a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

offload/unittests/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ function(add_offload_test_device_code test_filename test_name)
1414
check_cxx_compiler_flag(
1515
"--target=nvptx64-nvidia-cuda -march=native --cuda-path=${cuda_path}" PLATFORM_HAS_NVPTX)
1616

17-
if(PLATFORM_HAS_NVPTX)
18-
set(nvptx_arch "native")
19-
elseif(OFFLOAD_TESTS_FORCE_NVIDIA_ARCH)
17+
if(OFFLOAD_TESTS_FORCE_NVIDIA_ARCH)
2018
set(nvptx_arch "${OFFLOAD_TESTS_FORCE_NVIDIA_ARCH}")
19+
elseif(PLATFORM_HAS_NVPTX)
20+
set(nvptx_arch "native")
2121
endif()
2222

2323
if(nvptx_arch AND CUDAToolkit_FOUND)
@@ -38,10 +38,10 @@ function(add_offload_test_device_code test_filename test_name)
3838
if("amdgpu" IN_LIST LIBOMPTARGET_PLUGINS_TO_BUILD)
3939
check_cxx_compiler_flag("--target=amdgcn-amd-amdhsa -mcpu=native" PLATFORM_HAS_AMDGPU)
4040

41-
if(PLATFORM_HAS_AMDGPU)
42-
set(amdgpu_arch "native")
43-
elseif(OFFLOAD_TESTS_FORCE_AMDGPU_ARCH)
41+
if(OFFLOAD_TESTS_FORCE_AMDGPU_ARCH)
4442
set(amdgpu_arch "${OFFLOAD_TESTS_FORCE_AMDGPU_ARCH}")
43+
elseif(PLATFORM_HAS_AMDGPU)
44+
set(amdgpu_arch "native")
4545
endif()
4646

4747
if(amdgpu_arch)

0 commit comments

Comments
 (0)