Skip to content

Commit 2c8dadb

Browse files
committed
Add option to use local L0 include dir
Turning UMF_BUILD_LEVEL_ZERO_PROVIDER on in UR results in configuration errors as both projects try to fetch and build L0 loader.
1 parent d969819 commit 2c8dadb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44

55
include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake)
66

7+
set(UMF_LEVEL_ZERO_INCLUDE_DIR
8+
""
9+
CACHE FILEPATH "Directory containing the Level Zero Headers")
10+
711
# Compile definitions for UMF library.
812
#
913
# TODO: Cleanup the compile definitions across all the CMake files
1014
set(UMF_COMMON_COMPILE_DEFINITIONS UMF_VERSION=${UMF_VERSION})
1115

12-
if(UMF_BUILD_LEVEL_ZERO_PROVIDER)
16+
if(UMF_BUILD_LEVEL_ZERO_PROVIDER AND (UMF_BUILD_GPU_TESTS
17+
OR (NOT UMF_LEVEL_ZERO_INCLUDE_DIR)))
1318
include(FetchContent)
1419

1520
set(LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
@@ -35,6 +40,10 @@ if(UMF_BUILD_LEVEL_ZERO_PROVIDER)
3540
${level-zero-loader_SOURCE_DIR}/include
3641
CACHE PATH "Path to Level Zero Headers")
3742
message(STATUS "Level Zero include directory: ${LEVEL_ZERO_INCLUDE_DIRS}")
43+
elseif(UMF_BUILD_LEVEL_ZERO_PROVIDER)
44+
# Only header is needed to build UMF
45+
set(LEVEL_ZERO_INCLUDE_DIRS ${UMF_LEVEL_ZERO_INCLUDE_DIR})
46+
message(STATUS "Level Zero include directory: ${LEVEL_ZERO_INCLUDE_DIRS}")
3847
endif()
3948

4049
add_subdirectory(utils)

0 commit comments

Comments
 (0)