Skip to content

Commit 2cf4e7f

Browse files
sarnexkbenzie
authored andcommitted
Use pre-installed compute-runtime L0 headers if found (#18276)
I'm trying to make dpcpp more friendly to packaging by Linux distros, and we should be using system-installed dependencies by default. Find the system-installed compute-runtime headers and use them if they exist instead of downloading the upstream repo. Also fix an include that doesn't work with system headers. Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
1 parent eb04916 commit 2cf4e7f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cmake/FetchLevelZero.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,15 @@ target_include_directories(LevelZeroLoader-Headers
106106
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
107107
)
108108

109-
# Fetch only if UR_COMPUTE_RUNTIME_FETCH_REPO is set to ON.
110-
if (UR_COMPUTE_RUNTIME_FETCH_REPO)
111-
109+
find_path(L0_COMPUTE_RUNTIME_HEADERS
110+
NAMES "ze_intel_gpu.h"
111+
PATH_SUFFIXES "level_zero"
112+
)
113+
if(NOT UR_COMPUTE_RUNTIME_REPO AND L0_COMPUTE_RUNTIME_HEADERS)
114+
set(COMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE "${L0_COMPUTE_RUNTIME_HEADERS}")
115+
set(COMPUTE_RUNTIME_REPO_PATH "${L0_COMPUTE_RUNTIME_HEADERS}")
116+
elseif (UR_COMPUTE_RUNTIME_FETCH_REPO)
117+
# Fetch only if UR_COMPUTE_RUNTIME_FETCH_REPO is set to ON.
112118
if (UR_COMPUTE_RUNTIME_REPO STREQUAL "")
113119
set(UR_COMPUTE_RUNTIME_REPO "https://github.com/intel/compute-runtime.git")
114120
endif()

source/adapters/level_zero/common.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <ze_api.h>
3232
#include <zes_api.h>
3333

34-
#include <level_zero/include/level_zero/ze_intel_gpu.h>
34+
#include <level_zero/ze_intel_gpu.h>
3535
#include <umf_pools/disjoint_pool_config_parser.hpp>
3636

3737
#include "logger/ur_logger.hpp"

0 commit comments

Comments
 (0)