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
5252set (UR_CONFORMANCE_TARGET_TRIPLES "" CACHE STRING
5353 "List of sycl targets to build CTS device binaries for" )
5454set (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" )
5565
5666# There's little reason not to generate the compile_commands.json
5767set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
Original file line number Diff line number Diff line change @@ -30,21 +30,37 @@ endfunction()
3030
3131add_subdirectory (null)
3232
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+
3349if (UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_ALL)
34- add_subdirectory (level_zero)
50+ add_ur_adapter_subdirectory (level_zero)
3551endif ()
3652
3753if (UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_ALL)
38- add_subdirectory (cuda)
54+ add_ur_adapter_subdirectory (cuda)
3955endif ()
4056
4157if (UR_BUILD_ADAPTER_HIP OR UR_BUILD_ADAPTER_ALL)
42- add_subdirectory (hip)
58+ add_ur_adapter_subdirectory (hip)
4359endif ()
4460
4561if (UR_BUILD_ADAPTER_OPENCL OR UR_BUILD_ADAPTER_ALL)
46- add_subdirectory (opencl)
62+ add_ur_adapter_subdirectory (opencl)
4763endif ()
4864if (UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_ALL)
49- add_subdirectory (native_cpu)
65+ add_ur_adapter_subdirectory (native_cpu)
5066endif ()
You can’t perform that action at this time.
0 commit comments