-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] Introduce the Level Zero plugin #1718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
ba2ecb4
b0fabec
e59ed9a
a4b5c7c
120ee9c
5ff2e4d
8866e2c
097c595
4e56b22
8c655b8
0fd2f79
e8722f5
0a0aabf
9db2a3b
d76ea58
a1f740d
3d70ee3
8c75284
6b02205
aebdfe0
88559cf
3a92906
77e8a78
d2164f7
5cc9836
6a85a39
41ea7e2
a303cad
b792fce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,11 +164,15 @@ which contains all the symbols required. | |
| To run DPC++ applications on OpenCL devices, OpenCL implementation(s) must be | ||
| present in the system. | ||
|
|
||
| To run DPC++ applications on Level Zero devices, Level Zero implementation(s) | ||
| must be present in the system. | ||
|
|
||
| Please, refer to [the Release Notes](../ReleaseNotes.md) for recommended Intel | ||
| runtime versions. | ||
|
|
||
| The `GPU` runtime that is needed to run DPC++ application on Intel `GPU` devices | ||
| can be downloaded from the following web pages: | ||
| To run DPC++ application on Intel `GPU` devices the OpenCL `GPU` runtime or the | ||
|
||
| Level Zero `GPU` runtime is needed. They can be downloaded from the following web | ||
| pages: | ||
|
|
||
| * Linux: [Intel® Graphics Compute Runtime for | ||
| OpenCL™](https://github.com/intel/compute-runtime/releases) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,4 @@ if(SYCL_BUILD_PI_CUDA) | |
| endif() | ||
|
|
||
| add_subdirectory(opencl) | ||
| add_subdirectory(Intel_level0) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # PI Level0 plugin library | ||
|
|
||
| message(STATUS "Download Level Zero loader and headers from github.com") | ||
| if(MSVC) | ||
| set(L0_LIBRARY | ||
| "${LLVM_LIBRARY_OUTPUT_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ze_loader${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
| else() | ||
| set(L0_LIBRARY | ||
| "${LLVM_LIBRARY_OUTPUT_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}ze_loader${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
| endif() | ||
| if (CMAKE_C_COMPILER) | ||
| list(APPEND AUX_CMAKE_FLAGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) | ||
| endif() | ||
| if (CMAKE_CXX_COMPILER) | ||
| list(APPEND AUX_CMAKE_FLAGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}) | ||
| endif() | ||
| file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/l0_loader_build) | ||
| ExternalProject_Add(l0-loader | ||
| GIT_REPOSITORY https://github.com/oneapi-src/level-zero.git | ||
| GIT_TAG origin/master | ||
| SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/Level0/l0_loader" | ||
| BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/l0_loader_build" | ||
| INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/l0_loader_install" | ||
| CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
| -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} | ||
| -DOpenCL_INCLUDE_DIR=${OpenCL_INCLUDE_DIRS} | ||
| -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||
| -DCMAKE_INSTALL_LIBDIR:PATH=lib${LLVM_LIBDIR_SUFFIX} | ||
| ${AUX_CMAKE_FLAGS} | ||
| STEP_TARGETS configure,build,install | ||
| DEPENDS ocl-headers | ||
| BUILD_BYPRODUCTS ${L0_LIBRARY} | ||
| ) | ||
| ExternalProject_Add_Step(l0-loader llvminstall | ||
| COMMAND ${CMAKE_COMMAND} -E copy_directory <INSTALL_DIR>/ ${LLVM_BINARY_DIR} | ||
| COMMENT "Installing l0-loader into the LLVM binary directory" | ||
| DEPENDEES install | ||
| ) | ||
|
|
||
| include_directories("${sycl_inc_dir}") | ||
| include_directories(${OPENCL_INCLUDE}) | ||
|
|
||
| add_library(pi_level0 SHARED | ||
| "${sycl_inc_dir}/CL/sycl/detail/pi.h" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/pi_level0.cpp" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/pi_level0.hpp" | ||
| ) | ||
|
|
||
| add_dependencies(pi_level0 l0-loader) | ||
| add_dependencies(sycl-toolchain pi_level0) | ||
|
|
||
| target_link_libraries(pi_level0 PRIVATE "${L0_LIBRARY}") | ||
| if (UNIX) | ||
| target_link_libraries(pi_level0 PRIVATE pthread) | ||
| endif() | ||
|
|
||
| add_common_options(pi_level0) | ||
|
|
||
| install(TARGETS pi_level0 | ||
| LIBRARY DESTINATION "lib" COMPONENT pi_level0 | ||
| RUNTIME DESTINATION "bin" COMPONENT pi_level0) |
Uh oh!
There was an error while loading. Please reload this page.