Skip to content

Commit 70db45f

Browse files
committed
[UR] Refer to platform instead of adapter
1 parent f5fa624 commit 70db45f

File tree

10 files changed

+55
-55
lines changed

10 files changed

+55
-55
lines changed

include/ur_api.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,14 @@ urPlatformCreateWithNativeHandle(
523523
);
524524

525525
///////////////////////////////////////////////////////////////////////////////
526-
/// @brief Get the adapter specific compiler backend option from a generic
526+
/// @brief Get the platform specific compiler backend option from a generic
527527
/// frontend option.
528528
///
529529
/// @details
530-
/// - The string returned via the ppAdapterOption is a NULL terminated C
530+
/// - The string returned via the ppPlatformOption is a NULL terminated C
531531
/// style string.
532-
/// - The string returned via the ppAdapterOption is thread local.
533-
/// - The memory in the string returned via the ppAdapterOption is owned by
532+
/// - The string returned via the ppPlatformOption is thread local.
533+
/// - The memory in the string returned via the ppPlatformOption is owned by
534534
/// the adapter.
535535
/// - The application may call this function from simultaneous threads.
536536
/// - The implementation of this function should be lock-free.
@@ -543,15 +543,15 @@ urPlatformCreateWithNativeHandle(
543543
/// + `NULL == hPlatform`
544544
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
545545
/// + `NULL == pFrontendOption`
546-
/// + `NULL == ppAdapterOption`
546+
/// + `NULL == ppPlatformOption`
547547
/// - ::UR_RESULT_ERROR_INVALID_VALUE
548548
/// + If `pFrontendOption` is not a valid frontend option.
549549
UR_APIEXPORT ur_result_t UR_APICALL
550550
urPlatformGetBackendOption(
551551
ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance.
552552
const char *pFrontendOption, ///< [in] string containing the frontend option.
553-
const char **ppAdapterOption ///< [out] returns the correct adapter specific option based on the
554-
///< frontend option.
553+
const char **ppPlatformOption ///< [out] returns the correct platform specific compiler option based on
554+
///< the frontend option.
555555
);
556556

557557
///////////////////////////////////////////////////////////////////////////////
@@ -5566,7 +5566,7 @@ typedef void(UR_APICALL *ur_pfnPlatformGetApiVersionCb_t)(
55665566
typedef struct ur_platform_get_backend_option_params_t {
55675567
ur_platform_handle_t *phPlatform;
55685568
const char **ppFrontendOption;
5569-
const char ***pppAdapterOption;
5569+
const char ***pppPlatformOption;
55705570
} ur_platform_get_backend_option_params_t;
55715571

55725572
///////////////////////////////////////////////////////////////////////////////

scripts/core/platform.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ params:
168168
[out] pointer to the handle of the platform object created.
169169
--- #--------------------------------------------------------------------------
170170
type: function
171-
desc: "Get the adapter specific compiler backend option from a generic frontend option."
171+
desc: "Get the platform specific compiler backend option from a generic frontend option."
172172
class: $xPlatform
173173
name: GetBackendOption
174174
decl: static
175175
details:
176-
- "The string returned via the ppAdapterOption is a NULL terminated C style string."
177-
- "The string returned via the ppAdapterOption is thread local."
178-
- "The memory in the string returned via the ppAdapterOption is owned by the adapter."
176+
- "The string returned via the ppPlatformOption is a NULL terminated C style string."
177+
- "The string returned via the ppPlatformOption is thread local."
178+
- "The memory in the string returned via the ppPlatformOption is owned by the adapter."
179179
- "The application may call this function from simultaneous threads."
180180
- "The implementation of this function should be lock-free."
181181
params:
@@ -186,8 +186,8 @@ params:
186186
name: pFrontendOption
187187
desc: "[in] string containing the frontend option."
188188
- type: const char**
189-
name: ppAdapterOption
190-
desc: "[out] returns the correct adapter specific option based on the frontend option."
189+
name: ppPlatformOption
190+
desc: "[out] returns the correct platform specific compiler option based on the frontend option."
191191
returns:
192192
- $X_RESULT_ERROR_INVALID_VALUE:
193193
- "If `pFrontendOption` is not a valid frontend option."

source/common/ur_params.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6748,9 +6748,9 @@ operator<<(std::ostream &os,
67486748
ur_params::serializePtr(os, *(params->ppFrontendOption));
67496749

67506750
os << ", ";
6751-
os << ".ppAdapterOption = ";
6751+
os << ".ppPlatformOption = ";
67526752

6753-
ur_params::serializePtr(os, *(params->pppAdapterOption));
6753+
ur_params::serializePtr(os, *(params->pppPlatformOption));
67546754

67556755
return os;
67566756
}

source/drivers/null/ur_nullddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption(
177177
const char
178178
*pFrontendOption, ///< [in] string containing the frontend option.
179179
const char **
180-
ppAdapterOption ///< [out] returns the correct adapter specific option based on the
181-
///< frontend option.
180+
ppPlatformOption ///< [out] returns the correct platform specific compiler option based on
181+
///< the frontend option.
182182
) {
183183
ur_result_t result = UR_RESULT_SUCCESS;
184184

@@ -187,7 +187,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption(
187187
d_context.urDdiTable.Platform.pfnGetBackendOption;
188188
if (nullptr != pfnGetBackendOption) {
189189
result =
190-
pfnGetBackendOption(hPlatform, pFrontendOption, ppAdapterOption);
190+
pfnGetBackendOption(hPlatform, pFrontendOption, ppPlatformOption);
191191
} else {
192192
// generic implementation
193193
}

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption(
215215
const char
216216
*pFrontendOption, ///< [in] string containing the frontend option.
217217
const char **
218-
ppAdapterOption ///< [out] returns the correct adapter specific option based on the
219-
///< frontend option.
218+
ppPlatformOption ///< [out] returns the correct platform specific compiler option based on
219+
///< the frontend option.
220220
) {
221221
auto pfnGetBackendOption = context.urDdiTable.Platform.pfnGetBackendOption;
222222

@@ -225,13 +225,13 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption(
225225
}
226226

227227
ur_platform_get_backend_option_params_t params = {
228-
&hPlatform, &pFrontendOption, &ppAdapterOption};
228+
&hPlatform, &pFrontendOption, &ppPlatformOption};
229229
uint64_t instance =
230230
context.notify_begin(UR_FUNCTION_PLATFORM_GET_BACKEND_OPTION,
231231
"urPlatformGetBackendOption", &params);
232232

233233
ur_result_t result =
234-
pfnGetBackendOption(hPlatform, pFrontendOption, ppAdapterOption);
234+
pfnGetBackendOption(hPlatform, pFrontendOption, ppPlatformOption);
235235

236236
context.notify_end(UR_FUNCTION_PLATFORM_GET_BACKEND_OPTION,
237237
"urPlatformGetBackendOption", &params, &result,

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption(
218218
const char
219219
*pFrontendOption, ///< [in] string containing the frontend option.
220220
const char **
221-
ppAdapterOption ///< [out] returns the correct adapter specific option based on the
222-
///< frontend option.
221+
ppPlatformOption ///< [out] returns the correct platform specific compiler option based on
222+
///< the frontend option.
223223
) {
224224
auto pfnGetBackendOption = context.urDdiTable.Platform.pfnGetBackendOption;
225225

@@ -236,13 +236,13 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption(
236236
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
237237
}
238238

239-
if (NULL == ppAdapterOption) {
239+
if (NULL == ppPlatformOption) {
240240
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
241241
}
242242
}
243243

244244
ur_result_t result =
245-
pfnGetBackendOption(hPlatform, pFrontendOption, ppAdapterOption);
245+
pfnGetBackendOption(hPlatform, pFrontendOption, ppPlatformOption);
246246

247247
return result;
248248
}

source/loader/ur_ldrddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption(
280280
const char
281281
*pFrontendOption, ///< [in] string containing the frontend option.
282282
const char **
283-
ppAdapterOption ///< [out] returns the correct adapter specific option based on the
284-
///< frontend option.
283+
ppPlatformOption ///< [out] returns the correct platform specific compiler option based on
284+
///< the frontend option.
285285
) {
286286
ur_result_t result = UR_RESULT_SUCCESS;
287287

@@ -297,7 +297,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption(
297297
hPlatform = reinterpret_cast<ur_platform_object_t *>(hPlatform)->handle;
298298

299299
// forward to device-platform
300-
result = pfnGetBackendOption(hPlatform, pFrontendOption, ppAdapterOption);
300+
result = pfnGetBackendOption(hPlatform, pFrontendOption, ppPlatformOption);
301301

302302
return result;
303303
}

source/loader/ur_libapi.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,14 @@ ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
252252
}
253253

254254
///////////////////////////////////////////////////////////////////////////////
255-
/// @brief Get the adapter specific compiler backend option from a generic
255+
/// @brief Get the platform specific compiler backend option from a generic
256256
/// frontend option.
257257
///
258258
/// @details
259-
/// - The string returned via the ppAdapterOption is a NULL terminated C
259+
/// - The string returned via the ppPlatformOption is a NULL terminated C
260260
/// style string.
261-
/// - The string returned via the ppAdapterOption is thread local.
262-
/// - The memory in the string returned via the ppAdapterOption is owned by
261+
/// - The string returned via the ppPlatformOption is thread local.
262+
/// - The memory in the string returned via the ppPlatformOption is owned by
263263
/// the adapter.
264264
/// - The application may call this function from simultaneous threads.
265265
/// - The implementation of this function should be lock-free.
@@ -272,24 +272,24 @@ ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
272272
/// + `NULL == hPlatform`
273273
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
274274
/// + `NULL == pFrontendOption`
275-
/// + `NULL == ppAdapterOption`
275+
/// + `NULL == ppPlatformOption`
276276
/// - ::UR_RESULT_ERROR_INVALID_VALUE
277277
/// + If `pFrontendOption` is not a valid frontend option.
278278
ur_result_t UR_APICALL urPlatformGetBackendOption(
279279
ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance.
280280
const char
281281
*pFrontendOption, ///< [in] string containing the frontend option.
282282
const char **
283-
ppAdapterOption ///< [out] returns the correct adapter specific option based on the
284-
///< frontend option.
283+
ppPlatformOption ///< [out] returns the correct platform specific compiler option based on
284+
///< the frontend option.
285285
) {
286286
auto pfnGetBackendOption =
287287
ur_lib::context->urDdiTable.Platform.pfnGetBackendOption;
288288
if (nullptr == pfnGetBackendOption) {
289289
return UR_RESULT_ERROR_UNINITIALIZED;
290290
}
291291

292-
return pfnGetBackendOption(hPlatform, pFrontendOption, ppAdapterOption);
292+
return pfnGetBackendOption(hPlatform, pFrontendOption, ppPlatformOption);
293293
}
294294

295295
///////////////////////////////////////////////////////////////////////////////

source/ur_api.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
208208
}
209209

210210
///////////////////////////////////////////////////////////////////////////////
211-
/// @brief Get the adapter specific compiler backend option from a generic
211+
/// @brief Get the platform specific compiler backend option from a generic
212212
/// frontend option.
213213
///
214214
/// @details
215-
/// - The string returned via the ppAdapterOption is a NULL terminated C
215+
/// - The string returned via the ppPlatformOption is a NULL terminated C
216216
/// style string.
217-
/// - The string returned via the ppAdapterOption is thread local.
218-
/// - The memory in the string returned via the ppAdapterOption is owned by
217+
/// - The string returned via the ppPlatformOption is thread local.
218+
/// - The memory in the string returned via the ppPlatformOption is owned by
219219
/// the adapter.
220220
/// - The application may call this function from simultaneous threads.
221221
/// - The implementation of this function should be lock-free.
@@ -228,16 +228,16 @@ ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
228228
/// + `NULL == hPlatform`
229229
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
230230
/// + `NULL == pFrontendOption`
231-
/// + `NULL == ppAdapterOption`
231+
/// + `NULL == ppPlatformOption`
232232
/// - ::UR_RESULT_ERROR_INVALID_VALUE
233233
/// + If `pFrontendOption` is not a valid frontend option.
234234
ur_result_t UR_APICALL urPlatformGetBackendOption(
235235
ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance.
236236
const char
237237
*pFrontendOption, ///< [in] string containing the frontend option.
238238
const char **
239-
ppAdapterOption ///< [out] returns the correct adapter specific option based on the
240-
///< frontend option.
239+
ppPlatformOption ///< [out] returns the correct platform specific compiler option based on
240+
///< the frontend option.
241241
) {
242242
ur_result_t result = UR_RESULT_SUCCESS;
243243
return result;

test/conformance/platform/urPlatformGetBackendOption.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,36 @@ INSTANTIATE_TEST_SUITE_P(, urPlatfromGetBackendOptionTestWithParam,
1313
});
1414

1515
TEST_P(urPlatfromGetBackendOptionTestWithParam, Success) {
16-
const char *adapterOption = nullptr;
16+
const char *platformOption = nullptr;
1717
ASSERT_SUCCESS(urPlatformGetBackendOption(platform, GetParam().c_str(),
18-
&adapterOption));
19-
ASSERT_NE(adapterOption, nullptr);
18+
&platformOption));
19+
ASSERT_NE(platformOption, nullptr);
2020
}
2121

2222
using urPlatfromGetBackendOptionTest = uur::platform::urPlatformTest;
2323

2424
TEST_F(urPlatfromGetBackendOptionTest, InvalidNullHandle) {
25-
const char *adapterOption = nullptr;
25+
const char *platformOption = nullptr;
2626
ASSERT_EQ_RESULT(
2727
UR_RESULT_ERROR_INVALID_NULL_HANDLE,
28-
urPlatformGetBackendOption(nullptr, "-O0", &adapterOption));
28+
urPlatformGetBackendOption(nullptr, "-O0", &platformOption));
2929
}
3030

3131
TEST_F(urPlatfromGetBackendOptionTest, InvalidNullPointerFrontendOption) {
32-
const char *adapterOption = nullptr;
32+
const char *platformOption = nullptr;
3333
ASSERT_EQ_RESULT(
3434
UR_RESULT_ERROR_INVALID_NULL_POINTER,
35-
urPlatformGetBackendOption(platform, nullptr, &adapterOption));
35+
urPlatformGetBackendOption(platform, nullptr, &platformOption));
3636
}
3737

38-
TEST_F(urPlatfromGetBackendOptionTest, InvalidNullPointerAdapterOption) {
38+
TEST_F(urPlatfromGetBackendOptionTest, InvalidNullPointerPlatformOption) {
3939
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER,
4040
urPlatformGetBackendOption(platform, "-O0", nullptr));
4141
}
4242

4343
TEST_F(urPlatfromGetBackendOptionTest, InvalidValueFrontendOption) {
44-
const char *adapterOption = nullptr;
44+
const char *platformOption = nullptr;
4545
ASSERT_EQ_RESULT(
4646
UR_RESULT_ERROR_INVALID_VALUE,
47-
urPlatformGetBackendOption(platform, "-sycl-sucks", &adapterOption));
47+
urPlatformGetBackendOption(platform, "-sycl-sucks", &platformOption));
4848
}

0 commit comments

Comments
 (0)