From c2fc29f167947977b7bfbaa09e0c0117aa78797e Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Mon, 17 Jul 2023 16:17:34 +0100 Subject: [PATCH] [ur] Allow native handles to be unsupported Some adapters do not map directly to Unified Runtime's set of API objects and as such are unable to support getting the underlying native handle or creating objects from native handles. This patch adds the `UR_RESULT_ERROR_UNSUPPORTED_FEATURE` to all native handle entry-points and updates the conformance tests to match. --- include/ur_api.h | 38 +++++++++++++++++++ scripts/core/context.yml | 6 +++ scripts/core/device.yml | 6 +++ scripts/core/event.yml | 6 +++ scripts/core/kernel.yml | 6 +++ scripts/core/memory.yml | 9 +++++ scripts/core/platform.yml | 6 +++ scripts/core/program.yml | 6 +++ scripts/core/queue.yml | 6 +++ scripts/core/sampler.yml | 6 +++ source/loader/ur_libapi.cpp | 38 +++++++++++++++++++ source/ur_api.cpp | 38 +++++++++++++++++++ .../urContextCreateWithNativeHandle.cpp | 4 +- .../context/urContextGetNativeHandle.cpp | 4 +- .../device/urDeviceCreateWithNativeHandle.cpp | 4 +- .../device/urDeviceGetNativeHandle.cpp | 4 +- .../event/urEventCreateWithNativeHandle.cpp | 4 +- .../event/urEventGetNativeHandle.cpp | 4 +- .../kernel/urKernelCreateWithNativeHandle.cpp | 4 +- .../kernel/urKernelGetNativeHandle.cpp | 4 +- .../urMemBufferCreateWithNativeHandle.cpp | 4 +- .../memory/urMemGetNativeHandle.cpp | 4 +- .../urMemImageCreateWithNativeHandle.cpp | 4 +- .../urPlatformCreateWithNativeHandle.cpp | 8 +++- .../urProgramCreateWithNativeHandle.cpp | 6 ++- .../program/urProgramGetNativeHandle.cpp | 5 ++- .../queue/urQueueCreateWithNativeHandle.cpp | 4 +- .../queue/urQueueGetNativeHandle.cpp | 4 +- .../urSamplerCreateWithNativeHandle.cpp | 4 +- .../sampler/urSamplerGetNativeHandle.cpp | 4 +- 30 files changed, 230 insertions(+), 20 deletions(-) diff --git a/include/ur_api.h b/include/ur_api.h index 7bae504b3a..c4ef854f76 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -726,6 +726,8 @@ urPlatformGetApiVersion( /// + `NULL == hPlatform` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativePlatform` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetNativeHandle( ur_platform_handle_t hPlatform, ///< [in] handle of the platform. @@ -760,6 +762,8 @@ typedef struct ur_platform_native_properties_t { /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phPlatform` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( ur_native_handle_t hNativePlatform, ///< [in][nocheck] the native handle of the platform. @@ -1529,6 +1533,8 @@ typedef enum ur_device_exec_capability_flag_t { /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeDevice` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle( ur_device_handle_t hDevice, ///< [in] handle of the device. @@ -1565,6 +1571,8 @@ typedef struct ur_device_native_properties_t { /// + `NULL == hPlatform` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phDevice` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. @@ -1864,6 +1872,8 @@ urContextGetInfo( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeContext` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urContextGetNativeHandle( ur_context_handle_t hContext, ///< [in] handle of the context. @@ -1899,6 +1909,8 @@ typedef struct ur_context_native_properties_t { /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phDevices` /// + `NULL == phContext` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urContextCreateWithNativeHandle( ur_native_handle_t hNativeContext, ///< [in][nocheck] the native handle of the context. @@ -2340,6 +2352,8 @@ urMemBufferPartition( /// + `NULL == hMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeMem` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urMemGetNativeHandle( ur_mem_handle_t hMem, ///< [in] handle of the mem. @@ -2375,6 +2389,8 @@ typedef struct ur_mem_native_properties_t { /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phMem` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( ur_native_handle_t hNativeMem, ///< [in][nocheck] the native handle to the memory. @@ -2402,6 +2418,8 @@ urMemBufferCreateWithNativeHandle( /// + `NULL == pImageFormat` /// + `NULL == pImageDesc` /// + `NULL == phMem` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( ur_native_handle_t hNativeMem, ///< [in][nocheck] the native handle to the memory. @@ -2700,6 +2718,8 @@ urSamplerGetInfo( /// + `NULL == hSampler` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeSampler` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urSamplerGetNativeHandle( ur_sampler_handle_t hSampler, ///< [in] handle of the sampler. @@ -2736,6 +2756,8 @@ typedef struct ur_sampler_native_properties_t { /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phSampler` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( ur_native_handle_t hNativeSampler, ///< [in][nocheck] the native handle of the sampler. @@ -4032,6 +4054,8 @@ urProgramSetSpecializationConstants( /// + `NULL == hProgram` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeProgram` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urProgramGetNativeHandle( ur_program_handle_t hProgram, ///< [in] handle of the program. @@ -4068,6 +4092,8 @@ typedef struct ur_program_native_properties_t { /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phProgram` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithNativeHandle( ur_native_handle_t hNativeProgram, ///< [in][nocheck] the native handle of the program. @@ -4611,6 +4637,8 @@ urKernelSetSpecializationConstants( /// + `NULL == hKernel` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeKernel` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urKernelGetNativeHandle( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel. @@ -4648,6 +4676,8 @@ typedef struct ur_kernel_native_properties_t { /// + `NULL == hProgram` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phKernel` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urKernelCreateWithNativeHandle( ur_native_handle_t hNativeKernel, ///< [in][nocheck] the native handle of the kernel. @@ -4902,6 +4932,8 @@ typedef struct ur_queue_native_desc_t { /// + `NULL == hQueue` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeQueue` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urQueueGetNativeHandle( ur_queue_handle_t hQueue, ///< [in] handle of the queue. @@ -4940,6 +4972,8 @@ typedef struct ur_queue_native_properties_t { /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phQueue` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urQueueCreateWithNativeHandle( ur_native_handle_t hNativeQueue, ///< [in][nocheck] the native handle of the queue. @@ -5264,6 +5298,8 @@ urEventRelease( /// + `NULL == hEvent` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeEvent` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urEventGetNativeHandle( ur_event_handle_t hEvent, ///< [in] handle of the event. @@ -5300,6 +5336,8 @@ typedef struct ur_event_native_properties_t { /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phEvent` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle( ur_native_handle_t hNativeEvent, ///< [in][nocheck] the native handle of the event. diff --git a/scripts/core/context.yml b/scripts/core/context.yml index d23c7b1320..fef1161fca 100644 --- a/scripts/core/context.yml +++ b/scripts/core/context.yml @@ -196,6 +196,9 @@ params: name: phNativeContext desc: | [out] a pointer to the native handle of the context. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: struct desc: "Properties for for $xContextCreateWithNativeHandle." @@ -238,6 +241,9 @@ params: name: phContext desc: | [out] pointer to the handle of the context object created. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: fptr_typedef desc: "Context's extended deleter callback function with user data." diff --git a/scripts/core/device.yml b/scripts/core/device.yml index 9efebc5e72..3697095eea 100644 --- a/scripts/core/device.yml +++ b/scripts/core/device.yml @@ -731,6 +731,9 @@ params: name: phNativeDevice desc: | [out] a pointer to the native handle of the device. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: struct desc: "Native device creation properties" @@ -768,6 +771,9 @@ params: - type: "$x_device_handle_t*" name: phDevice desc: "[out] pointer to the handle of the device object created." +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: function desc: "Returns synchronized Host and Device global timestamps." diff --git a/scripts/core/event.yml b/scripts/core/event.yml index 7da347dae2..c20a8e04c9 100644 --- a/scripts/core/event.yml +++ b/scripts/core/event.yml @@ -266,6 +266,9 @@ params: name: phNativeEvent desc: | [out] a pointer to the native handle of the event. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: struct desc: "Properties for for $xEventCreateWithNativeHandle." @@ -305,6 +308,9 @@ params: name: phEvent desc: | [out] pointer to the handle of the event object created. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: enum desc: "Event states for all events." diff --git a/scripts/core/kernel.yml b/scripts/core/kernel.yml index bd444873d5..27481f810f 100644 --- a/scripts/core/kernel.yml +++ b/scripts/core/kernel.yml @@ -487,6 +487,9 @@ params: name: phNativeKernel desc: | [out] a pointer to the native handle of the kernel. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: struct desc: "Properties for for $xKernelCreateWithNativeHandle." @@ -529,3 +532,6 @@ params: name: phKernel desc: | [out] pointer to the handle of the kernel object created. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." diff --git a/scripts/core/memory.yml b/scripts/core/memory.yml index 5a0d6ed6b5..ede16a1913 100644 --- a/scripts/core/memory.yml +++ b/scripts/core/memory.yml @@ -436,6 +436,9 @@ params: name: phNativeMem desc: | [out] a pointer to the native handle of the mem. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: struct desc: "Native memory object creation properties" @@ -473,6 +476,9 @@ params: - type: $x_mem_handle_t* name: phMem desc: "[out] pointer to handle of buffer memory object created." +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: function desc: "Create runtime image memory object from native memory handle." @@ -503,6 +509,9 @@ params: - type: $x_mem_handle_t* name: phMem desc: "[out] pointer to handle of image memory object created." +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: function desc: "Retrieve information about a memory object." diff --git a/scripts/core/platform.yml b/scripts/core/platform.yml index 7188044848..57666421d0 100644 --- a/scripts/core/platform.yml +++ b/scripts/core/platform.yml @@ -161,6 +161,9 @@ params: name: phNativePlatform desc: | [out] a pointer to the native handle of the platform. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: struct desc: "Native platform creation properties" @@ -195,6 +198,9 @@ params: - type: "$x_platform_handle_t*" name: phPlatform desc: "[out] pointer to the handle of the platform object created." +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: function desc: "Get the platform specific compiler backend option from a generic frontend option." diff --git a/scripts/core/program.yml b/scripts/core/program.yml index ade7e43541..acab24c3bd 100644 --- a/scripts/core/program.yml +++ b/scripts/core/program.yml @@ -514,6 +514,9 @@ params: name: phNativeProgram desc: | [out] a pointer to the native handle of the program. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: struct desc: "Native program creation properties" @@ -551,3 +554,6 @@ params: - type: "$x_program_handle_t*" name: phProgram desc: "[out] pointer to the handle of the program object created." +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." diff --git a/scripts/core/queue.yml b/scripts/core/queue.yml index 2aa1f936af..88fe153165 100644 --- a/scripts/core/queue.yml +++ b/scripts/core/queue.yml @@ -244,6 +244,9 @@ params: name: phNativeQueue desc: | [out] a pointer to the native handle of the queue. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: struct desc: "Properties for for $xQueueCreateWithNativeHandle." @@ -286,6 +289,9 @@ params: name: phQueue desc: | [out] pointer to the handle of the queue object created. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: function desc: "Blocks until all previously issued commands to the command queue are finished." diff --git a/scripts/core/sampler.yml b/scripts/core/sampler.yml index fd3eb6ebbb..7bb33b357e 100644 --- a/scripts/core/sampler.yml +++ b/scripts/core/sampler.yml @@ -194,6 +194,9 @@ params: name: phNativeSampler desc: | [out] a pointer to the native handle of the sampler. +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." --- #-------------------------------------------------------------------------- type: struct desc: "Native sampler creation properties" @@ -231,3 +234,6 @@ params: - type: "$x_sampler_handle_t*" name: phSampler desc: "[out] pointer to the handle of the sampler object created." +returns: + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If the adapter has no underlying equivalent handle." diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index c75e4cea04..725b25610c 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -235,6 +235,8 @@ ur_result_t UR_APICALL urPlatformGetApiVersion( /// + `NULL == hPlatform` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativePlatform` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urPlatformGetNativeHandle( ur_platform_handle_t hPlatform, ///< [in] handle of the platform. ur_native_handle_t * @@ -267,6 +269,8 @@ ur_result_t UR_APICALL urPlatformGetNativeHandle( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phPlatform` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( ur_native_handle_t hNativePlatform, ///< [in][nocheck] the native handle of the platform. @@ -696,6 +700,8 @@ ur_result_t UR_APICALL urDeviceSelectBinary( /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeDevice` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urDeviceGetNativeHandle( ur_device_handle_t hDevice, ///< [in] handle of the device. ur_native_handle_t @@ -730,6 +736,8 @@ ur_result_t UR_APICALL urDeviceGetNativeHandle( /// + `NULL == hPlatform` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phDevice` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. @@ -982,6 +990,8 @@ ur_result_t UR_APICALL urContextGetInfo( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeContext` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urContextGetNativeHandle( ur_context_handle_t hContext, ///< [in] handle of the context. ur_native_handle_t * @@ -1015,6 +1025,8 @@ ur_result_t UR_APICALL urContextGetNativeHandle( /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phDevices` /// + `NULL == phContext` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urContextCreateWithNativeHandle( ur_native_handle_t hNativeContext, ///< [in][nocheck] the native handle of the context. @@ -1313,6 +1325,8 @@ ur_result_t UR_APICALL urMemBufferPartition( /// + `NULL == hMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeMem` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urMemGetNativeHandle( ur_mem_handle_t hMem, ///< [in] handle of the mem. ur_native_handle_t @@ -1346,6 +1360,8 @@ ur_result_t UR_APICALL urMemGetNativeHandle( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phMem` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( ur_native_handle_t hNativeMem, ///< [in][nocheck] the native handle to the memory. @@ -1386,6 +1402,8 @@ ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( /// + `NULL == pImageFormat` /// + `NULL == pImageDesc` /// + `NULL == phMem` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( ur_native_handle_t hNativeMem, ///< [in][nocheck] the native handle to the memory. @@ -1700,6 +1718,8 @@ ur_result_t UR_APICALL urSamplerGetInfo( /// + `NULL == hSampler` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeSampler` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urSamplerGetNativeHandle( ur_sampler_handle_t hSampler, ///< [in] handle of the sampler. ur_native_handle_t * @@ -1734,6 +1754,8 @@ ur_result_t UR_APICALL urSamplerGetNativeHandle( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phSampler` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( ur_native_handle_t hNativeSampler, ///< [in][nocheck] the native handle of the sampler. @@ -2973,6 +2995,8 @@ ur_result_t UR_APICALL urProgramSetSpecializationConstants( /// + `NULL == hProgram` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeProgram` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urProgramGetNativeHandle( ur_program_handle_t hProgram, ///< [in] handle of the program. ur_native_handle_t * @@ -3007,6 +3031,8 @@ ur_result_t UR_APICALL urProgramGetNativeHandle( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phProgram` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urProgramCreateWithNativeHandle( ur_native_handle_t hNativeProgram, ///< [in][nocheck] the native handle of the program. @@ -3553,6 +3579,8 @@ ur_result_t UR_APICALL urKernelSetSpecializationConstants( /// + `NULL == hKernel` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeKernel` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urKernelGetNativeHandle( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel. ur_native_handle_t @@ -3588,6 +3616,8 @@ ur_result_t UR_APICALL urKernelGetNativeHandle( /// + `NULL == hProgram` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phKernel` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urKernelCreateWithNativeHandle( ur_native_handle_t hNativeKernel, ///< [in][nocheck] the native handle of the kernel. @@ -3796,6 +3826,8 @@ ur_result_t UR_APICALL urQueueRelease( /// + `NULL == hQueue` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeQueue` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urQueueGetNativeHandle( ur_queue_handle_t hQueue, ///< [in] handle of the queue. ur_queue_native_desc_t @@ -3833,6 +3865,8 @@ ur_result_t UR_APICALL urQueueGetNativeHandle( /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phQueue` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urQueueCreateWithNativeHandle( ur_native_handle_t hNativeQueue, ///< [in][nocheck] the native handle of the queue. @@ -4139,6 +4173,8 @@ ur_result_t UR_APICALL urEventRelease( /// + `NULL == hEvent` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeEvent` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urEventGetNativeHandle( ur_event_handle_t hEvent, ///< [in] handle of the event. ur_native_handle_t @@ -4173,6 +4209,8 @@ ur_result_t UR_APICALL urEventGetNativeHandle( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phEvent` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urEventCreateWithNativeHandle( ur_native_handle_t hNativeEvent, ///< [in][nocheck] the native handle of the event. diff --git a/source/ur_api.cpp b/source/ur_api.cpp index d571e4c34d..3dcb925ed0 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -192,6 +192,8 @@ ur_result_t UR_APICALL urPlatformGetApiVersion( /// + `NULL == hPlatform` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativePlatform` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urPlatformGetNativeHandle( ur_platform_handle_t hPlatform, ///< [in] handle of the platform. ur_native_handle_t * @@ -217,6 +219,8 @@ ur_result_t UR_APICALL urPlatformGetNativeHandle( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phPlatform` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( ur_native_handle_t hNativePlatform, ///< [in][nocheck] the native handle of the platform. @@ -589,6 +593,8 @@ ur_result_t UR_APICALL urDeviceSelectBinary( /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeDevice` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urDeviceGetNativeHandle( ur_device_handle_t hDevice, ///< [in] handle of the device. ur_native_handle_t @@ -616,6 +622,8 @@ ur_result_t UR_APICALL urDeviceGetNativeHandle( /// + `NULL == hPlatform` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phDevice` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( ur_native_handle_t hNativeDevice, ///< [in][nocheck] the native handle of the device. @@ -829,6 +837,8 @@ ur_result_t UR_APICALL urContextGetInfo( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeContext` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urContextGetNativeHandle( ur_context_handle_t hContext, ///< [in] handle of the context. ur_native_handle_t * @@ -855,6 +865,8 @@ ur_result_t UR_APICALL urContextGetNativeHandle( /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phDevices` /// + `NULL == phContext` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urContextCreateWithNativeHandle( ur_native_handle_t hNativeContext, ///< [in][nocheck] the native handle of the context. @@ -1106,6 +1118,8 @@ ur_result_t UR_APICALL urMemBufferPartition( /// + `NULL == hMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeMem` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urMemGetNativeHandle( ur_mem_handle_t hMem, ///< [in] handle of the mem. ur_native_handle_t @@ -1132,6 +1146,8 @@ ur_result_t UR_APICALL urMemGetNativeHandle( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phMem` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( ur_native_handle_t hNativeMem, ///< [in][nocheck] the native handle to the memory. @@ -1164,6 +1180,8 @@ ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( /// + `NULL == pImageFormat` /// + `NULL == pImageDesc` /// + `NULL == phMem` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( ur_native_handle_t hNativeMem, ///< [in][nocheck] the native handle to the memory. @@ -1433,6 +1451,8 @@ ur_result_t UR_APICALL urSamplerGetInfo( /// + `NULL == hSampler` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeSampler` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urSamplerGetNativeHandle( ur_sampler_handle_t hSampler, ///< [in] handle of the sampler. ur_native_handle_t * @@ -1460,6 +1480,8 @@ ur_result_t UR_APICALL urSamplerGetNativeHandle( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phSampler` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( ur_native_handle_t hNativeSampler, ///< [in][nocheck] the native handle of the sampler. @@ -2500,6 +2522,8 @@ ur_result_t UR_APICALL urProgramSetSpecializationConstants( /// + `NULL == hProgram` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeProgram` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urProgramGetNativeHandle( ur_program_handle_t hProgram, ///< [in] handle of the program. ur_native_handle_t * @@ -2527,6 +2551,8 @@ ur_result_t UR_APICALL urProgramGetNativeHandle( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phProgram` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urProgramCreateWithNativeHandle( ur_native_handle_t hNativeProgram, ///< [in][nocheck] the native handle of the program. @@ -2983,6 +3009,8 @@ ur_result_t UR_APICALL urKernelSetSpecializationConstants( /// + `NULL == hKernel` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeKernel` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urKernelGetNativeHandle( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel. ur_native_handle_t @@ -3011,6 +3039,8 @@ ur_result_t UR_APICALL urKernelGetNativeHandle( /// + `NULL == hProgram` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phKernel` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urKernelCreateWithNativeHandle( ur_native_handle_t hNativeKernel, ///< [in][nocheck] the native handle of the kernel. @@ -3187,6 +3217,8 @@ ur_result_t UR_APICALL urQueueRelease( /// + `NULL == hQueue` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeQueue` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urQueueGetNativeHandle( ur_queue_handle_t hQueue, ///< [in] handle of the queue. ur_queue_native_desc_t @@ -3217,6 +3249,8 @@ ur_result_t UR_APICALL urQueueGetNativeHandle( /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phQueue` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urQueueCreateWithNativeHandle( ur_native_handle_t hNativeQueue, ///< [in][nocheck] the native handle of the queue. @@ -3471,6 +3505,8 @@ ur_result_t UR_APICALL urEventRelease( /// + `NULL == hEvent` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phNativeEvent` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urEventGetNativeHandle( ur_event_handle_t hEvent, ///< [in] handle of the event. ur_native_handle_t @@ -3498,6 +3534,8 @@ ur_result_t UR_APICALL urEventGetNativeHandle( /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phEvent` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If the adapter has no underlying equivalent handle. ur_result_t UR_APICALL urEventCreateWithNativeHandle( ur_native_handle_t hNativeEvent, ///< [in][nocheck] the native handle of the event. diff --git a/test/conformance/context/urContextCreateWithNativeHandle.cpp b/test/conformance/context/urContextCreateWithNativeHandle.cpp index 21881169cc..04ef93c0f0 100644 --- a/test/conformance/context/urContextCreateWithNativeHandle.cpp +++ b/test/conformance/context/urContextCreateWithNativeHandle.cpp @@ -10,7 +10,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urContextCreateWithNativeHandleTest); TEST_P(urContextCreateWithNativeHandleTest, Success) { ur_native_handle_t native_context = nullptr; - ASSERT_SUCCESS(urContextGetNativeHandle(context, &native_context)); + if (urContextGetNativeHandle(context, &native_context)) { + GTEST_SKIP(); + } // We cannot assume anything about a native_handle, not even if it's // `nullptr` since this could be a valid representation within a backend. diff --git a/test/conformance/context/urContextGetNativeHandle.cpp b/test/conformance/context/urContextGetNativeHandle.cpp index 420379fca4..fda7222568 100644 --- a/test/conformance/context/urContextGetNativeHandle.cpp +++ b/test/conformance/context/urContextGetNativeHandle.cpp @@ -10,7 +10,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urContextGetNativeHandleTest); TEST_P(urContextGetNativeHandleTest, Success) { ur_native_handle_t native_context = nullptr; - ASSERT_SUCCESS(urContextGetNativeHandle(context, &native_context)); + if (auto error = urContextGetNativeHandle(context, &native_context)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); + } } TEST_P(urContextGetNativeHandleTest, InvalidNullHandleContext) { diff --git a/test/conformance/device/urDeviceCreateWithNativeHandle.cpp b/test/conformance/device/urDeviceCreateWithNativeHandle.cpp index 5707a4088b..fbcd5e2f4b 100644 --- a/test/conformance/device/urDeviceCreateWithNativeHandle.cpp +++ b/test/conformance/device/urDeviceCreateWithNativeHandle.cpp @@ -9,7 +9,9 @@ using urDeviceCreateWithNativeHandleTest = uur::urAllDevicesTest; TEST_F(urDeviceCreateWithNativeHandleTest, Success) { for (auto device : devices) { ur_native_handle_t native_handle = nullptr; - ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); + if (urDeviceGetNativeHandle(device, &native_handle)) { + continue; + } // We cannot assume anything about a native_handle, not even if it's // `nullptr` since this could be a valid representation within a backend. diff --git a/test/conformance/device/urDeviceGetNativeHandle.cpp b/test/conformance/device/urDeviceGetNativeHandle.cpp index 301ec16d1d..f6bdec3dd6 100644 --- a/test/conformance/device/urDeviceGetNativeHandle.cpp +++ b/test/conformance/device/urDeviceGetNativeHandle.cpp @@ -9,7 +9,9 @@ using urDeviceGetNativeHandleTest = uur::urAllDevicesTest; TEST_F(urDeviceGetNativeHandleTest, Success) { for (auto device : devices) { ur_native_handle_t native_handle = nullptr; - ASSERT_SUCCESS(urDeviceGetNativeHandle(device, &native_handle)); + if (auto error = urDeviceGetNativeHandle(device, &native_handle)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); + } } } diff --git a/test/conformance/event/urEventCreateWithNativeHandle.cpp b/test/conformance/event/urEventCreateWithNativeHandle.cpp index 29f1c1b9dc..3a2d6eea84 100644 --- a/test/conformance/event/urEventCreateWithNativeHandle.cpp +++ b/test/conformance/event/urEventCreateWithNativeHandle.cpp @@ -10,7 +10,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventCreateWithNativeHandleTest); TEST_P(urEventCreateWithNativeHandleTest, Success) { ur_native_handle_t native_event = nullptr; - ASSERT_SUCCESS(urEventGetNativeHandle(event, &native_event)); + if (urEventGetNativeHandle(event, &native_event)) { + GTEST_SKIP(); + } // We cannot assume anything about a native_handle, not even if it's // `nullptr` since this could be a valid representation within a backend. diff --git a/test/conformance/event/urEventGetNativeHandle.cpp b/test/conformance/event/urEventGetNativeHandle.cpp index 6a6003091d..fa2a2cffdf 100644 --- a/test/conformance/event/urEventGetNativeHandle.cpp +++ b/test/conformance/event/urEventGetNativeHandle.cpp @@ -10,7 +10,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventGetNativeHandleTest); TEST_P(urEventGetNativeHandleTest, Success) { ur_native_handle_t native_event = nullptr; - ASSERT_SUCCESS(urEventGetNativeHandle(event, &native_event)); + if (auto error = urEventGetNativeHandle(event, &native_event)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); + } } TEST_P(urEventGetNativeHandleTest, InvalidNullHandleEvent) { diff --git a/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp b/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp index 336d44fd45..7575fb309f 100644 --- a/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp +++ b/test/conformance/kernel/urKernelCreateWithNativeHandle.cpp @@ -8,7 +8,9 @@ struct urKernelCreateWithNativeHandleTest : uur::urKernelTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::SetUp()); - ASSERT_SUCCESS(urKernelGetNativeHandle(kernel, &native_kernel_handle)); + if (urKernelGetNativeHandle(kernel, &native_kernel_handle)) { + GTEST_SKIP(); + } } void TearDown() override { diff --git a/test/conformance/kernel/urKernelGetNativeHandle.cpp b/test/conformance/kernel/urKernelGetNativeHandle.cpp index 84249c40b0..39978a9ad9 100644 --- a/test/conformance/kernel/urKernelGetNativeHandle.cpp +++ b/test/conformance/kernel/urKernelGetNativeHandle.cpp @@ -10,7 +10,9 @@ UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelGetNativeHandleTest); TEST_P(urKernelGetNativeHandleTest, Success) { ur_native_handle_t native_kernel_handle = nullptr; - ASSERT_SUCCESS(urKernelGetNativeHandle(kernel, &native_kernel_handle)); + if (auto error = urKernelGetNativeHandle(kernel, &native_kernel_handle)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); + } } TEST_P(urKernelGetNativeHandleTest, InvalidNullHandleKernel) { diff --git a/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp b/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp index ddc4516f46..2d6babd56e 100644 --- a/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp +++ b/test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp @@ -10,7 +10,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemBufferCreateWithNativeHandleTest); TEST_P(urMemBufferCreateWithNativeHandleTest, Success) { ur_native_handle_t hNativeMem = nullptr; - ASSERT_SUCCESS(urMemGetNativeHandle(buffer, &hNativeMem)); + if (urMemGetNativeHandle(buffer, &hNativeMem)) { + GTEST_SKIP(); + } // We cannot assume anything about a native_handle, not even if it's // `nullptr` since this could be a valid representation within a backend. diff --git a/test/conformance/memory/urMemGetNativeHandle.cpp b/test/conformance/memory/urMemGetNativeHandle.cpp index f667a9f571..1dbb959c3f 100644 --- a/test/conformance/memory/urMemGetNativeHandle.cpp +++ b/test/conformance/memory/urMemGetNativeHandle.cpp @@ -9,7 +9,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemGetNativeHandleTest); TEST_P(urMemGetNativeHandleTest, Success) { ur_native_handle_t hNativeMem = nullptr; - ASSERT_SUCCESS(urMemGetNativeHandle(buffer, &hNativeMem)); + if (auto error = urMemGetNativeHandle(buffer, &hNativeMem)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); + } } TEST_P(urMemGetNativeHandleTest, InvalidNullHandleMem) { diff --git a/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp b/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp index 59331305f1..f22e6c38e5 100644 --- a/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp +++ b/test/conformance/memory/urMemImageCreateWithNativeHandle.cpp @@ -10,7 +10,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemImageCreateWithNativeHandleTest); TEST_P(urMemImageCreateWithNativeHandleTest, Success) { ur_native_handle_t native_handle = nullptr; - ASSERT_SUCCESS(urMemGetNativeHandle(image, &native_handle)); + if (urMemGetNativeHandle(image, &native_handle)) { + GTEST_SKIP(); + } ur_mem_handle_t mem = nullptr; ASSERT_EQ_RESULT( diff --git a/test/conformance/platform/urPlatformCreateWithNativeHandle.cpp b/test/conformance/platform/urPlatformCreateWithNativeHandle.cpp index 837f1b6c5f..6dd3310f6a 100644 --- a/test/conformance/platform/urPlatformCreateWithNativeHandle.cpp +++ b/test/conformance/platform/urPlatformCreateWithNativeHandle.cpp @@ -10,7 +10,9 @@ using urPlatformCreateWithNativeHandleTest = uur::platform::urPlatformTest; TEST_F(urPlatformCreateWithNativeHandleTest, Success) { for (auto platform : platforms) { ur_native_handle_t native_handle = nullptr; - ASSERT_SUCCESS(urPlatformGetNativeHandle(platform, &native_handle)); + if (urPlatformGetNativeHandle(platform, &native_handle)) { + continue; + }; // We cannot assume anything about a native_handle, not even if it's // `nullptr` since this could be a valid representation within a backend. @@ -31,7 +33,9 @@ TEST_F(urPlatformCreateWithNativeHandleTest, Success) { TEST_F(urPlatformCreateWithNativeHandleTest, InvalidNullPointerPlatform) { for (auto platform : platforms) { ur_native_handle_t native_handle = nullptr; - ASSERT_SUCCESS(urPlatformGetNativeHandle(platform, &native_handle)); + if (urPlatformGetNativeHandle(platform, &native_handle)) { + continue; + } ASSERT_EQ_RESULT( UR_RESULT_ERROR_INVALID_NULL_POINTER, urPlatformCreateWithNativeHandle(native_handle, nullptr, nullptr)); diff --git a/test/conformance/program/urProgramCreateWithNativeHandle.cpp b/test/conformance/program/urProgramCreateWithNativeHandle.cpp index 7970630746..7e0400d294 100644 --- a/test/conformance/program/urProgramCreateWithNativeHandle.cpp +++ b/test/conformance/program/urProgramCreateWithNativeHandle.cpp @@ -25,8 +25,10 @@ struct urProgramCreateWithNativeHandleTest : uur::urProgramTest { UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramCreateWithNativeHandleTest); TEST_P(urProgramCreateWithNativeHandleTest, Success) { - ASSERT_SUCCESS(urProgramCreateWithNativeHandle( - native_program_handle, context, nullptr, &native_program)); + if (urProgramCreateWithNativeHandle(native_program_handle, context, nullptr, + &native_program)) { + GTEST_SKIP(); + } uint32_t ref_count = 0; ASSERT_SUCCESS(urProgramGetInfo(native_program, diff --git a/test/conformance/program/urProgramGetNativeHandle.cpp b/test/conformance/program/urProgramGetNativeHandle.cpp index 193fd2d669..7f176263ad 100644 --- a/test/conformance/program/urProgramGetNativeHandle.cpp +++ b/test/conformance/program/urProgramGetNativeHandle.cpp @@ -10,7 +10,10 @@ UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetNativeHandleTest); TEST_P(urProgramGetNativeHandleTest, Success) { ur_native_handle_t native_program_handle = nullptr; - ASSERT_SUCCESS(urProgramGetNativeHandle(program, &native_program_handle)); + if (auto error = + urProgramGetNativeHandle(program, &native_program_handle)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); + } } TEST_P(urProgramGetNativeHandleTest, InvalidNullHandleProgram) { diff --git a/test/conformance/queue/urQueueCreateWithNativeHandle.cpp b/test/conformance/queue/urQueueCreateWithNativeHandle.cpp index fd12cdaed5..01e7ca16d5 100644 --- a/test/conformance/queue/urQueueCreateWithNativeHandle.cpp +++ b/test/conformance/queue/urQueueCreateWithNativeHandle.cpp @@ -9,7 +9,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueCreateWithNativeHandleTest); TEST_P(urQueueCreateWithNativeHandleTest, Success) { ur_native_handle_t native_handle = nullptr; - ASSERT_SUCCESS(urQueueGetNativeHandle(queue, nullptr, &native_handle)); + if (urQueueGetNativeHandle(queue, nullptr, &native_handle)) { + GTEST_SKIP(); + } // We cannot assume anything about a native_handle, not even if it's // `nullptr` since this could be a valid representation within a backend. diff --git a/test/conformance/queue/urQueueGetNativeHandle.cpp b/test/conformance/queue/urQueueGetNativeHandle.cpp index 6d35895fea..914ee21831 100644 --- a/test/conformance/queue/urQueueGetNativeHandle.cpp +++ b/test/conformance/queue/urQueueGetNativeHandle.cpp @@ -9,7 +9,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urQueueGetNativeHandleTest); TEST_P(urQueueGetNativeHandleTest, Success) { ur_native_handle_t native_handle = nullptr; - ASSERT_SUCCESS(urQueueGetNativeHandle(queue, nullptr, &native_handle)); + if (auto error = urQueueGetNativeHandle(queue, nullptr, &native_handle)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); + } } TEST_P(urQueueGetNativeHandleTest, InvalidNullHandleQueue) { diff --git a/test/conformance/sampler/urSamplerCreateWithNativeHandle.cpp b/test/conformance/sampler/urSamplerCreateWithNativeHandle.cpp index 0ea5e3685f..1954b93096 100644 --- a/test/conformance/sampler/urSamplerCreateWithNativeHandle.cpp +++ b/test/conformance/sampler/urSamplerCreateWithNativeHandle.cpp @@ -11,7 +11,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urSamplerCreateWithNativeHandleTest); TEST_P(urSamplerCreateWithNativeHandleTest, Success) { ur_native_handle_t native_sampler = nullptr; - ASSERT_SUCCESS(urSamplerGetNativeHandle(sampler, &native_sampler)); + if (urSamplerGetNativeHandle(sampler, &native_sampler)) { + GTEST_SKIP(); + } // We cannot assume anything about a native_handle, not even if it's // `nullptr` since this could be a valid representation within a backend. diff --git a/test/conformance/sampler/urSamplerGetNativeHandle.cpp b/test/conformance/sampler/urSamplerGetNativeHandle.cpp index 24bac6286e..7fcb8a20ad 100644 --- a/test/conformance/sampler/urSamplerGetNativeHandle.cpp +++ b/test/conformance/sampler/urSamplerGetNativeHandle.cpp @@ -11,7 +11,9 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urSamplerGetNativeHandleTest); TEST_P(urSamplerGetNativeHandleTest, Success) { ur_native_handle_t native_sampler = nullptr; - ASSERT_SUCCESS(urSamplerGetNativeHandle(sampler, &native_sampler)); + if (auto error = urSamplerGetNativeHandle(sampler, &native_sampler)) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, error); + } } TEST_P(urSamplerGetNativeHandleTest, InvalidNullHandleSampler) {