Skip to content

Commit d358b97

Browse files
sarnexkbenzie
authored andcommitted
[UR][L0] Make urPlatformGetBackendOption return -ze-opt-level=2 for -O2
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 8bb539c commit d358b97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/adapters/level_zero/platform.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ ur_result_t ur_platform_handle_t_::populateDeviceCacheIfNeeded() {
433433
// Returns plugin specific backend option.
434434
// Current support is only for optimization options.
435435
// Return '-ze-opt-disable' for frontend_option = -O0.
436-
// Return '-ze-opt-level=1' for frontend_option = -O1 or -O2.
437-
// Return '-ze-opt-level=2' for frontend_option = -O3.
436+
// Return '-ze-opt-level=1' for frontend_option = -O1.
437+
// Return '-ze-opt-level=2' for frontend_option = -O2 or -O3.
438438
// Return '-igc_opts 'PartitionUnit=1,SubroutineThreshold=50000'' for
439439
// frontend_option=-ftarget-compile-fast.
440440
UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetBackendOption(
@@ -457,11 +457,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetBackendOption(
457457
*PlatformOption = "-ze-opt-disable";
458458
return UR_RESULT_SUCCESS;
459459
}
460-
if (FrontendOption == "-O1"sv || FrontendOption == "-O2"sv) {
460+
if (FrontendOption == "-O1"sv) {
461461
*PlatformOption = "-ze-opt-level=1";
462462
return UR_RESULT_SUCCESS;
463463
}
464-
if (FrontendOption == "-O3"sv) {
464+
if (FrontendOption == "-O2"sv || FrontendOption == "-O3"sv) {
465465
*PlatformOption = "-ze-opt-level=2";
466466
return UR_RESULT_SUCCESS;
467467
}

0 commit comments

Comments
 (0)