Skip to content

Commit ed49b2f

Browse files
authored
[SYCL][E2E] Search for L0 SDK in standalone mode (#18367)
We need this for our internal testing systems which have L0 installed in a weird path and aren't passing the dir through the LIT vars, and they shouldn't have to if the relevant envvars are set up as expected. Also confirming this didn't break the feature detection, `AtomicRef/device_has_aspect_atomic64_level_zero.cpp` requires `level_zero_dev_kit` and it's still running: Lin: ``` 2025-05-08T16:36:59.9886240Z Passed Tests (1636): ... 2025-05-08T16:36:59.9910791Z SYCL :: AtomicRef/device_has_aspect_atomic64_level_zero.cpp ``` Win: ``` 2025-05-08T16:32:50.9297718Z Passed Tests (1364): ... 2025-05-08T16:32:50.9305267Z SYCL :: AtomicRef/device_has_aspect_atomic64_level_zero.cpp ``` Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
1 parent 75aa60c commit ed49b2f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

sycl/test-e2e/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ if(SYCL_TEST_E2E_STANDALONE)
1414
if( NOT OpenCL_LIBRARY )
1515
find_package(OpenCL)
1616
endif()
17+
if(NOT DEFINED LEVEL_ZERO_INCLUDE)
18+
find_path(LEVEL_ZERO_PATH level_zero/ze_api.h PATH_SUFFIXES include)
19+
if(LEVEL_ZERO_PATH)
20+
set(LEVEL_ZERO_INCLUDE "${LEVEL_ZERO_PATH}")
21+
endif()
22+
endif()
23+
if(NOT DEFINED LEVEL_ZERO_LIBS_DIR)
24+
find_library(LEVEL_ZERO_LIBS_PATH ze_loader)
25+
if(LEVEL_ZERO_LIBS_PATH)
26+
# We have the path of the lib, get the containing directory
27+
# so we can include it.
28+
cmake_path(GET LEVEL_ZERO_LIBS_PATH PARENT_PATH LEVEL_ZERO_LIBS_PATH)
29+
set(LEVEL_ZERO_LIBS_DIR "${LEVEL_ZERO_LIBS_PATH}")
30+
endif()
31+
endif()
1732
else()
1833
if( NOT OpenCL_LIBRARY )
1934
set(OpenCL_LIBRARY "${LLVM_BINARY_DIR}/lib")

0 commit comments

Comments
 (0)