Skip to content

Commit 8492bda

Browse files
committed
[offload] Move test gpu arch checks into plugins-nextgen
1 parent c5dc456 commit 8492bda

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

offload/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ set(LIBOMPTARGET_LLVM_LIBRARY_INTDIR "${LIBOMPTARGET_INTDIR}" CACHE STRING
370370
"Path to folder where intermediate libraries will be output")
371371

372372
# Build offloading plugins and device RTLs if they are available.
373-
add_subdirectory(plugins-nextgen)
374373
add_subdirectory(DeviceRTL)
374+
add_subdirectory(plugins-nextgen)
375375
add_subdirectory(tools)
376376

377377
# Build target agnostic offloading library.

offload/plugins-nextgen/amdgpu/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ endif()
2020
# Configure testing for the AMDGPU plugin. We will build tests if we could a
2121
# functional AMD GPU on the system, or if manually specifies by the user.
2222
option(LIBOMPTARGET_FORCE_AMDGPU_TESTS "Build AMDGPU libomptarget tests" OFF)
23-
if (LIBOMPTARGET_FOUND_AMDGPU_GPU OR LIBOMPTARGET_FORCE_AMDGPU_TESTS)
23+
if ((LIBOMPTARGET_FOUND_AMDGPU_GPU
24+
AND "${LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST}"
25+
IN_LIST LIBOMPTARGET_EXPANDED_DEVICE_ARCHITECTURES)
26+
OR LIBOMPTARGET_FORCE_AMDGPU_TESTS)
2427
# Report to the parent scope that we are building a plugin for amdgpu
2528
set(LIBOMPTARGET_SYSTEM_TARGETS
2629
"${LIBOMPTARGET_SYSTEM_TARGETS} amdgcn-amd-amdhsa" PARENT_SCOPE)

offload/plugins-nextgen/cuda/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ endif()
1616
# Configure testing for the CUDA plugin. We will build tests if we could a
1717
# functional NVIDIA GPU on the system, or if manually specifies by the user.
1818
option(LIBOMPTARGET_FORCE_NVIDIA_TESTS "Build NVIDIA libomptarget tests" OFF)
19-
if (LIBOMPTARGET_FOUND_NVIDIA_GPU OR LIBOMPTARGET_FORCE_NVIDIA_TESTS)
19+
if ((LIBOMPTARGET_FOUND_NVIDIA_GPU
20+
AND "${LIBOMPTARGET_DEP_CUDA_ARCH}"
21+
IN_LIST LIBOMPTARGET_EXPANDED_DEVICE_ARCHITECTURES)
22+
OR LIBOMPTARGET_FORCE_NVIDIA_TESTS)
2023
message(STATUS "Enable tests using CUDA plugin")
2124
set(LIBOMPTARGET_SYSTEM_TARGETS
2225
"${LIBOMPTARGET_SYSTEM_TARGETS} nvptx64-nvidia-cuda nvptx64-nvidia-cuda-LTO" PARENT_SCOPE)

offload/test/CMakeLists.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,6 @@ string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM
3737
foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
3838
string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)
3939

40-
if(CURRENT_TARGET MATCHES "^amdgcn" AND
41-
NOT "${LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST}"
42-
IN_LIST LIBOMPTARGET_EXPANDED_DEVICE_ARCHITECTURES)
43-
message(WARNING "Detected AMDGPU arch ${LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST} "
44-
"not in built arch list, ${CURRENT_TARGET} tests will be skipped")
45-
continue()
46-
elseif(CURRENT_TARGET MATCHES "^nvptx" AND
47-
NOT "${LIBOMPTARGET_DEP_CUDA_ARCH}"
48-
IN_LIST LIBOMPTARGET_EXPANDED_DEVICE_ARCHITECTURES)
49-
message(WARNING "Detected NVPTX arch ${LIBOMPTARGET_DEP_CUDA_ARCH} "
50-
"not in built arch list, ${CURRENT_TARGET} tests will be skipped")
51-
continue()
52-
endif()
53-
5440
add_offload_testsuite(check-libomptarget-${CURRENT_TARGET}
5541
"Running libomptarget tests"
5642
${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET}

0 commit comments

Comments
 (0)