Skip to content

Commit 215f591

Browse files
authored
[SYCL] Changed sycl::backend::level0 to sycl::backend::level_zero (#2025)
PI_LEVEL0 -> PI_LEVEL_ZERO. PI_LEVEL0 is still accepted and handled correctly. Signed-off-by: Gail Lyons <gail.lyons@intel.com>
1 parent 0bc2441 commit 215f591

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+267
-260
lines changed

sycl/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include(AddSYCLExecutable)
1414
set(SYCL_MAJOR_VERSION 2)
1515
set(SYCL_MINOR_VERSION 1)
1616
set(SYCL_PATCH_VERSION 0)
17-
set(SYCL_DEV_ABI_VERSION 3)
17+
set(SYCL_DEV_ABI_VERSION 4)
1818
if (SYCL_ADD_DEV_VERSION_POSTFIX)
1919
set(SYCL_VERSION_POSTFIX "-${SYCL_DEV_ABI_VERSION}")
2020
endif()
@@ -326,7 +326,7 @@ set( SYCL_TOOLCHAIN_DEPLOY_COMPONENTS
326326
sycl-headers-extras
327327
sycl
328328
pi_opencl
329-
pi_level0
329+
pi_level_zero
330330
libsycldevice
331331
)
332332
if(OpenCL_INSTALL_KHRONOS_ICD_LOADER AND TARGET ocl-icd)

sycl/ReleaseNotes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Release notes for the commit range ba404be..24726df
6262
- Added a cache for PI plugins, so subsequent calls for `sycl::device`
6363
creation should be cheaper [03dd60d]
6464
- A SYCL program will be aborted now if program linking is requested when
65-
using L0 plugin. This is done because L0 doesn't support program linking
65+
using Level Zero plugin. This is done because L0 doesn't support program linking
6666
[d4a5b71]
6767
- Added a diagnostic on attempt to use `sycl::program::set_spec_constant` when
6868
the program is already in compiled or linked state [e2e3d3d]

sycl/doc/EnvironmentVariables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Environment Variables
22

3-
This document describes environment variables that are having effect on DPC++
3+
This document describes environment variables that are having effect on DPC++
44
compiler and runtime.
55

66
## Controlling DPC++ RT
@@ -12,7 +12,7 @@ subject to change. Do not rely on these variables in production code.
1212
| Environment variable | Values | Description |
1313
| -------------------- | ------ | ----------- |
1414
| SYCL_PI_TRACE | Described [below](#sycl_pi_trace-options) | Enable specified level of tracing for PI. |
15-
| SYCL_BE | PI_OPENCL, PI_LEVEL0, PI_CUDA | Force SYCL RT to consider only devices of the specified backend during the device selection. |
15+
| SYCL_BE | PI_OPENCL, PI_LEVEL_ZERO, PI_CUDA | Force SYCL RT to consider only devices of the specified backend during the device selection. |
1616
| SYCL_DEVICE_TYPE | One of: CPU, GPU, ACC, HOST | Force SYCL to use the specified device type. If unset, default selection rules are applied. If set to any unlisted value, this control has no effect. If the requested device type is not found, a `cl::sycl::runtime_error` exception is thrown. If a non-default device selector is used, a device must satisfy both the selector and this control to be chosen. This control only has effect on devices created with a selector. |
1717
| SYCL_PROGRAM_COMPILE_OPTIONS | String of valid OpenCL compile options | Override compile options for all programs. |
1818
| SYCL_PROGRAM_LINK_OPTIONS | String of valid OpenCL link options | Override link options for all programs. |

sycl/include/CL/sycl/backend/level_zero.hpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,37 @@
1414
__SYCL_INLINE_NAMESPACE(cl) {
1515
namespace sycl {
1616

17-
template <> struct interop<backend::level0, platform> {
17+
template <> struct interop<backend::level_zero, platform> {
1818
using type = ze_driver_handle_t;
1919
};
2020

21-
template <> struct interop<backend::level0, device> {
21+
template <> struct interop<backend::level_zero, device> {
2222
using type = ze_device_handle_t;
2323
};
2424

25-
template <> struct interop<backend::level0, queue> {
25+
template <> struct interop<backend::level_zero, queue> {
2626
using type = ze_command_queue_handle_t;
2727
};
2828

29-
template <> struct interop<backend::level0, program> {
29+
template <> struct interop<backend::level_zero, program> {
3030
using type = ze_module_handle_t;
3131
};
3232

3333
template <typename DataT, int Dimensions, access::mode AccessMode>
34-
struct interop<backend::level0, accessor<DataT, Dimensions, AccessMode,
35-
access::target::global_buffer,
36-
access::placeholder::false_t>> {
34+
struct interop<backend::level_zero, accessor<DataT, Dimensions, AccessMode,
35+
access::target::global_buffer,
36+
access::placeholder::false_t>> {
3737
using type = char *;
3838
};
3939

4040
template <typename DataT, int Dimensions, access::mode AccessMode>
41-
struct interop<backend::level0, accessor<DataT, Dimensions, AccessMode,
42-
access::target::constant_buffer,
43-
access::placeholder::false_t>> {
41+
struct interop<backend::level_zero, accessor<DataT, Dimensions, AccessMode,
42+
access::target::constant_buffer,
43+
access::placeholder::false_t>> {
4444
using type = char *;
4545
};
4646

47-
namespace level0 {
47+
namespace level_zero {
4848

4949
// Implementation of various "make" functions resides in libsycl.so
5050
platform make_platform(pi_native_handle NativeHandle);
@@ -55,34 +55,34 @@ queue make_queue(const context &Context, pi_native_handle InteropHandle);
5555
// Construction of SYCL platform.
5656
template <typename T, typename std::enable_if<
5757
std::is_same<T, platform>::value>::type * = nullptr>
58-
T make(typename interop<backend::level0, T>::type Interop) {
58+
T make(typename interop<backend::level_zero, T>::type Interop) {
5959
return make_platform(reinterpret_cast<pi_native_handle>(Interop));
6060
}
6161

6262
// Construction of SYCL device.
6363
template <typename T, typename std::enable_if<
6464
std::is_same<T, device>::value>::type * = nullptr>
6565
T make(const platform &Platform,
66-
typename interop<backend::level0, T>::type Interop) {
66+
typename interop<backend::level_zero, T>::type Interop) {
6767
return make_device(Platform, reinterpret_cast<pi_native_handle>(Interop));
6868
}
6969

7070
// Construction of SYCL program.
7171
template <typename T, typename std::enable_if<
7272
std::is_same<T, program>::value>::type * = nullptr>
7373
T make(const context &Context,
74-
typename interop<backend::level0, T>::type Interop) {
74+
typename interop<backend::level_zero, T>::type Interop) {
7575
return make_program(Context, reinterpret_cast<pi_native_handle>(Interop));
7676
}
7777

7878
// Construction of SYCL queue.
7979
template <typename T, typename std::enable_if<
8080
std::is_same<T, queue>::value>::type * = nullptr>
8181
T make(const context &Context,
82-
typename interop<backend::level0, T>::type Interop) {
82+
typename interop<backend::level_zero, T>::type Interop) {
8383
return make_queue(Context, reinterpret_cast<pi_native_handle>(Interop));
8484
}
8585

86-
} // namespace level0
86+
} // namespace level_zero
8787
} // namespace sycl
8888
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/include/CL/sycl/backend_types.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
__SYCL_INLINE_NAMESPACE(cl) {
1919
namespace sycl {
2020

21-
enum class backend : char { host, opencl, level0, cuda };
21+
enum class backend : char { host, opencl, level_zero, cuda };
2222

2323
template <backend name, typename SYCLObjectT> struct interop;
2424

@@ -30,7 +30,7 @@ inline std::ostream &operator<<(std::ostream &Out, backend be) {
3030
case backend::opencl:
3131
Out << std::string("opencl");
3232
break;
33-
case backend::level0:
33+
case backend::level_zero:
3434
Out << std::string("level-zero");
3535
break;
3636
case backend::cuda:

sycl/include/CL/sycl/detail/pi.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ bool trace(TraceLevel level);
5757

5858
#ifdef SYCL_RT_OS_WINDOWS
5959
#define OPENCL_PLUGIN_NAME "pi_opencl.dll"
60-
#define LEVEL0_PLUGIN_NAME "pi_level0.dll"
60+
#define LEVEL_ZERO_PLUGIN_NAME "pi_level_zero.dll"
6161
#define CUDA_PLUGIN_NAME "pi_cuda.dll"
6262
#else
6363
#define OPENCL_PLUGIN_NAME "libpi_opencl.so"
64-
#define LEVEL0_PLUGIN_NAME "libpi_level0.so"
64+
#define LEVEL_ZERO_PLUGIN_NAME "libpi_level_zero.so"
6565
#define CUDA_PLUGIN_NAME "libpi_cuda.so"
6666
#endif
6767

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# PI Level0 plugin library
1+
# PI Level Zero plugin library
22

33
if(MSVC)
4-
set(L0_LOADER
4+
set(LEVEL_ZERO_LOADER
55
"${LLVM_LIBRARY_OUTPUT_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ze_loader${CMAKE_STATIC_LIBRARY_SUFFIX}")
66
else()
7-
set(L0_LOADER
7+
set(LEVEL_ZERO_LOADER
88
"${LLVM_LIBRARY_OUTPUT_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}ze_loader${CMAKE_SHARED_LIBRARY_SUFFIX}")
99
endif()
1010

11-
if (NOT DEFINED L0_LIBRARY OR NOT DEFINED L0_INCLUDE_DIR)
11+
if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
1212
message(STATUS "Download Level Zero loader and headers from github.com")
1313
if (CMAKE_C_COMPILER)
1414
list(APPEND AUX_CMAKE_FLAGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
1515
endif()
1616
if (CMAKE_CXX_COMPILER)
1717
list(APPEND AUX_CMAKE_FLAGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
1818
endif()
19-
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/l0_loader_build)
20-
set(L0_LOADER_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/Level0/l0_loader")
21-
if (NOT DEFINED SYCL_EP_L0_LOADER_SKIP_AUTO_UPDATE)
22-
set(SYCL_EP_L0_LOADER_SKIP_AUTO_UPDATE ${SYCL_EXTERNAL_PROJECTS_SKIP_AUTO_UPDATE})
19+
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader_build)
20+
set(LEVEL_ZERO_LOADER_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/level_zero/level_zero_loader")
21+
if (NOT DEFINED SYCL_EP_LEVEL_ZERO_LOADER_SKIP_AUTO_UPDATE)
22+
set(SYCL_EP_LEVEL_ZERO_LOADER_SKIP_AUTO_UPDATE ${SYCL_EXTERNAL_PROJECTS_SKIP_AUTO_UPDATE})
2323
endif()
24-
ExternalProject_Add(l0-loader
24+
ExternalProject_Add(level-zero-loader
2525
GIT_REPOSITORY https://github.com/oneapi-src/level-zero.git
2626
GIT_TAG v0.91.21
27-
UPDATE_DISCONNECTED ${SYCL_EP_L0_LOADER_SKIP_AUTO_UPDATE}
28-
SOURCE_DIR ${L0_LOADER_SOURCE_DIR}
29-
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/l0_loader_build"
30-
INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/l0_loader_install"
27+
UPDATE_DISCONNECTED ${SYCL_EP_LEVEL_ZERO_LOADER_SKIP_AUTO_UPDATE}
28+
SOURCE_DIR ${LEVEL_ZERO_LOADER_SOURCE_DIR}
29+
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader_build"
30+
INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader_install"
3131
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
3232
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
3333
-DOpenCL_INCLUDE_DIR=${OpenCL_INCLUDE_DIRS}
@@ -36,74 +36,74 @@ if (NOT DEFINED L0_LIBRARY OR NOT DEFINED L0_INCLUDE_DIR)
3636
${AUX_CMAKE_FLAGS}
3737
STEP_TARGETS configure,build,install
3838
DEPENDS ocl-headers
39-
BUILD_BYPRODUCTS ${L0_LOADER}
39+
BUILD_BYPRODUCTS ${LEVEL_ZERO_LOADER}
4040
)
41-
ExternalProject_Add_Step(l0-loader llvminstall
41+
ExternalProject_Add_Step(level-zero-loader llvminstall
4242
COMMAND ${CMAKE_COMMAND} -E copy_directory <INSTALL_DIR>/ ${LLVM_BINARY_DIR}
43-
COMMENT "Installing l0-loader into the LLVM binary directory"
43+
COMMENT "Installing level-zero-loader into the LLVM binary directory"
4444
DEPENDEES install
4545
)
4646

47-
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/l0_loader_install/"
47+
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader_install/"
4848
DESTINATION "."
49-
COMPONENT l0-loader
49+
COMPONENT level-zero-loader
5050
)
5151

52-
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS l0-loader)
52+
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS level-zero-loader)
5353
else()
54-
include_directories("${L0_INCLUDE_DIR}")
55-
file(GLOB L0_LIBRARY_SRC "${L0_LIBRARY}*")
56-
file(COPY ${L0_LIBRARY_SRC} DESTINATION ${LLVM_LIBRARY_OUTPUT_INTDIR})
57-
add_custom_target(l0-loader DEPENDS ${L0_LIBRARY} COMMENT "Copying Level Zero Loader ...")
54+
include_directories("${LEVEL_ZERO_INCLUDE_DIR}")
55+
file(GLOB LEVEL_ZERO_LIBRARY_SRC "${LEVEL_ZERO_LIBRARY}*")
56+
file(COPY ${LEVEL_ZERO_LIBRARY_SRC} DESTINATION ${LLVM_LIBRARY_OUTPUT_INTDIR})
57+
add_custom_target(level-zero-loader DEPENDS ${LEVEL_ZERO_LIBRARY} COMMENT "Copying Level Zero Loader ...")
5858
endif()
5959

60-
add_library (L0Loader-Headers INTERFACE)
61-
add_library (L0Loader::Headers ALIAS L0Loader-Headers)
62-
target_include_directories(L0Loader-Headers
63-
INTERFACE "${L0_INCLUDE_DIR}"
60+
add_library (LevelZeroLoader-Headers INTERFACE)
61+
add_library (LevelZeroLoader::Headers ALIAS LevelZeroLoader-Headers)
62+
target_include_directories(LevelZeroLoader-Headers
63+
INTERFACE "${LEVEL_ZERO_INCLUDE_DIR}"
6464
)
6565

6666
include_directories("${sycl_inc_dir}")
6767
include_directories(${OPENCL_INCLUDE})
6868

69-
add_library(pi_level0 SHARED
69+
add_library(pi_level_zero SHARED
7070
"${sycl_inc_dir}/CL/sycl/detail/pi.h"
71-
"${CMAKE_CURRENT_SOURCE_DIR}/pi_level0.cpp"
72-
"${CMAKE_CURRENT_SOURCE_DIR}/pi_level0.hpp"
71+
"${CMAKE_CURRENT_SOURCE_DIR}/pi_level_zero.cpp"
72+
"${CMAKE_CURRENT_SOURCE_DIR}/pi_level_zero.hpp"
7373
)
7474

7575
if (MSVC)
7676
# by defining __SYCL_BUILD_SYCL_DLL, we can use __declspec(dllexport)
7777
# which are individually tagged for all pi* symbols in pi.h
78-
target_compile_definitions(pi_level0 PRIVATE __SYCL_BUILD_SYCL_DLL)
78+
target_compile_definitions(pi_level_zero PRIVATE __SYCL_BUILD_SYCL_DLL)
7979
else()
8080
# we set the visibility of all symbols 'hidden' by default.
8181
# In pi.h file, we set exported symbols with visibility==default individually
82-
target_compile_options(pi_level0 PUBLIC -fvisibility=hidden)
82+
target_compile_options(pi_level_zero PUBLIC -fvisibility=hidden)
8383

8484
# This script file is used to allow exporting pi* symbols only.
8585
# All other symbols are regarded as local (hidden)
8686
set(linker_script "${CMAKE_CURRENT_SOURCE_DIR}/../ld-version-script.txt")
8787

8888
# Filter symbols based on the scope defined in the script file,
8989
# and export pi* function symbols in the library.
90-
target_link_libraries( pi_level0
90+
target_link_libraries( pi_level_zero
9191
PRIVATE "-Wl,--version-script=${linker_script}"
9292
)
9393
endif()
9494

95-
if (TARGET l0-loader)
96-
add_dependencies(pi_level0 l0-loader)
95+
if (TARGET level-zero-loader)
96+
add_dependencies(pi_level_zero level-zero-loader)
9797
endif()
98-
add_dependencies(sycl-toolchain pi_level0)
98+
add_dependencies(sycl-toolchain pi_level_zero)
9999

100-
target_link_libraries(pi_level0 PRIVATE "${L0_LOADER}")
100+
target_link_libraries(pi_level_zero PRIVATE "${LEVEL_ZERO_LOADER}")
101101
if (UNIX)
102-
target_link_libraries(pi_level0 PRIVATE pthread)
102+
target_link_libraries(pi_level_zero PRIVATE pthread)
103103
endif()
104104

105-
add_common_options(pi_level0)
105+
add_common_options(pi_level_zero)
106106

107-
install(TARGETS pi_level0
108-
LIBRARY DESTINATION "lib" COMPONENT pi_level0
109-
RUNTIME DESTINATION "bin" COMPONENT pi_level0)
107+
install(TARGETS pi_level_zero
108+
LIBRARY DESTINATION "lib" COMPONENT pi_level_zero
109+
RUNTIME DESTINATION "bin" COMPONENT pi_level_zero)

0 commit comments

Comments
 (0)