Skip to content

Commit b4e54fd

Browse files
committed
Check for unsupported on CreateWithNative as well as GetNative.
1 parent c8b8a3e commit b4e54fd

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

include/ur_api.h

+27-27
Original file line numberDiff line numberDiff line change
@@ -1615,9 +1615,9 @@ typedef struct ur_platform_native_properties_t {
16151615
ur_structure_type_t stype;
16161616
/// [in,out][optional] pointer to extension-specific structure
16171617
void *pNext;
1618-
/// [in] Indicates UR owns the native handle or if it came from an
1619-
/// interoperability operation in the application that asked to not
1620-
/// transfer the ownership to the unified-runtime.
1618+
/// [in] If true then ownership of the native handle is tranferred to
1619+
/// the resultant object. This means the object will be responsible for
1620+
/// releasing the native resources at the end of its lifetime.
16211621
bool isNativeHandleOwned;
16221622

16231623
} ur_platform_native_properties_t;
@@ -2696,9 +2696,9 @@ typedef struct ur_device_native_properties_t {
26962696
ur_structure_type_t stype;
26972697
/// [in,out][optional] pointer to extension-specific structure
26982698
void *pNext;
2699-
/// [in] Indicates UR owns the native handle or if it came from an
2700-
/// interoperability operation in the application that asked to not
2701-
/// transfer the ownership to the unified-runtime.
2699+
/// [in] If true then ownership of the native handle is tranferred to
2700+
/// the resultant object. This means the object will be responsible for
2701+
/// releasing the native resources at the end of its lifetime.
27022702
bool isNativeHandleOwned;
27032703

27042704
} ur_device_native_properties_t;
@@ -3076,9 +3076,9 @@ typedef struct ur_context_native_properties_t {
30763076
ur_structure_type_t stype;
30773077
/// [in,out][optional] pointer to extension-specific structure
30783078
void *pNext;
3079-
/// [in] Indicates UR owns the native handle or if it came from an
3080-
/// interoperability operation in the application that asked to not transfer
3081-
/// the ownership to the unified-runtime.
3079+
/// [in] If true then ownership of the native handle is tranferred to
3080+
/// the resultant object. This means the object will be responsible for
3081+
/// releasing the native resources at the end of its lifetime.
30823082
bool isNativeHandleOwned;
30833083

30843084
} ur_context_native_properties_t;
@@ -3697,9 +3697,9 @@ typedef struct ur_mem_native_properties_t {
36973697
ur_structure_type_t stype;
36983698
/// [in,out][optional] pointer to extension-specific structure
36993699
void *pNext;
3700-
/// [in] Indicates UR owns the native handle or if it came from an
3701-
/// interoperability operation in the application that asked to not
3702-
/// transfer the ownership to the unified-runtime.
3700+
/// [in] If true then ownership of the native handle is tranferred to
3701+
/// the resultant object. This means the object will be responsible for
3702+
/// releasing the native resources at the end of its lifetime.
37033703
bool isNativeHandleOwned;
37043704

37053705
} ur_mem_native_properties_t;
@@ -4103,9 +4103,9 @@ typedef struct ur_sampler_native_properties_t {
41034103
ur_structure_type_t stype;
41044104
/// [in,out][optional] pointer to extension-specific structure
41054105
void *pNext;
4106-
/// [in] Indicates UR owns the native handle or if it came from an
4107-
/// interoperability operation in the application that asked to not
4108-
/// transfer the ownership to the unified-runtime.
4106+
/// [in] If true then ownership of the native handle is tranferred to
4107+
/// the resultant object. This means the object will be responsible for
4108+
/// releasing the native resources at the end of its lifetime.
41094109
bool isNativeHandleOwned;
41104110

41114111
} ur_sampler_native_properties_t;
@@ -5811,9 +5811,9 @@ typedef struct ur_program_native_properties_t {
58115811
ur_structure_type_t stype;
58125812
/// [in,out][optional] pointer to extension-specific structure
58135813
void *pNext;
5814-
/// [in] Indicates UR owns the native handle or if it came from an
5815-
/// interoperability operation in the application that asked to not
5816-
/// transfer the ownership to the unified-runtime.
5814+
/// [in] If true then ownership of the native handle is tranferred to
5815+
/// the resultant object. This means the object will be responsible for
5816+
/// releasing the native resources at the end of its lifetime.
58175817
bool isNativeHandleOwned;
58185818

58195819
} ur_program_native_properties_t;
@@ -6480,9 +6480,9 @@ typedef struct ur_kernel_native_properties_t {
64806480
ur_structure_type_t stype;
64816481
/// [in,out][optional] pointer to extension-specific structure
64826482
void *pNext;
6483-
/// [in] Indicates UR owns the native handle or if it came from an
6484-
/// interoperability operation in the application that asked to not transfer
6485-
/// the ownership to the unified-runtime.
6483+
/// [in] If true then ownership of the native handle is tranferred to
6484+
/// the resultant object. This means the object will be responsible for
6485+
/// releasing the native resources at the end of its lifetime.
64866486
bool isNativeHandleOwned;
64876487

64886488
} ur_kernel_native_properties_t;
@@ -6875,9 +6875,9 @@ typedef struct ur_queue_native_properties_t {
68756875
ur_structure_type_t stype;
68766876
/// [in,out][optional] pointer to extension-specific structure
68776877
void *pNext;
6878-
/// [in] Indicates UR owns the native handle or if it came from an
6879-
/// interoperability operation in the application that asked to not transfer
6880-
/// the ownership to the unified-runtime.
6878+
/// [in] If true then ownership of the native handle is tranferred to
6879+
/// the resultant object. This means the object will be responsible for
6880+
/// releasing the native resources at the end of its lifetime.
68816881
bool isNativeHandleOwned;
68826882

68836883
} ur_queue_native_properties_t;
@@ -7301,9 +7301,9 @@ typedef struct ur_event_native_properties_t {
73017301
ur_structure_type_t stype;
73027302
/// [in,out][optional] pointer to extension-specific structure
73037303
void *pNext;
7304-
/// [in] Indicates UR owns the native handle or if it came from an
7305-
/// interoperability operation in the application that asked to not transfer
7306-
/// the ownership to the unified-runtime.
7304+
/// [in] If true then ownership of the native handle is tranferred to
7305+
/// the resultant object. This means the object will be responsible for
7306+
/// releasing the native resources at the end of its lifetime.
73077307
bool isNativeHandleOwned;
73087308

73097309
} ur_event_native_properties_t;

test/conformance/memory/urMemBufferCreateWithNativeHandle.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ TEST_P(urMemBufferCreateWithNativeHandleTest, SuccessWithProperties) {
4646
/*.pNext =*/nullptr,
4747
/*.isNativeHandleOwned =*/false,
4848
};
49-
ASSERT_SUCCESS(
49+
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
5050
urMemBufferCreateWithNativeHandle(hNativeMem, context, &props, &mem));
5151
ASSERT_NE(mem, nullptr);
5252

0 commit comments

Comments
 (0)