Skip to content

Commit cc0b20f

Browse files
[SYCL] Enable level zero v2 in DPC++ (#16656)
This makes a simple way to use the experimental level_zero_v2 in dpc++. Fixes #16613 . --------- Co-authored-by: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
1 parent 5d9fd66 commit cc0b20f

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

buildbot/configure.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ def do_configure(args):
6767
llvm_enable_zstd = "ON"
6868

6969
if sys.platform != "darwin":
70-
sycl_enabled_backends.append("level_zero")
70+
# For more info on the enablement of level_zero_v2 refer to this document:
71+
# https://github.com/intel/llvm/blob/sycl/unified-runtime/source/adapters/level_zero/v2/README.md
72+
if args.level_zero_v2:
73+
sycl_enabled_backends.append("level_zero_v2")
74+
else:
75+
sycl_enabled_backends.append("level_zero")
7176

7277
# lld is needed on Windows or for the HIP adapter on AMD
7378
if platform.system() == "Windows" or (args.hip and args.hip_platform == "AMD"):
@@ -327,6 +332,9 @@ def main():
327332
default="AMD",
328333
help="choose hardware platform for HIP backend",
329334
)
335+
parser.add_argument(
336+
"--level_zero_v2", action="store_true", help="Enable SYCL Level Zero V2"
337+
)
330338
parser.add_argument(
331339
"--host-target",
332340
default="host",

sycl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ if ("opencl" IN_LIST SYCL_ENABLE_BACKENDS)
176176
set(SYCL_BUILD_BACKEND_OPENCL ON)
177177
endif()
178178
if ("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
179-
set(SYCL_BUILD_BACKENDLEVEL_ZERO ON)
179+
set(SYCL_BUILD_BACKEND_LEVEL_ZERO ON)
180180
endif()
181181
if ("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
182182
set(SYCL_BUILD_BACKEND_NATIVE_CPU ON)

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ set(UR_ENABLE_TRACING ON)
3636
if("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
3737
set(UR_BUILD_ADAPTER_L0 ON)
3838
endif()
39+
if("level_zero_v2" IN_LIST SYCL_ENABLE_BACKENDS)
40+
set(UR_BUILD_ADAPTER_L0_V2 ON)
41+
endif()
3942
if("cuda" IN_LIST SYCL_ENABLE_BACKENDS)
4043
set(UR_BUILD_ADAPTER_CUDA ON)
4144
endif()
@@ -284,6 +287,10 @@ if("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
284287
# added to the new build system
285288
endif()
286289

290+
if("level_zero_v2" IN_LIST SYCL_ENABLE_BACKENDS)
291+
add_sycl_ur_adapter(level_zero_v2)
292+
endif()
293+
287294
if("cuda" IN_LIST SYCL_ENABLE_BACKENDS)
288295
add_sycl_ur_adapter(cuda)
289296
endif()

unified-runtime/source/adapters/level_zero/v2/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This is the home directory for L0 v2 adapter sources. This is a redesigned versi
44

55
L0 v2 adapter can be enabled by setting passing `UR_BUILD_ADAPTER_L0_V2=1` option to cmake. When enabled, `libur_adapter_level_zero_v2.[so|dll]` will be created.
66

7+
Currently, L0 v2 is only available as an experimental adapter to gather feedback and adding missing features. L0 v2 is planned to be the default adapter for L0 in 2026.0 release.
8+
79
# Code structure
810

911
v2 adapters is is a standalone adapter but reuses some logic from the legacy L0 adapter implementation - most notably: adapter.cpp, platform.cpp, device.cpp

0 commit comments

Comments
 (0)