From a4c6e9124117c62073a4a56bee378ad6d45fd655 Mon Sep 17 00:00:00 2001 From: Aaron Greig Date: Fri, 9 Aug 2024 10:08:49 +0100 Subject: [PATCH] Change urDeviceCreateWithNativeHandle to take an adapter handle. It currently takes a platform handle, which is problematic for the sycl RT because its make_device api only takes a native handle, so to figure out the correct platform handle to pass at best we'd need to do some backend specific querying of the native object, but even then that isn't always possible as not all backends have a platform equivalent. The platform handle does currently enable an optional (slightly) faster path to return the correct device in some adapter implementations but this isn't essential for them to work, so really its primary purpose is to serve as the wrapped UR handle for the loader to work. This purpose is equally well served by an adapter handle, which will also be a lot easier for the sycl rt to correctly provide. --- include/ur_api.h | 6 +++--- include/ur_ddi.h | 2 +- include/ur_print.hpp | 4 ++-- scripts/core/device.yml | 6 +++--- source/adapters/cuda/device.cpp | 17 +++-------------- source/adapters/hip/device.cpp | 13 ++----------- source/adapters/level_zero/device.cpp | 12 +++--------- source/adapters/mock/ur_mockddi.cpp | 5 +++-- source/adapters/native_cpu/device.cpp | 4 ++-- source/adapters/opencl/device.cpp | 2 +- source/loader/layers/tracing/ur_trcddi.cpp | 7 ++++--- source/loader/layers/validation/ur_valddi.cpp | 12 +++++++++--- source/loader/ur_ldrddi.cpp | 10 +++++----- source/loader/ur_libapi.cpp | 7 ++++--- source/ur_api.cpp | 5 +++-- .../cuda/urDeviceCreateWithNativeHandle.cpp | 2 +- .../device/urDeviceCreateWithNativeHandle.cpp | 8 ++++---- 17 files changed, 53 insertions(+), 69 deletions(-) diff --git a/include/ur_api.h b/include/ur_api.h index 670aaae9c7..5be733a429 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -2062,7 +2062,7 @@ typedef struct ur_device_native_properties_t { /// - ::UR_RESULT_ERROR_DEVICE_LOST /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `NULL == hPlatform` +/// + `NULL == hAdapter` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phDevice` /// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE @@ -2070,7 +2070,7 @@ typedef struct ur_device_native_properties_t { UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. - ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance + ur_adapter_handle_t hAdapter, ///< [in] handle of the adapter to which `hNativeDevice` belongs const ur_device_native_properties_t *pProperties, ///< [in][optional] pointer to native device properties struct. ur_device_handle_t *phDevice ///< [out] pointer to the handle of the device object created. ); @@ -11972,7 +11972,7 @@ typedef struct ur_device_get_native_handle_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_device_create_with_native_handle_params_t { ur_native_handle_t *phNativeDevice; - ur_platform_handle_t *phPlatform; + ur_adapter_handle_t *phAdapter; const ur_device_native_properties_t **ppProperties; ur_device_handle_t **pphDevice; } ur_device_create_with_native_handle_params_t; diff --git a/include/ur_ddi.h b/include/ur_ddi.h index 66d072c331..13785a2d65 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -2373,7 +2373,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnDeviceGetNativeHandle_t)( /// @brief Function-pointer for urDeviceCreateWithNativeHandle typedef ur_result_t(UR_APICALL *ur_pfnDeviceCreateWithNativeHandle_t)( ur_native_handle_t, - ur_platform_handle_t, + ur_adapter_handle_t, const ur_device_native_properties_t *, ur_device_handle_t *); diff --git a/include/ur_print.hpp b/include/ur_print.hpp index 487f73533e..9aeb5e3341 100644 --- a/include/ur_print.hpp +++ b/include/ur_print.hpp @@ -17357,10 +17357,10 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct *(params->phNativeDevice))); os << ", "; - os << ".hPlatform = "; + os << ".hAdapter = "; ur::details::printPtr(os, - *(params->phPlatform)); + *(params->phAdapter)); os << ", "; os << ".pProperties = "; diff --git a/scripts/core/device.yml b/scripts/core/device.yml index ead3ceeb8d..23c0233ef7 100644 --- a/scripts/core/device.yml +++ b/scripts/core/device.yml @@ -820,9 +820,9 @@ params: - type: $x_native_handle_t name: hNativeDevice desc: "[in][nocheck] the native handle of the device." - - type: $x_platform_handle_t - name: hPlatform - desc: "[in] handle of the platform instance" + - type: $x_adapter_handle_t + name: hAdapter + desc: "[in] handle of the adapter to which `hNativeDevice` belongs" - type: const $x_device_native_properties_t* name: pProperties desc: "[in][optional] pointer to native device properties struct." diff --git a/source/adapters/cuda/device.cpp b/source/adapters/cuda/device.cpp index f6e6bbe4b3..bbaaa27cdb 100644 --- a/source/adapters/cuda/device.cpp +++ b/source/adapters/cuda/device.cpp @@ -1185,27 +1185,16 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle( /// \return TBD UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( - ur_native_handle_t hNativeDevice, ur_platform_handle_t hPlatform, - const ur_device_native_properties_t *pProperties, + ur_native_handle_t hNativeDevice, + [[maybe_unused]] ur_adapter_handle_t hAdapter, + [[maybe_unused]] const ur_device_native_properties_t *pProperties, ur_device_handle_t *phDevice) { - std::ignore = pProperties; - CUdevice CuDevice = static_cast(hNativeDevice); auto IsDevice = [=](std::unique_ptr &Dev) { return Dev->get() == CuDevice; }; - // If a platform is provided just check if the device is in it - if (hPlatform) { - auto SearchRes = std::find_if(begin(hPlatform->Devices), - end(hPlatform->Devices), IsDevice); - if (SearchRes != end(hPlatform->Devices)) { - *phDevice = SearchRes->get(); - return UR_RESULT_SUCCESS; - } - } - // Get list of platforms uint32_t NumPlatforms = 0; ur_adapter_handle_t AdapterHandle = &adapter; diff --git a/source/adapters/hip/device.cpp b/source/adapters/hip/device.cpp index da92fa6a87..3ae98e929d 100644 --- a/source/adapters/hip/device.cpp +++ b/source/adapters/hip/device.cpp @@ -988,7 +988,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle( } UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( - ur_native_handle_t hNativeDevice, ur_platform_handle_t hPlatform, + ur_native_handle_t hNativeDevice, + [[maybe_unused]] ur_adapter_handle_t hAdapter, [[maybe_unused]] const ur_device_native_properties_t *pProperties, ur_device_handle_t *phDevice) { // We can't cast between ur_native_handle_t and hipDevice_t, so memcpy the @@ -1000,16 +1001,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( return Dev->get() == HIPDevice; }; - // If a platform is provided just check if the device is in it - if (hPlatform) { - auto SearchRes = std::find_if(begin(hPlatform->Devices), - end(hPlatform->Devices), IsDevice); - if (SearchRes != end(hPlatform->Devices)) { - *phDevice = SearchRes->get(); - return UR_RESULT_SUCCESS; - } - } - // Get list of platforms uint32_t NumPlatforms = 0; ur_adapter_handle_t AdapterHandle = &adapter; diff --git a/source/adapters/level_zero/device.cpp b/source/adapters/level_zero/device.cpp index 9e832bbb9a..baaf1c1364 100644 --- a/source/adapters/level_zero/device.cpp +++ b/source/adapters/level_zero/device.cpp @@ -1602,14 +1602,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle( UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t NativeDevice, ///< [in] the native handle of the device. - ur_platform_handle_t Platform, ///< [in] handle of the platform instance - const ur_device_native_properties_t + [[maybe_unused]] ur_adapter_handle_t + Adapter, ///< [in] handle of the platform instance + [[maybe_unused]] const ur_device_native_properties_t *Properties, ///< [in][optional] pointer to native device properties ///< struct. ur_device_handle_t *Device ///< [out] pointer to the handle of the device object created. ) { - std::ignore = Properties; auto ZeDevice = ur_cast(NativeDevice); // The SYCL spec requires that the set of devices must remain fixed for the @@ -1622,12 +1622,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( if (const auto *platforms = GlobalAdapter->PlatformCache->get_value()) { for (const auto &p : *platforms) { Dev = p->getDeviceFromNativeHandle(ZeDevice); - if (Dev) { - // Check that the input Platform, if was given, matches the found one. - UR_ASSERT(!Platform || Platform == p.get(), - UR_RESULT_ERROR_INVALID_PLATFORM); - break; - } } } else { return GlobalAdapter->PlatformCache->get_error(); diff --git a/source/adapters/mock/ur_mockddi.cpp b/source/adapters/mock/ur_mockddi.cpp index 6f19df7581..d792c3bd2c 100644 --- a/source/adapters/mock/ur_mockddi.cpp +++ b/source/adapters/mock/ur_mockddi.cpp @@ -921,7 +921,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. - ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance + ur_adapter_handle_t + hAdapter, ///< [in] handle of the adapter to which `hNativeDevice` belongs const ur_device_native_properties_t * pProperties, ///< [in][optional] pointer to native device properties struct. ur_device_handle_t @@ -930,7 +931,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_result_t result = UR_RESULT_SUCCESS; ur_device_create_with_native_handle_params_t params = { - &hNativeDevice, &hPlatform, &pProperties, &phDevice}; + &hNativeDevice, &hAdapter, &pProperties, &phDevice}; auto beforeCallback = reinterpret_cast( mock::getCallbacks().get_before_callback( diff --git a/source/adapters/native_cpu/device.cpp b/source/adapters/native_cpu/device.cpp index 64d99927ae..4b32c11e37 100644 --- a/source/adapters/native_cpu/device.cpp +++ b/source/adapters/native_cpu/device.cpp @@ -366,11 +366,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle( } UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( - ur_native_handle_t hNativeDevice, ur_platform_handle_t hPlatform, + ur_native_handle_t hNativeDevice, ur_adapter_handle_t hAdapter, const ur_device_native_properties_t *pProperties, ur_device_handle_t *phDevice) { std::ignore = hNativeDevice; - std::ignore = hPlatform; + std::ignore = hAdapter; std::ignore = pProperties; std::ignore = phDevice; diff --git a/source/adapters/opencl/device.cpp b/source/adapters/opencl/device.cpp index 44262df26a..a31d6580a0 100644 --- a/source/adapters/opencl/device.cpp +++ b/source/adapters/opencl/device.cpp @@ -1125,7 +1125,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle( } UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( - ur_native_handle_t hNativeDevice, ur_platform_handle_t, + ur_native_handle_t hNativeDevice, ur_adapter_handle_t, const ur_device_native_properties_t *, ur_device_handle_t *phDevice) { *phDevice = reinterpret_cast(hNativeDevice); diff --git a/source/loader/layers/tracing/ur_trcddi.cpp b/source/loader/layers/tracing/ur_trcddi.cpp index 83ef28a3e8..a368ae7b1a 100644 --- a/source/loader/layers/tracing/ur_trcddi.cpp +++ b/source/loader/layers/tracing/ur_trcddi.cpp @@ -705,7 +705,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. - ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance + ur_adapter_handle_t + hAdapter, ///< [in] handle of the adapter to which `hNativeDevice` belongs const ur_device_native_properties_t * pProperties, ///< [in][optional] pointer to native device properties struct. ur_device_handle_t @@ -719,14 +720,14 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( } ur_device_create_with_native_handle_params_t params = { - &hNativeDevice, &hPlatform, &pProperties, &phDevice}; + &hNativeDevice, &hAdapter, &pProperties, &phDevice}; uint64_t instance = getContext()->notify_begin(UR_FUNCTION_DEVICE_CREATE_WITH_NATIVE_HANDLE, "urDeviceCreateWithNativeHandle", ¶ms); getContext()->logger.info("---> urDeviceCreateWithNativeHandle"); - ur_result_t result = pfnCreateWithNativeHandle(hNativeDevice, hPlatform, + ur_result_t result = pfnCreateWithNativeHandle(hNativeDevice, hAdapter, pProperties, phDevice); getContext()->notify_end(UR_FUNCTION_DEVICE_CREATE_WITH_NATIVE_HANDLE, diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index 2b5b99c7d8..968cd645f7 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -719,7 +719,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. - ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance + ur_adapter_handle_t + hAdapter, ///< [in] handle of the adapter to which `hNativeDevice` belongs const ur_device_native_properties_t * pProperties, ///< [in][optional] pointer to native device properties struct. ur_device_handle_t @@ -733,7 +734,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( } if (getContext()->enableParameterValidation) { - if (NULL == hPlatform) { + if (NULL == hAdapter) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } @@ -742,7 +743,12 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( } } - ur_result_t result = pfnCreateWithNativeHandle(hNativeDevice, hPlatform, + if (getContext()->enableLifetimeValidation && + !getContext()->refCountContext->isReferenceValid(hAdapter)) { + getContext()->refCountContext->logInvalidReference(hAdapter); + } + + ur_result_t result = pfnCreateWithNativeHandle(hNativeDevice, hAdapter, pProperties, phDevice); if (getContext()->enableLeakChecking && result == UR_RESULT_SUCCESS) { diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index 2f2cf2bc70..c1d023af55 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -764,7 +764,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. - ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance + ur_adapter_handle_t + hAdapter, ///< [in] handle of the adapter to which `hNativeDevice` belongs const ur_device_native_properties_t * pProperties, ///< [in][optional] pointer to native device properties struct. ur_device_handle_t @@ -775,8 +776,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( [[maybe_unused]] auto context = getContext(); // extract platform's function pointer table - auto dditable = - reinterpret_cast(hPlatform)->dditable; + auto dditable = reinterpret_cast(hAdapter)->dditable; auto pfnCreateWithNativeHandle = dditable->ur.Device.pfnCreateWithNativeHandle; if (nullptr == pfnCreateWithNativeHandle) { @@ -784,10 +784,10 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( } // convert loader handle to platform handle - hPlatform = reinterpret_cast(hPlatform)->handle; + hAdapter = reinterpret_cast(hAdapter)->handle; // forward to device-platform - result = pfnCreateWithNativeHandle(hNativeDevice, hPlatform, pProperties, + result = pfnCreateWithNativeHandle(hNativeDevice, hAdapter, pProperties, phDevice); if (UR_RESULT_SUCCESS != result) { diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index ba2eb67073..5ab7c58803 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -1135,7 +1135,7 @@ ur_result_t UR_APICALL urDeviceGetNativeHandle( /// - ::UR_RESULT_ERROR_DEVICE_LOST /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `NULL == hPlatform` +/// + `NULL == hAdapter` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phDevice` /// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE @@ -1143,7 +1143,8 @@ ur_result_t UR_APICALL urDeviceGetNativeHandle( ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. - ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance + ur_adapter_handle_t + hAdapter, ///< [in] handle of the adapter to which `hNativeDevice` belongs const ur_device_native_properties_t * pProperties, ///< [in][optional] pointer to native device properties struct. ur_device_handle_t @@ -1155,7 +1156,7 @@ ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnCreateWithNativeHandle(hNativeDevice, hPlatform, pProperties, + return pfnCreateWithNativeHandle(hNativeDevice, hAdapter, pProperties, phDevice); } catch (...) { return exceptionToResult(std::current_exception()); diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 7735101c18..54bfdcda42 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -997,7 +997,7 @@ ur_result_t UR_APICALL urDeviceGetNativeHandle( /// - ::UR_RESULT_ERROR_DEVICE_LOST /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `NULL == hPlatform` +/// + `NULL == hAdapter` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phDevice` /// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE @@ -1005,7 +1005,8 @@ ur_result_t UR_APICALL urDeviceGetNativeHandle( ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. - ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance + ur_adapter_handle_t + hAdapter, ///< [in] handle of the adapter to which `hNativeDevice` belongs const ur_device_native_properties_t * pProperties, ///< [in][optional] pointer to native device properties struct. ur_device_handle_t diff --git a/test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp b/test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp index 6eb502907b..e4ac022507 100644 --- a/test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp +++ b/test/adapters/cuda/urDeviceCreateWithNativeHandle.cpp @@ -17,6 +17,6 @@ TEST_F(urCudaDeviceCreateWithNativeHandle, Success) { ur_native_handle_t nativeCuda = static_cast(cudaDevice); ur_device_handle_t urDevice; - ASSERT_SUCCESS(urDeviceCreateWithNativeHandle(nativeCuda, platform, nullptr, + ASSERT_SUCCESS(urDeviceCreateWithNativeHandle(nativeCuda, adapter, nullptr, &urDevice)); } diff --git a/test/conformance/device/urDeviceCreateWithNativeHandle.cpp b/test/conformance/device/urDeviceCreateWithNativeHandle.cpp index 071183aa9b..5d64b11e09 100644 --- a/test/conformance/device/urDeviceCreateWithNativeHandle.cpp +++ b/test/conformance/device/urDeviceCreateWithNativeHandle.cpp @@ -20,7 +20,7 @@ TEST_F(urDeviceCreateWithNativeHandleTest, Success) { // and perform some query on it to verify that it works. ur_device_handle_t dev = nullptr; UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceCreateWithNativeHandle( - native_handle, platform, nullptr, &dev)); + native_handle, adapter, nullptr, &dev)); ASSERT_NE(dev, nullptr); uint32_t dev_id = 0; @@ -41,7 +41,7 @@ TEST_F(urDeviceCreateWithNativeHandleTest, SuccessWithOwnedNativeHandle) { ur_device_native_properties_t props{ UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, true}; UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceCreateWithNativeHandle( - native_handle, platform, &props, &dev)); + native_handle, adapter, &props, &dev)); ASSERT_NE(dev, nullptr); uint32_t ref_count = 0; @@ -64,7 +64,7 @@ TEST_F(urDeviceCreateWithNativeHandleTest, SuccessWithUnOwnedNativeHandle) { ur_device_native_properties_t props{ UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES, nullptr, false}; UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urDeviceCreateWithNativeHandle( - native_handle, platform, &props, &dev)); + native_handle, adapter, &props, &dev)); ASSERT_NE(dev, nullptr); uint32_t ref_count = 0; @@ -93,7 +93,7 @@ TEST_F(urDeviceCreateWithNativeHandleTest, InvalidNullPointerDevice) { ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER, - urDeviceCreateWithNativeHandle(native_handle, platform, + urDeviceCreateWithNativeHandle(native_handle, adapter, nullptr, nullptr)); } }