Skip to content

Commit 0277188

Browse files
Pavel V Chupinsmaslov-intel
authored andcommitted
[SYCL] Next redesign step
* Fix issues on level_zero build based on FetchContent * Remove installation of level_zero loader into the toolchain * Fix dependencies At this point there are undefined references at unified runtime link as .so library. WIP.
1 parent e564a89 commit 0277188

File tree

8 files changed

+27
-48
lines changed

8 files changed

+27
-48
lines changed

sycl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ project(sycl-solution)
55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
set(CMAKE_CXX_EXTENSIONS OFF)
8+
set(CMAKE_INCLUDE_CURRENT_DIR OFF)
89
option(SYCL_ENABLE_WERROR "Treat all warnings as errors in SYCL project" OFF)
910
option(SYCL_DISABLE_STL_ASSERTIONS "Disable assertions in STL containers" OFF)
1011
option(SYCL_ADD_DEV_VERSION_POSTFIX "Adds -V postfix to version string" ON)

sycl/plugins/level_zero/CMakeLists.txt

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,6 @@ FetchContent_GetProperties(level-zero-loader)
2727

2828
set(LEVEL_ZERO_INCLUDE_DIR
2929
${level-zero-loader_SOURCE_DIR}/include CACHE PATH "Path to Level Zero Headers")
30-
set(LEVEL_ZERO_LOADER_LIBRARY ${level-zero-loader_TARGET_LOADER_NAME})
31-
32-
#ExternalProject_Add_Step(level-zero-loader llvminstall
33-
#COMMAND ${CMAKE_COMMAND} -E copy_directory <INSTALL_DIR>/lib/ ${LLVM_BINARY_DIR}/lib
34-
#COMMAND ${CMAKE_COMMAND} -E copy_directory <INSTALL_DIR>/include/ ${LLVM_BINARY_DIR}/include/sycl
35-
#COMMENT "Installing level-zero-loader into the LLVM binary directory"
36-
#DEPENDEES install
37-
#)
38-
39-
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS level-zero-loader level-zero-headers)
40-
41-
include_directories("${LEVEL_ZERO_INCLUDE_DIR}")
42-
43-
add_library (LevelZeroLoader INTERFACE)
44-
target_link_libraries(LevelZeroLoader
45-
INTERFACE ${LEVEL_ZERO_LOADER_LIBRARY}
46-
)
4730

4831
add_library (LevelZeroLoader-Headers INTERFACE)
4932
add_library (LevelZeroLoader::Headers ALIAS LevelZeroLoader-Headers)
@@ -67,7 +50,10 @@ add_sycl_plugin(level_zero
6750
"${CMAKE_CURRENT_SOURCE_DIR}/tracing.cpp"
6851
${XPTI_PROXY_SRC}
6952
LIBRARIES
70-
${LEVEL_ZERO_LOADER_LIBRARY}
53+
# ${LEVEL_ZERO_LOADER_LIBRARY}
54+
LevelZeroLoader-Headers
55+
UnifiedRuntime-Headers
56+
ze_loader
7157
Threads::Threads
7258
pi_unified_runtime
7359
)

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <thread>
2525
#include <utility>
2626

27-
#include <level_zero/zet_api.h>
27+
#include <zet_api.h>
2828

2929
#include "usm_allocator.hpp"
3030

sycl/plugins/level_zero/pi_level_zero.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
#include <unordered_set>
4141
#include <vector>
4242

43-
#include <level_zero/ze_api.h>
44-
#include <level_zero/zes_api.h>
43+
#include <ze_api.h>
44+
#include <zes_api.h>
4545
#include <sycl/detail/iostream_proxy.hpp>
4646

4747
// Share code between this PI L0 Plugin and UR L0 Adapter

sycl/plugins/level_zero/tracing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "xpti/xpti_data_types.h"
1010
#include <exception>
11-
#include <level_zero/layers/zel_tracing_api.h>
12-
#include <level_zero/ze_api.h>
11+
#include <layers/zel_tracing_api.h>
12+
#include <ze_api.h>
1313
#include <xpti/xpti_trace_framework.h>
1414

1515
#include <sycl/detail/iostream_proxy.hpp>

sycl/plugins/opencl/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ add_sycl_plugin(opencl
1414
SOURCES
1515
"${sycl_inc_dir}/sycl/detail/pi.h"
1616
"pi_opencl.cpp"
17+
INCLUDE_DIRS
18+
"."
1719
LIBRARIES
1820
OpenCL-ICD
1921
)

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ set(UNIFIED_RUNTIME_SOURCE_DIR
2020
set(UNIFIED_RUNTIME_INCLUDE_DIR "${UNIFIED_RUNTIME_SOURCE_DIR}/include")
2121

2222

23-
#include_directories("${LEVEL_ZERO_INCLUDE_DIR}")
24-
include_directories("${UNIFIED_RUNTIME_INCLUDE_DIR}")
25-
2623
add_library (UnifiedRuntime-Headers INTERFACE)
2724
target_include_directories(UnifiedRuntime-Headers
28-
INTERFACE "${UNIFIED_RUNTIME_INCLUDE_DIR}"
25+
INTERFACE
26+
"${UNIFIED_RUNTIME_INCLUDE_DIR}"
27+
"${CMAKE_CURRENT_SOURCE_DIR}"
2928
)
3029

3130
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS unified-runtime)
@@ -40,26 +39,17 @@ find_package(Threads REQUIRED)
4039
add_sycl_plugin(unified_runtime
4140
SOURCES
4241
"${sycl_inc_dir}/sycl/detail/pi.h"
43-
"${CMAKE_CURRENT_SOURCE_DIR}/pi2ur.cpp"
44-
"${CMAKE_CURRENT_SOURCE_DIR}/pi2ur.hpp"
45-
"${CMAKE_CURRENT_SOURCE_DIR}/ur.hpp"
46-
"${CMAKE_CURRENT_SOURCE_DIR}/adapters/level_zero/ur_level_zero.hpp"
47-
"${CMAKE_CURRENT_SOURCE_DIR}/adapters/level_zero/ur_level_zero.cpp"
48-
LIBRARIES
42+
"pi2ur.cpp"
43+
"pi2ur.hpp"
44+
"ur.hpp"
45+
"adapters/level_zero/ur_level_zero.hpp"
46+
"adapters/level_zero/ur_level_zero.cpp"
47+
INCLUDE_DIRS
48+
"."
49+
"${UNIFIED_RUNTIME_INCLUDE_DIR}"
50+
LIBRARIES
4951
Threads::Threads
5052
UnifiedRuntime-Headers
5153
LevelZeroLoader-Headers
52-
LevelZeroLoader
53-
)
54-
55-
target_include_directories(pi_unified_runtime INTERFACE
56-
"${UNIFIED_RUNTIME_INCLUDE_DIR}"
57-
"${CMAKE_CURRENT_SOURCE_DIR}"
54+
# ze_loader
5855
)
59-
60-
target_link_libraries(pi_unified_runtime PRIVATE
61-
UnifiedRuntime-Headers
62-
LevelZeroLoader-Headers
63-
)
64-
65-
add_dependencies(pi_unified_runtime ze-api)

sycl/plugins/unified_runtime/adapters/level_zero/ur_level_zero.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include <unordered_map>
1515
#include <vector>
1616

17-
#include <level_zero/ze_api.h>
18-
#include <level_zero/zes_api.h>
17+
#include <ze_api.h>
18+
#include <zes_api.h>
1919
#include <ur.hpp>
2020
#include <zer_api.h>
2121

0 commit comments

Comments
 (0)