Skip to content

Commit f34ca04

Browse files
authored
Merge pull request #2315 from MrSidims/add-exact-round-opt
[SYCL] Add -foffload-fp32-prec-[div/sqrt] FE option handling in JIT
2 parents 54e5b6a + 394275a commit f34ca04

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

source/adapters/cuda/platform.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,5 +168,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetBackendOption(
168168
*ppPlatformOption = "";
169169
return UR_RESULT_SUCCESS;
170170
}
171+
if (pFrontendOption == "-foffload-fp32-prec-div"sv ||
172+
pFrontendOption == "-foffload-fp32-prec-sqrt"sv) {
173+
*ppPlatformOption = "";
174+
return UR_RESULT_SUCCESS;
175+
}
171176
return UR_RESULT_ERROR_INVALID_VALUE;
172177
}

source/adapters/hip/platform.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,10 @@ urPlatformGetBackendOption(ur_platform_handle_t, const char *pFrontendOption,
154154
*ppPlatformOption = "";
155155
return UR_RESULT_SUCCESS;
156156
}
157+
if (pFrontendOption == "-foffload-fp32-prec-div"sv ||
158+
pFrontendOption == "-foffload-fp32-prec-sqrt"sv) {
159+
*ppPlatformOption = "";
160+
return UR_RESULT_SUCCESS;
161+
}
157162
return UR_RESULT_ERROR_INVALID_VALUE;
158163
}

source/adapters/level_zero/platform.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ ur_result_t urPlatformGetBackendOption(
196196
*PlatformOption = "-igc_opts 'PartitionUnit=1,SubroutineThreshold=50000'";
197197
return UR_RESULT_SUCCESS;
198198
}
199+
if (FrontendOption == "-foffload-fp32-prec-div"sv ||
200+
FrontendOption == "-foffload-fp32-prec-sqrt"sv) {
201+
*PlatformOption = "-ze-fp32-correctly-rounded-divide-sqrt";
202+
return UR_RESULT_SUCCESS;
203+
}
199204
return UR_RESULT_ERROR_INVALID_VALUE;
200205
}
201206

source/adapters/opencl/platform.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,10 @@ urPlatformGetBackendOption(ur_platform_handle_t, const char *pFrontendOption,
144144
*ppPlatformOption = "-igc_opts 'PartitionUnit=1,SubroutineThreshold=50000'";
145145
return UR_RESULT_SUCCESS;
146146
}
147+
if (pFrontendOption == "-foffload-fp32-prec-div"sv ||
148+
pFrontendOption == "-foffload-fp32-prec-sqrt"sv) {
149+
*ppPlatformOption = "-cl-fp32-correctly-rounded-divide-sqrt";
150+
return UR_RESULT_SUCCESS;
151+
}
147152
return UR_RESULT_ERROR_INVALID_VALUE;
148153
}

0 commit comments

Comments
 (0)