Skip to content

Commit a079757

Browse files
authored
[UR] Don't build hip/cuda adapter tests if dpcpp isn't available (#17749)
These tests require device code, which isn't available if `UR_DPCXX` is not set.
1 parent f7a8407 commit a079757

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

unified-runtime/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ List of options provided by CMake:
140140
| UR_STATIC_ADAPTER_L0 | Build the Level-Zero adapter as static and embed in the loader | ON/OFF | OFF |
141141
| UR_HIP_PLATFORM | Build HIP adapter for AMD or NVIDIA platform | AMD/NVIDIA | AMD |
142142
| UR_ENABLE_COMGR | Enable comgr lib usage | AMD/NVIDIA | AMD |
143-
| UR_DPCXX | Path of the DPC++ compiler executable to build CTS device binaries | File path | `""` |
143+
| UR_DPCXX | Path of the DPC++ compiler executable to build device binaries for testing | File path | `""` |
144144
| UR_DEVICE_CODE_EXTRACTOR | Path of the `clang-offload-extract` executable from the DPC++ package, required for CTS device binaries | File path | `"${dirname(UR_DPCXX)}/clang-offload-extract"` |
145145
| UR_DPCXX_BUILD_FLAGS | Build flags to pass to DPC++ when compiling device programs | Space-separated options list | `""` |
146146
| UR_SYCL_LIBRARY_DIR | Path of the SYCL runtime library directory to build CTS device binaries | Directory path | `""` |

unified-runtime/test/adapters/cuda/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
if(NOT UR_DPCXX)
7+
message(WARNING
8+
"UR_DPCXX is not defined, skipping adapter-specific tests for Cuda")
9+
return()
10+
endif()
11+
612
add_adapter_test(cuda
713
FIXTURE DEVICES
814
SOURCES

unified-runtime/test/adapters/hip/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
if(NOT UR_DPCXX)
7+
message(WARNING
8+
"UR_DPCXX is not defined, skipping adapter-specific tests for HIP")
9+
return()
10+
endif()
11+
612
add_adapter_test(hip
713
FIXTURE KERNELS
814
SOURCES

0 commit comments

Comments
 (0)