File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,16 @@ set(UR_SYCL_LIBRARY_DIR "" CACHE PATH
52
52
set (UR_CONFORMANCE_TARGET_TRIPLES "" CACHE STRING
53
53
"List of sycl targets to build CTS device binaries for" )
54
54
set (UR_CONFORMANCE_AMD_ARCH "" CACHE STRING "AMD device target ID to build CTS binaries for" )
55
+ set (UR_ADAPTER_LEVEL_ZERO_SOURCE_DIR "" CACHE PATH
56
+ "Path to external 'level_zero' adapter source dir" )
57
+ set (UR_ADAPTER_OPENCL_SOURCE_DIR "" CACHE PATH
58
+ "Path to external 'opencl' adapter source dir" )
59
+ set (UR_ADAPTER_CUDA_SOURCE_DIR "" CACHE PATH
60
+ "Path to external 'cuda' adapter source dir" )
61
+ set (UR_ADAPTER_HIP_SOURCE_DIR "" CACHE PATH
62
+ "Path to external 'hip' adapter source dir" )
63
+ set (UR_ADAPTER_NATIVE_CPU_SOURCE_DIR "" CACHE PATH
64
+ "Path to external 'native_cpu' adapter source dir" )
55
65
56
66
# There's little reason not to generate the compile_commands.json
57
67
set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
Original file line number Diff line number Diff line change @@ -30,21 +30,37 @@ endfunction()
30
30
31
31
add_subdirectory (null )
32
32
33
+ function (add_ur_adapter_subdirectory name )
34
+ string (TOUPPER ${name} NAME )
35
+ if (UR_ADAPTER_${NAME}_SOURCE_DIR )
36
+ if (NOT IS_DIRECTORY ${UR_ADAPTER_${NAME}_SOURCE_DIR} )
37
+ message (FATAL_ERROR
38
+ "UR_ADAPTER_${NAME} _SOURCE_DIR is not a directory: "
39
+ "${UR_ADAPTER_${NAME} _SOURCE_DIR}" )
40
+ endif ()
41
+ add_subdirectory (
42
+ "${UR_ADAPTER_${NAME} _SOURCE_DIR}"
43
+ "${CMAKE_CURRENT_BINARY_DIR} /${name} " )
44
+ else ()
45
+ add_subdirectory (${name} )
46
+ endif ()
47
+ endfunction ()
48
+
33
49
if (UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_ALL )
34
- add_subdirectory (level_zero )
50
+ add_ur_adapter_subdirectory (level_zero )
35
51
endif ()
36
52
37
53
if (UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_ALL )
38
- add_subdirectory (cuda )
54
+ add_ur_adapter_subdirectory (cuda )
39
55
endif ()
40
56
41
57
if (UR_BUILD_ADAPTER_HIP OR UR_BUILD_ADAPTER_ALL )
42
- add_subdirectory (hip )
58
+ add_ur_adapter_subdirectory (hip )
43
59
endif ()
44
60
45
61
if (UR_BUILD_ADAPTER_OPENCL OR UR_BUILD_ADAPTER_ALL )
46
- add_subdirectory (opencl )
62
+ add_ur_adapter_subdirectory (opencl )
47
63
endif ()
48
64
if (UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_ALL )
49
- add_subdirectory (native_cpu )
65
+ add_ur_adapter_subdirectory (native_cpu )
50
66
endif ()
You can’t perform that action at this time.
0 commit comments