Skip to content

Commit

Permalink
Merge pull request #1129 from sarnex/adapters
Browse files Browse the repository at this point in the history
[UR][L0] Make urPlatformGetBackendOption return -ze-opt-level=2 for -O1 and -O2
  • Loading branch information
kbenzie authored Jan 10, 2024
2 parents 8bb539c + b3a1d52 commit c2d7825
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions source/adapters/level_zero/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,7 @@ ur_result_t ur_platform_handle_t_::populateDeviceCacheIfNeeded() {
// Returns plugin specific backend option.
// Current support is only for optimization options.
// Return '-ze-opt-disable' for frontend_option = -O0.
// Return '-ze-opt-level=1' for frontend_option = -O1 or -O2.
// Return '-ze-opt-level=2' for frontend_option = -O3.
// Return '-ze-opt-level=2' for frontend_option = -O1, -O2 or -O3.
// Return '-igc_opts 'PartitionUnit=1,SubroutineThreshold=50000'' for
// frontend_option=-ftarget-compile-fast.
UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetBackendOption(
Expand All @@ -457,11 +456,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetBackendOption(
*PlatformOption = "-ze-opt-disable";
return UR_RESULT_SUCCESS;
}
if (FrontendOption == "-O1"sv || FrontendOption == "-O2"sv) {
*PlatformOption = "-ze-opt-level=1";
return UR_RESULT_SUCCESS;
}
if (FrontendOption == "-O3"sv) {
if (FrontendOption == "-O1"sv || FrontendOption == "-O2"sv ||
FrontendOption == "-O3"sv) {
*PlatformOption = "-ze-opt-level=2";
return UR_RESULT_SUCCESS;
}
Expand Down

0 comments on commit c2d7825

Please sign in to comment.