Skip to content

Commit

Permalink
Merge pull request #2315 from MrSidims/add-exact-round-opt
Browse files Browse the repository at this point in the history
[SYCL] Add -foffload-fp32-prec-[div/sqrt] FE option handling in JIT
  • Loading branch information
callumfare authored Nov 20, 2024
2 parents 9937d02 + 4d782f1 commit 83c02a3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/adapters/cuda/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetBackendOption(
*ppPlatformOption = "";
return UR_RESULT_SUCCESS;
}
if (pFrontendOption == "-foffload-fp32-prec-div"sv ||
pFrontendOption == "-foffload-fp32-prec-sqrt"sv) {
*ppPlatformOption = "";
return UR_RESULT_SUCCESS;
}
return UR_RESULT_ERROR_INVALID_VALUE;
}
5 changes: 5 additions & 0 deletions source/adapters/hip/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,10 @@ urPlatformGetBackendOption(ur_platform_handle_t, const char *pFrontendOption,
*ppPlatformOption = "";
return UR_RESULT_SUCCESS;
}
if (pFrontendOption == "-foffload-fp32-prec-div"sv ||
pFrontendOption == "-foffload-fp32-prec-sqrt"sv) {
*ppPlatformOption = "";
return UR_RESULT_SUCCESS;
}
return UR_RESULT_ERROR_INVALID_VALUE;
}
5 changes: 5 additions & 0 deletions source/adapters/level_zero/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ ur_result_t urPlatformGetBackendOption(
*PlatformOption = "-igc_opts 'PartitionUnit=1,SubroutineThreshold=50000'";
return UR_RESULT_SUCCESS;
}
if (FrontendOption == "-foffload-fp32-prec-div"sv ||
FrontendOption == "-foffload-fp32-prec-sqrt"sv) {
*PlatformOption = "-ze-fp32-correctly-rounded-divide-sqrt";
return UR_RESULT_SUCCESS;
}
return UR_RESULT_ERROR_INVALID_VALUE;
}

Expand Down
5 changes: 5 additions & 0 deletions source/adapters/opencl/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,10 @@ urPlatformGetBackendOption(ur_platform_handle_t, const char *pFrontendOption,
*ppPlatformOption = "-igc_opts 'PartitionUnit=1,SubroutineThreshold=50000'";
return UR_RESULT_SUCCESS;
}
if (pFrontendOption == "-foffload-fp32-prec-div"sv ||
pFrontendOption == "-foffload-fp32-prec-sqrt"sv) {
*ppPlatformOption = "-cl-fp32-correctly-rounded-divide-sqrt";
return UR_RESULT_SUCCESS;
}
return UR_RESULT_ERROR_INVALID_VALUE;
}

0 comments on commit 83c02a3

Please sign in to comment.