Skip to content

Commit a53f89d

Browse files
authored
Merge pull request #1692 from aarongreig/aaron/platformCreateWithNativeAdapter
Add hAdapter parameter to urPlatformCreateWithNativeHandle
2 parents 6d053bc + fcecc00 commit a53f89d

File tree

19 files changed

+76
-53
lines changed

19 files changed

+76
-53
lines changed

include/ur_api.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,13 +1188,16 @@ typedef struct ur_platform_native_properties_t {
11881188
/// - ::UR_RESULT_ERROR_UNINITIALIZED
11891189
/// - ::UR_RESULT_ERROR_DEVICE_LOST
11901190
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
1191+
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
1192+
/// + `NULL == hAdapter`
11911193
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
11921194
/// + `NULL == phPlatform`
11931195
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
11941196
/// + If the adapter has no underlying equivalent handle.
11951197
UR_APIEXPORT ur_result_t UR_APICALL
11961198
urPlatformCreateWithNativeHandle(
11971199
ur_native_handle_t hNativePlatform, ///< [in][nocheck] the native handle of the platform.
1200+
ur_adapter_handle_t hAdapter, ///< [in] handle of the adapter associated with the native backend.
11981201
const ur_platform_native_properties_t *pProperties, ///< [in][optional] pointer to native platform properties struct.
11991202
ur_platform_handle_t *phPlatform ///< [out] pointer to the handle of the platform object created.
12001203
);
@@ -9555,6 +9558,7 @@ typedef struct ur_platform_get_native_handle_params_t {
95559558
/// allowing the callback the ability to modify the parameter's value
95569559
typedef struct ur_platform_create_with_native_handle_params_t {
95579560
ur_native_handle_t *phNativePlatform;
9561+
ur_adapter_handle_t *phAdapter;
95589562
const ur_platform_native_properties_t **ppProperties;
95599563
ur_platform_handle_t **pphPlatform;
95609564
} ur_platform_create_with_native_handle_params_t;

include/ur_ddi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnPlatformGetNativeHandle_t)(
4949
/// @brief Function-pointer for urPlatformCreateWithNativeHandle
5050
typedef ur_result_t(UR_APICALL *ur_pfnPlatformCreateWithNativeHandle_t)(
5151
ur_native_handle_t,
52+
ur_adapter_handle_t,
5253
const ur_platform_native_properties_t *,
5354
ur_platform_handle_t *);
5455

include/ur_print.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10214,6 +10214,12 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1021410214
ur::details::printPtr(os,
1021510215
*(params->phNativePlatform));
1021610216

10217+
os << ", ";
10218+
os << ".hAdapter = ";
10219+
10220+
ur::details::printPtr(os,
10221+
*(params->phAdapter));
10222+
1021710223
os << ", ";
1021810224
os << ".pProperties = ";
1021910225

scripts/core/platform.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ params:
211211
- type: $x_native_handle_t
212212
name: hNativePlatform
213213
desc: "[in][nocheck] the native handle of the platform."
214+
- type: $x_adapter_handle_t
215+
name: hAdapter
216+
desc: "[in] handle of the adapter associated with the native backend."
214217
- type: const $x_platform_native_properties_t*
215218
name: pProperties
216219
desc: "[in][optional] pointer to native platform properties struct."

scripts/templates/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ def get_adapter_handles(specs):
653653
objs = []
654654
for s in specs:
655655
for obj in s['objects']:
656-
if obj_traits.is_handle(obj) and not obj_traits.is_loader_only(obj):
656+
if obj_traits.is_handle(obj) and not (obj_traits.is_loader_only(obj) or 'native' in obj['name']):
657657
objs.append(obj)
658658

659659
return objs

scripts/templates/ldrddi.cpp.mako

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ namespace ur_loader
132132
%else:
133133
<%param_replacements={}%>
134134
%for i, item in enumerate(th.get_loader_prologue(n, tags, obj, meta)):
135-
%if not '_native_object_' in item['obj'] or th.make_func_name(n, tags, obj) == 'urPlatformCreateWithNativeHandle':
135+
%if not '_native_object_' in item['obj']:
136136
// extract platform's function pointer table
137137
auto dditable = reinterpret_cast<${item['obj']}*>( ${item['pointer']}${item['name']} )->dditable;
138138
auto ${th.make_pfn_name(n, tags, obj)} = dditable->${n}.${th.get_table_name(n, tags, obj)}.${th.make_pfn_name(n, tags, obj)};
@@ -151,7 +151,7 @@ namespace ur_loader
151151
for( size_t i = ${item['range'][0]}; i < ${item['range'][1]}; ++i )
152152
${item['name']}Local[ i ] = reinterpret_cast<${item['obj']}*>( ${item['name']}[ i ] )->handle;
153153
%else:
154-
%if not '_native_object_' in item['obj'] or th.make_func_name(n, tags, obj) == 'urPlatformCreateWithNativeHandle':
154+
%if not '_native_object_' in item['obj']:
155155
// convert loader handle to platform handle
156156
%if item['optional']:
157157
${item['name']} = ( ${item['name']} ) ? reinterpret_cast<${item['obj']}*>( ${item['name']} )->handle : nullptr;
@@ -279,7 +279,7 @@ namespace ur_loader
279279
%if item['release']:
280280
// release loader handle
281281
${item['factory']}.release( ${item['name']} );
282-
%elif not '_native_object_' in item['obj'] or th.make_func_name(n, tags, obj) == 'urPlatformCreateWithNativeHandle':
282+
%elif not '_native_object_' in item['obj']:
283283
try
284284
{
285285
%if 'typename' in item:

source/adapters/cuda/platform.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetNativeHandle(
141141
}
142142

143143
UR_APIEXPORT ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
144-
ur_native_handle_t hNativePlatform,
145-
const ur_platform_native_properties_t *pProperties,
146-
ur_platform_handle_t *phPlatform) {
147-
std::ignore = hNativePlatform;
148-
std::ignore = pProperties;
149-
std::ignore = phPlatform;
144+
ur_native_handle_t, ur_adapter_handle_t,
145+
const ur_platform_native_properties_t *, ur_platform_handle_t *) {
146+
// There is no CUDA equivalent to ur_platform_handle_t
150147
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
151148
}
152149

source/adapters/hip/platform.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetNativeHandle(
135135
}
136136

137137
UR_APIEXPORT ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
138-
ur_native_handle_t hNativePlatform,
139-
const ur_platform_native_properties_t *pProperties,
140-
ur_platform_handle_t *phPlatform) {
141-
std::ignore = hNativePlatform;
142-
std::ignore = pProperties;
143-
std::ignore = phPlatform;
138+
ur_native_handle_t, ur_adapter_handle_t,
139+
const ur_platform_native_properties_t *, ur_platform_handle_t *) {
140+
// There is no HIP equivalent to ur_platform_handle_t
144141
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
145142
}
146143

source/adapters/level_zero/platform.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetNativeHandle(
123123
UR_APIEXPORT ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
124124
ur_native_handle_t
125125
NativePlatform, ///< [in] the native handle of the platform.
126+
ur_adapter_handle_t,
126127
const ur_platform_native_properties_t
127128
*Properties, ///< [in][optional] pointer to native platform properties
128129
///< struct.

source/adapters/native_cpu/platform.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetBackendOption(
9696
}
9797

9898
UR_APIEXPORT ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
99-
ur_native_handle_t hNativePlatform,
100-
const ur_platform_native_properties_t *pProperties,
101-
ur_platform_handle_t *phPlatform) {
102-
std::ignore = hNativePlatform;
103-
std::ignore = pProperties;
104-
std::ignore = phPlatform;
105-
99+
ur_native_handle_t, ur_adapter_handle_t,
100+
const ur_platform_native_properties_t *, ur_platform_handle_t *) {
106101
DIE_NO_IMPLEMENTATION;
107102
}
108103

source/adapters/null/ur_nullddi.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle(
263263
__urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
264264
ur_native_handle_t
265265
hNativePlatform, ///< [in][nocheck] the native handle of the platform.
266+
ur_adapter_handle_t
267+
hAdapter, ///< [in] handle of the adapter associated with the native backend.
266268
const ur_platform_native_properties_t *
267269
pProperties, ///< [in][optional] pointer to native platform properties struct.
268270
ur_platform_handle_t *
@@ -274,8 +276,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
274276
auto pfnCreateWithNativeHandle =
275277
d_context.urDdiTable.Platform.pfnCreateWithNativeHandle;
276278
if (nullptr != pfnCreateWithNativeHandle) {
277-
result =
278-
pfnCreateWithNativeHandle(hNativePlatform, pProperties, phPlatform);
279+
result = pfnCreateWithNativeHandle(hNativePlatform, hAdapter,
280+
pProperties, phPlatform);
279281
} else {
280282
// generic implementation
281283
*phPlatform = reinterpret_cast<ur_platform_handle_t>(d_context.get());

source/adapters/opencl/platform.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetNativeHandle(
106106
}
107107

108108
UR_APIEXPORT ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
109-
ur_native_handle_t hNativePlatform, const ur_platform_native_properties_t *,
110-
ur_platform_handle_t *phPlatform) {
109+
ur_native_handle_t hNativePlatform, ur_adapter_handle_t,
110+
const ur_platform_native_properties_t *, ur_platform_handle_t *phPlatform) {
111111
*phPlatform = reinterpret_cast<ur_platform_handle_t>(hNativePlatform);
112112
return UR_RESULT_SUCCESS;
113113
}

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle(
352352
__urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
353353
ur_native_handle_t
354354
hNativePlatform, ///< [in][nocheck] the native handle of the platform.
355+
ur_adapter_handle_t
356+
hAdapter, ///< [in] handle of the adapter associated with the native backend.
355357
const ur_platform_native_properties_t *
356358
pProperties, ///< [in][optional] pointer to native platform properties struct.
357359
ur_platform_handle_t *
@@ -365,15 +367,15 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
365367
}
366368

367369
ur_platform_create_with_native_handle_params_t params = {
368-
&hNativePlatform, &pProperties, &phPlatform};
370+
&hNativePlatform, &hAdapter, &pProperties, &phPlatform};
369371
uint64_t instance =
370372
context.notify_begin(UR_FUNCTION_PLATFORM_CREATE_WITH_NATIVE_HANDLE,
371373
"urPlatformCreateWithNativeHandle", &params);
372374

373375
context.logger.info("---> urPlatformCreateWithNativeHandle");
374376

375-
ur_result_t result =
376-
pfnCreateWithNativeHandle(hNativePlatform, pProperties, phPlatform);
377+
ur_result_t result = pfnCreateWithNativeHandle(hNativePlatform, hAdapter,
378+
pProperties, phPlatform);
377379

378380
context.notify_end(UR_FUNCTION_PLATFORM_CREATE_WITH_NATIVE_HANDLE,
379381
"urPlatformCreateWithNativeHandle", &params, &result,

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle(
347347
__urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
348348
ur_native_handle_t
349349
hNativePlatform, ///< [in][nocheck] the native handle of the platform.
350+
ur_adapter_handle_t
351+
hAdapter, ///< [in] handle of the adapter associated with the native backend.
350352
const ur_platform_native_properties_t *
351353
pProperties, ///< [in][optional] pointer to native platform properties struct.
352354
ur_platform_handle_t *
@@ -360,13 +362,22 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
360362
}
361363

362364
if (context.enableParameterValidation) {
365+
if (NULL == hAdapter) {
366+
return UR_RESULT_ERROR_INVALID_NULL_HANDLE;
367+
}
368+
363369
if (NULL == phPlatform) {
364370
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
365371
}
366372
}
367373

368-
ur_result_t result =
369-
pfnCreateWithNativeHandle(hNativePlatform, pProperties, phPlatform);
374+
if (context.enableLifetimeValidation &&
375+
!refCountContext.isReferenceValid(hAdapter)) {
376+
refCountContext.logInvalidReference(hAdapter);
377+
}
378+
379+
ur_result_t result = pfnCreateWithNativeHandle(hNativePlatform, hAdapter,
380+
pProperties, phPlatform);
370381

371382
return result;
372383
}

source/loader/ur_ldrddi.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ ur_event_factory_t ur_event_factory;
2222
ur_program_factory_t ur_program_factory;
2323
ur_kernel_factory_t ur_kernel_factory;
2424
ur_queue_factory_t ur_queue_factory;
25-
ur_native_factory_t ur_native_factory;
2625
ur_sampler_factory_t ur_sampler_factory;
2726
ur_mem_factory_t ur_mem_factory;
2827
ur_physical_mem_factory_t ur_physical_mem_factory;
@@ -364,6 +363,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle(
364363
__urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
365364
ur_native_handle_t
366365
hNativePlatform, ///< [in][nocheck] the native handle of the platform.
366+
ur_adapter_handle_t
367+
hAdapter, ///< [in] handle of the adapter associated with the native backend.
367368
const ur_platform_native_properties_t *
368369
pProperties, ///< [in][optional] pointer to native platform properties struct.
369370
ur_platform_handle_t *
@@ -372,21 +373,19 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
372373
ur_result_t result = UR_RESULT_SUCCESS;
373374

374375
// extract platform's function pointer table
375-
auto dditable =
376-
reinterpret_cast<ur_native_object_t *>(hNativePlatform)->dditable;
376+
auto dditable = reinterpret_cast<ur_adapter_object_t *>(hAdapter)->dditable;
377377
auto pfnCreateWithNativeHandle =
378378
dditable->ur.Platform.pfnCreateWithNativeHandle;
379379
if (nullptr == pfnCreateWithNativeHandle) {
380380
return UR_RESULT_ERROR_UNINITIALIZED;
381381
}
382382

383383
// convert loader handle to platform handle
384-
hNativePlatform =
385-
reinterpret_cast<ur_native_object_t *>(hNativePlatform)->handle;
384+
hAdapter = reinterpret_cast<ur_adapter_object_t *>(hAdapter)->handle;
386385

387386
// forward to device-platform
388-
result =
389-
pfnCreateWithNativeHandle(hNativePlatform, pProperties, phPlatform);
387+
result = pfnCreateWithNativeHandle(hNativePlatform, hAdapter, pProperties,
388+
phPlatform);
390389

391390
if (UR_RESULT_SUCCESS != result) {
392391
return result;

source/loader/ur_ldrddi.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ using ur_queue_object_t = object_t<ur_queue_handle_t>;
4949
using ur_queue_factory_t =
5050
singleton_factory_t<ur_queue_object_t, ur_queue_handle_t>;
5151

52-
using ur_native_object_t = object_t<ur_native_handle_t>;
53-
using ur_native_factory_t =
54-
singleton_factory_t<ur_native_object_t, ur_native_handle_t>;
55-
5652
using ur_sampler_object_t = object_t<ur_sampler_handle_t>;
5753
using ur_sampler_factory_t =
5854
singleton_factory_t<ur_sampler_object_t, ur_sampler_handle_t>;

source/loader/ur_libapi.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,13 +653,17 @@ ur_result_t UR_APICALL urPlatformGetNativeHandle(
653653
/// - ::UR_RESULT_ERROR_UNINITIALIZED
654654
/// - ::UR_RESULT_ERROR_DEVICE_LOST
655655
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
656+
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
657+
/// + `NULL == hAdapter`
656658
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
657659
/// + `NULL == phPlatform`
658660
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
659661
/// + If the adapter has no underlying equivalent handle.
660662
ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
661663
ur_native_handle_t
662664
hNativePlatform, ///< [in][nocheck] the native handle of the platform.
665+
ur_adapter_handle_t
666+
hAdapter, ///< [in] handle of the adapter associated with the native backend.
663667
const ur_platform_native_properties_t *
664668
pProperties, ///< [in][optional] pointer to native platform properties struct.
665669
ur_platform_handle_t *
@@ -671,7 +675,8 @@ ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
671675
return UR_RESULT_ERROR_UNINITIALIZED;
672676
}
673677

674-
return pfnCreateWithNativeHandle(hNativePlatform, pProperties, phPlatform);
678+
return pfnCreateWithNativeHandle(hNativePlatform, hAdapter, pProperties,
679+
phPlatform);
675680
} catch (...) {
676681
return exceptionToResult(std::current_exception());
677682
}

source/ur_api.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,17 @@ ur_result_t UR_APICALL urPlatformGetNativeHandle(
569569
/// - ::UR_RESULT_ERROR_UNINITIALIZED
570570
/// - ::UR_RESULT_ERROR_DEVICE_LOST
571571
/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
572+
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
573+
/// + `NULL == hAdapter`
572574
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
573575
/// + `NULL == phPlatform`
574576
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
575577
/// + If the adapter has no underlying equivalent handle.
576578
ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(
577579
ur_native_handle_t
578580
hNativePlatform, ///< [in][nocheck] the native handle of the platform.
581+
ur_adapter_handle_t
582+
hAdapter, ///< [in] handle of the adapter associated with the native backend.
579583
const ur_platform_native_properties_t *
580584
pProperties, ///< [in][optional] pointer to native platform properties struct.
581585
ur_platform_handle_t *

test/conformance/platform/urPlatformCreateWithNativeHandle.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ TEST_F(urPlatformCreateWithNativeHandleTest, Success) {
2020
// We can however convert the native_handle back into a unified-runtime
2121
// handle and perform some query on it to verify that it works.
2222
ur_platform_handle_t plat = nullptr;
23-
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
24-
urPlatformCreateWithNativeHandle(native_handle, nullptr, &plat));
23+
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urPlatformCreateWithNativeHandle(
24+
native_handle, adapters[0], nullptr, &plat));
2525
ASSERT_NE(plat, nullptr);
2626

2727
std::string input_platform_name = uur::GetPlatformName(platform);
@@ -45,8 +45,8 @@ TEST_F(urPlatformCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) {
4545
ur_platform_native_properties_t props = {
4646
UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES, nullptr, true};
4747
ur_platform_handle_t plat = nullptr;
48-
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
49-
urPlatformCreateWithNativeHandle(native_handle, &props, &plat));
48+
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urPlatformCreateWithNativeHandle(
49+
native_handle, adapters[0], &props, &plat));
5050
ASSERT_NE(plat, nullptr);
5151

5252
std::string input_platform_name = uur::GetPlatformName(platform);
@@ -70,8 +70,8 @@ TEST_F(urPlatformCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) {
7070
ur_platform_native_properties_t props = {
7171
UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES, nullptr, false};
7272
ur_platform_handle_t plat = nullptr;
73-
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
74-
urPlatformCreateWithNativeHandle(native_handle, &props, &plat));
73+
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urPlatformCreateWithNativeHandle(
74+
native_handle, adapters[0], &props, &plat));
7575
ASSERT_NE(plat, nullptr);
7676

7777
std::string input_platform_name = uur::GetPlatformName(platform);
@@ -84,8 +84,8 @@ TEST_F(urPlatformCreateWithNativeHandleTest, InvalidNullPointerPlatform) {
8484
for (auto platform : platforms) {
8585
ur_native_handle_t native_handle = nullptr;
8686
ASSERT_SUCCESS(urPlatformGetNativeHandle(platform, &native_handle));
87-
ASSERT_EQ_RESULT(
88-
UR_RESULT_ERROR_INVALID_NULL_POINTER,
89-
urPlatformCreateWithNativeHandle(native_handle, nullptr, nullptr));
87+
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER,
88+
urPlatformCreateWithNativeHandle(
89+
native_handle, adapters[0], nullptr, nullptr));
9090
}
9191
}

0 commit comments

Comments
 (0)