File tree Expand file tree Collapse file tree 6 files changed +27
-7
lines changed Expand file tree Collapse file tree 6 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -196,12 +196,12 @@ jobs:
196
196
-DUR_BUILD_TESTS=ON
197
197
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
198
198
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
199
+ -DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
199
200
-DUR_CONFORMANCE_TARGET_TRIPLES=${{matrix.adapter.triplet}}
200
201
201
202
- name : Build
202
203
# This is so that device binaries can find the sycl runtime library
203
- run : LD_LIBRARY_PATH=${{github.workspace}}/dpcpp_compiler/lib
204
- cmake --build ${{github.workspace}}/build -j $(nproc)
204
+ run : cmake --build ${{github.workspace}}/build -j $(nproc)
205
205
206
206
- name : Test adapter specific
207
207
working-directory : ${{github.workspace}}/build
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ option(UR_BUILD_ADAPTER_CUDA "build cuda adapter from SYCL" OFF)
41
41
option (UR_BUILD_ADAPTER_HIP "build hip adapter from SYCL" OFF )
42
42
option (UR_BUILD_EXAMPLE_CODEGEN "Build the codegen example." OFF )
43
43
option (VAL_USE_LIBBACKTRACE_BACKTRACE "enable libbacktrace validation backtrace for linux" OFF )
44
+ set (UR_DPCXX "" CACHE FILEPATH "Path of the DPC++ compiler executable" )
45
+ set (UR_SYCL_LIBRARY_DIR "" CACHE PATH
46
+ "Path of the SYCL runtime library directory" )
44
47
45
48
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib )
46
49
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib )
Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ List of options provided by CMake:
133
133
| UR_BUILD_ADAPTER_HIP | Fetch and use hip adapter from SYCL | ON/OFF | OFF |
134
134
| UR_HIP_PLATFORM | Build hip adapter for AMD or NVIDIA platform | AMD/NVIDIA | AMD |
135
135
| UR_ENABLE_COMGR | Enable comgr lib usage | AMD/NVIDIA | AMD |
136
+ | UR_DPCXX | Path of the DPC++ compiler executable to build CTS device binaries | File path | ` "" ` |
137
+ | UR_SYCL_LIBRARY_DIR | Path of the SYCL runtime library directory to build CTS device binaries | Directory path | ` "" ` |
136
138
137
139
### Additional make targets
138
140
Original file line number Diff line number Diff line change @@ -25,6 +25,6 @@ add_subdirectory(unit)
25
25
if (UR_BUILD_TOOLS )
26
26
add_subdirectory (tools )
27
27
endif ()
28
- if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND DEFINED UR_DPCXX )
28
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND UR_DPCXX )
29
29
add_subdirectory (fuzz )
30
30
endif ()
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ add_subdirectory(queue)
89
89
add_subdirectory (sampler )
90
90
add_subdirectory (virtual_memory )
91
91
92
- if (DEFINED UR_DPCXX )
92
+ if (UR_DPCXX )
93
93
add_custom_target (generate_device_binaries )
94
94
95
95
set (UR_CONFORMANCE_DEVICE_BINARIES_DIR
@@ -99,12 +99,18 @@ if(DEFINED UR_DPCXX)
99
99
if (NOT "${UR_CONFORMANCE_TARGET_TRIPLES} " STREQUAL "" )
100
100
string (REPLACE "," ";" TARGET_TRIPLES ${UR_CONFORMANCE_TARGET_TRIPLES} )
101
101
else ()
102
- message (WARNING "UR_CONFORMANCE_TARGET_TRIPLES wasn't set, defaulting to only generate spir64 device binaries" )
102
+ message (WARNING
103
+ "UR_CONFORMANCE_TARGET_TRIPLES wasn't set, defaulting to only \
104
+ generate spir64 device binaries" )
103
105
list (APPEND TARGET_TRIPLES "spir64" )
104
106
endif ()
105
107
106
108
add_subdirectory (device_code )
107
109
add_subdirectory (kernel )
108
110
add_subdirectory (program )
109
111
add_subdirectory (enqueue )
112
+ else ()
113
+ message (WARNING
114
+ "UR_DPCXX is not defined, the following conformance test executables \
115
+ are disabled: test-program, test-kernel, test-enqueue" )
110
116
endif ()
Original file line number Diff line number Diff line change @@ -7,13 +7,22 @@ macro(add_device_binary SOURCE_FILE)
7
7
get_filename_component (KERNEL_NAME ${SOURCE_FILE} NAME_WE )
8
8
set (DEVICE_BINARY_DIR "${UR_CONFORMANCE_DEVICE_BINARIES_DIR} /${KERNEL_NAME} " )
9
9
file (MAKE_DIRECTORY ${DEVICE_BINARY_DIR} )
10
+ if (UR_SYCL_LIBRARY_DIR )
11
+ if (CMAKE_SYSTEM_NAME STREQUAL Linux )
12
+ set (EXTRA_ENV LD_LIBRARY_PATH=${UR_SYCL_LIBRARY_DIR} )
13
+ elseif (CMAKE_SYSTEM_NAME STREQUAL Windows )
14
+ set (EXTRA_ENV PATH =${UR_SYCL_LIBRARY_DIR};$ENV{PATH} )
15
+ else ()
16
+ set (EXTRA_ENV DYLD_FALLBACK_LIBRARY_PATH=${UR_SYCL_LIBRARY_DIR} )
17
+ endif ()
18
+ endif ()
10
19
foreach (TRIPLE ${TARGET_TRIPLES} )
11
20
set (EXE_PATH "${DEVICE_BINARY_DIR} /${KERNEL_NAME} _${TRIPLE} " )
12
21
add_custom_command (OUTPUT ${EXE_PATH}
13
22
COMMAND ${UR_DPCXX} -fsycl -fsycl-targets=${TRIPLE} -fsycl-device-code-split=off
14
23
${SOURCE_FILE} -o ${EXE_PATH}
15
- COMMAND ${CMAKE_COMMAND} -E env SYCL_DUMP_IMAGES=true
16
- ${EXE_PATH} || ( exit 0 )
24
+ COMMAND ${CMAKE_COMMAND} -E env ${EXTRA_ENV} SYCL_DUMP_IMAGES=true
25
+ ${EXE_PATH} || exit 0
17
26
WORKING_DIRECTORY "${DEVICE_BINARY_DIR} "
18
27
DEPENDS ${SOURCE_FILE}
19
28
)
You can’t perform that action at this time.
0 commit comments