Skip to content

Commit d3a5f1d

Browse files
sarnexkbenzie
andauthored
[UR][L0] Make urPlatformGetBackendOption return -ze-opt-level=2 for -O1 and -O2 (#12023)
oneapi-src/unified-runtime#1129 --------- Signed-off-by: Sarnie, Nick <[email protected]> Co-authored-by: Kenneth Benzie (Benie) <[email protected]>
1 parent b32db9a commit d3a5f1d

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

sycl/doc/design/PropagateCompilerFlagsToRuntime.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ OpenCL backends.
7373
| Front-end option | L0 backend option | OpenCL backend option |
7474
| ---------------- | ----------------- | --------------------- |
7575
| -O0 | -ze-opt-disable | -cl-opt-disable |
76-
| -O1 | -ze-opt-level=1 | /* no option */ |
77-
| -O2 | -ze-opt-level=1 | /* no option */ |
76+
| -O1 | -ze-opt-level=2 | /* no option */ |
77+
| -O2 | -ze-opt-level=2 | /* no option */ |
7878
| -O3 | -ze-opt-level=2 | /* no option */ |
7979

8080

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ pi_result piPluginGetLastError(char **message) {
5858

5959
// Returns plugin specific backend option.
6060
// Return '-ze-opt-disable' for frontend_option = -O0.
61-
// Return '-ze-opt-level=1' for frontend_option = -O1 or -O2.
62-
// Return '-ze-opt-level=2' for frontend_option = -O3.
61+
// Return '-ze-opt-level=2' for frontend_option = -O1, O2 or -O3.
6362
// Return '-igc_opts 'PartitionUnit=1,SubroutineThreshold=50000'' for
6463
// frontend_option = -ftarget-compile-fast.
6564
pi_result piPluginGetBackendOption(pi_platform platform,

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
5757
include(FetchContent)
5858

5959
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
60-
# commit 12a67f56c3c5d08cfac0852d552b4e5fe0452d04
61-
# Merge: 2b7b827c c10968f5
60+
# commit c2d78257ba7e7bbc230333f291282d16145aaac7
61+
# Merge: 8bb539c5 b3a1d52d
6262
# Author: Kenneth Benzie (Benie) <[email protected]>
63-
# Date: Tue Jan 9 10:53:32 2024 +0000
64-
# Merge pull request #1027 from GeorgeWeb/georgi/hip_memadvise
65-
# [SYCL][HIP] Implement mem_advise for HIP
66-
set(UNIFIED_RUNTIME_TAG 12a67f56c3c5d08cfac0852d552b4e5fe0452d04)
63+
# Date: Wed Jan 10 11:24:12 2024 +0000
64+
# Merge pull request #1129 from sarnex/adapters
65+
# [UR][L0] Make urPlatformGetBackendOption return -ze-opt-level=2 for -O1 and -O2
66+
set(UNIFIED_RUNTIME_TAG c2d78257ba7e7bbc230333f291282d16145aaac7)
6767

6868
if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
6969
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")

sycl/test-e2e/PropagateOptionsToBackend/sycl-opt-level-level-zero.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
// RUN: %{build} -O1 -o %t1.out
66
// RUN: env SYCL_PI_TRACE=-1 %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes=CHECK1
77
// RUN: %{build} -O2 -o %t2.out
8-
// RUN: env SYCL_PI_TRACE=-1 %{run} %t2.out 2>&1 | FileCheck %s --check-prefixes=CHECK2
8+
// RUN: env SYCL_PI_TRACE=-1 %{run} %t2.out 2>&1 | FileCheck %s --check-prefixes=CHECK1
99
// RUN: %{build} -O3 -o %t3.out
10-
// RUN: env SYCL_PI_TRACE=-1 %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes=CHECK3
10+
// RUN: env SYCL_PI_TRACE=-1 %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes=CHECK1
1111

1212
// This test verifies the propagation of front-end compiler optimization
1313
// option to the backend.
1414
// API call in device code:
1515
// Following is expected addition of options for level_zero backend:
1616
// Front-end option | L0 backend option
1717
// -O0 | -ze-opt-disable
18-
// -O1 | -ze-opt-level=1
19-
// -O2 | -ze-opt-level=1
18+
// -O1 | -ze-opt-level=2
19+
// -O2 | -ze-opt-level=2
2020
// -O3 | -ze-opt-level=2
2121

2222
#include <sycl/sycl.hpp>
@@ -30,7 +30,5 @@ int main() {
3030

3131
// CHECK-LABEL: ---> piProgramBuild(
3232
// CHECK0: -ze-opt-disable
33-
// CHECK1: -ze-opt-level=1
34-
// CHECK2: -ze-opt-level=1
35-
// CHECK3: -ze-opt-level=2
33+
// CHECK1: -ze-opt-level=2
3634
// CHECK: ) ---> pi_result : PI_SUCCESS

0 commit comments

Comments
 (0)