Skip to content

Commit 326bad6

Browse files
committed
Add missing [release] tag to bindless image Destroy entry points.
1 parent e089832 commit 326bad6

File tree

8 files changed

+45
-24
lines changed

8 files changed

+45
-24
lines changed

include/ur_api.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7539,7 +7539,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
75397539
urBindlessImagesUnsampledImageHandleDestroyExp(
75407540
ur_context_handle_t hContext, ///< [in] handle of the context object
75417541
ur_device_handle_t hDevice, ///< [in] handle of the device object
7542-
ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy
7542+
ur_exp_image_handle_t hImage ///< [in][release] pointer to handle of image object to destroy
75437543
);
75447544

75457545
///////////////////////////////////////////////////////////////////////////////
@@ -7564,7 +7564,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
75647564
urBindlessImagesSampledImageHandleDestroyExp(
75657565
ur_context_handle_t hContext, ///< [in] handle of the context object
75667566
ur_device_handle_t hDevice, ///< [in] handle of the device object
7567-
ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy
7567+
ur_exp_image_handle_t hImage ///< [in][release] pointer to handle of image object to destroy
75687568
);
75697569

75707570
///////////////////////////////////////////////////////////////////////////////
@@ -7985,7 +7985,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
79857985
urBindlessImagesDestroyExternalSemaphoreExp(
79867986
ur_context_handle_t hContext, ///< [in] handle of the context object
79877987
ur_device_handle_t hDevice, ///< [in] handle of the device object
7988-
ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
7988+
ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
79897989
);
79907990

79917991
///////////////////////////////////////////////////////////////////////////////

scripts/core/exp-bindless-images.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ params:
357357
desc: "[in] handle of the device object"
358358
- type: $x_exp_image_handle_t
359359
name: hImage
360-
desc: "[in] pointer to handle of image object to destroy"
360+
desc: "[in][release] pointer to handle of image object to destroy"
361361
returns:
362362
- $X_RESULT_ERROR_INVALID_CONTEXT
363363
- $X_RESULT_ERROR_INVALID_VALUE
@@ -378,7 +378,7 @@ params:
378378
desc: "[in] handle of the device object"
379379
- type: $x_exp_image_handle_t
380380
name: hImage
381-
desc: "[in] pointer to handle of image object to destroy"
381+
desc: "[in][release] pointer to handle of image object to destroy"
382382
returns:
383383
- $X_RESULT_ERROR_INVALID_CONTEXT
384384
- $X_RESULT_ERROR_INVALID_VALUE
@@ -775,7 +775,7 @@ params:
775775
desc: "[in] handle of the device object"
776776
- type: $x_exp_interop_semaphore_handle_t
777777
name: hInteropSemaphore
778-
desc: "[in] handle of interop semaphore to be destroyed"
778+
desc: "[in][release] handle of interop semaphore to be destroyed"
779779
returns:
780780
- $X_RESULT_ERROR_INVALID_CONTEXT
781781
- $X_RESULT_ERROR_INVALID_VALUE

source/adapters/null/ur_nullddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4230,7 +4230,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp(
42304230
ur_context_handle_t hContext, ///< [in] handle of the context object
42314231
ur_device_handle_t hDevice, ///< [in] handle of the device object
42324232
ur_exp_image_handle_t
4233-
hImage ///< [in] pointer to handle of image object to destroy
4233+
hImage ///< [in][release] pointer to handle of image object to destroy
42344234
) try {
42354235
ur_result_t result = UR_RESULT_SUCCESS;
42364236

@@ -4256,7 +4256,7 @@ urBindlessImagesSampledImageHandleDestroyExp(
42564256
ur_context_handle_t hContext, ///< [in] handle of the context object
42574257
ur_device_handle_t hDevice, ///< [in] handle of the device object
42584258
ur_exp_image_handle_t
4259-
hImage ///< [in] pointer to handle of image object to destroy
4259+
hImage ///< [in][release] pointer to handle of image object to destroy
42604260
) try {
42614261
ur_result_t result = UR_RESULT_SUCCESS;
42624262

@@ -4655,7 +4655,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
46554655
ur_context_handle_t hContext, ///< [in] handle of the context object
46564656
ur_device_handle_t hDevice, ///< [in] handle of the device object
46574657
ur_exp_interop_semaphore_handle_t
4658-
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
4658+
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
46594659
) try {
46604660
ur_result_t result = UR_RESULT_SUCCESS;
46614661

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5458,7 +5458,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp(
54585458
ur_context_handle_t hContext, ///< [in] handle of the context object
54595459
ur_device_handle_t hDevice, ///< [in] handle of the device object
54605460
ur_exp_image_handle_t
5461-
hImage ///< [in] pointer to handle of image object to destroy
5461+
hImage ///< [in][release] pointer to handle of image object to destroy
54625462
) {
54635463
auto pfnUnsampledImageHandleDestroyExp =
54645464
context.urDdiTable.BindlessImagesExp.pfnUnsampledImageHandleDestroyExp;
@@ -5500,7 +5500,7 @@ urBindlessImagesSampledImageHandleDestroyExp(
55005500
ur_context_handle_t hContext, ///< [in] handle of the context object
55015501
ur_device_handle_t hDevice, ///< [in] handle of the device object
55025502
ur_exp_image_handle_t
5503-
hImage ///< [in] pointer to handle of image object to destroy
5503+
hImage ///< [in][release] pointer to handle of image object to destroy
55045504
) {
55055505
auto pfnSampledImageHandleDestroyExp =
55065506
context.urDdiTable.BindlessImagesExp.pfnSampledImageHandleDestroyExp;
@@ -6072,7 +6072,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
60726072
ur_context_handle_t hContext, ///< [in] handle of the context object
60736073
ur_device_handle_t hDevice, ///< [in] handle of the device object
60746074
ur_exp_interop_semaphore_handle_t
6075-
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
6075+
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
60766076
) {
60776077
auto pfnDestroyExternalSemaphoreExp =
60786078
context.urDdiTable.BindlessImagesExp.pfnDestroyExternalSemaphoreExp;

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6842,7 +6842,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp(
68426842
ur_context_handle_t hContext, ///< [in] handle of the context object
68436843
ur_device_handle_t hDevice, ///< [in] handle of the device object
68446844
ur_exp_image_handle_t
6845-
hImage ///< [in] pointer to handle of image object to destroy
6845+
hImage ///< [in][release] pointer to handle of image object to destroy
68466846
) {
68476847
auto pfnUnsampledImageHandleDestroyExp =
68486848
context.urDdiTable.BindlessImagesExp.pfnUnsampledImageHandleDestroyExp;
@@ -6888,7 +6888,7 @@ urBindlessImagesSampledImageHandleDestroyExp(
68886888
ur_context_handle_t hContext, ///< [in] handle of the context object
68896889
ur_device_handle_t hDevice, ///< [in] handle of the device object
68906890
ur_exp_image_handle_t
6891-
hImage ///< [in] pointer to handle of image object to destroy
6891+
hImage ///< [in][release] pointer to handle of image object to destroy
68926892
) {
68936893
auto pfnSampledImageHandleDestroyExp =
68946894
context.urDdiTable.BindlessImagesExp.pfnSampledImageHandleDestroyExp;
@@ -7628,7 +7628,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
76287628
ur_context_handle_t hContext, ///< [in] handle of the context object
76297629
ur_device_handle_t hDevice, ///< [in] handle of the device object
76307630
ur_exp_interop_semaphore_handle_t
7631-
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
7631+
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
76327632
) {
76337633
auto pfnDestroyExternalSemaphoreExp =
76347634
context.urDdiTable.BindlessImagesExp.pfnDestroyExternalSemaphoreExp;

source/loader/ur_ldrddi.cpp

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5895,7 +5895,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp(
58955895
ur_context_handle_t hContext, ///< [in] handle of the context object
58965896
ur_device_handle_t hDevice, ///< [in] handle of the device object
58975897
ur_exp_image_handle_t
5898-
hImage ///< [in] pointer to handle of image object to destroy
5898+
hImage ///< [in][release] pointer to handle of image object to destroy
58995899
) {
59005900
ur_result_t result = UR_RESULT_SUCCESS;
59015901

@@ -5919,6 +5919,13 @@ urBindlessImagesUnsampledImageHandleDestroyExp(
59195919
// forward to device-platform
59205920
result = pfnUnsampledImageHandleDestroyExp(hContext, hDevice, hImage);
59215921

5922+
if (UR_RESULT_SUCCESS != result) {
5923+
return result;
5924+
}
5925+
5926+
// release loader handle
5927+
ur_exp_image_factory.release(hImage);
5928+
59225929
return result;
59235930
}
59245931

@@ -5929,7 +5936,7 @@ urBindlessImagesSampledImageHandleDestroyExp(
59295936
ur_context_handle_t hContext, ///< [in] handle of the context object
59305937
ur_device_handle_t hDevice, ///< [in] handle of the device object
59315938
ur_exp_image_handle_t
5932-
hImage ///< [in] pointer to handle of image object to destroy
5939+
hImage ///< [in][release] pointer to handle of image object to destroy
59335940
) {
59345941
ur_result_t result = UR_RESULT_SUCCESS;
59355942

@@ -5953,6 +5960,13 @@ urBindlessImagesSampledImageHandleDestroyExp(
59535960
// forward to device-platform
59545961
result = pfnSampledImageHandleDestroyExp(hContext, hDevice, hImage);
59555962

5963+
if (UR_RESULT_SUCCESS != result) {
5964+
return result;
5965+
}
5966+
5967+
// release loader handle
5968+
ur_exp_image_factory.release(hImage);
5969+
59565970
return result;
59575971
}
59585972

@@ -6542,7 +6556,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
65426556
ur_context_handle_t hContext, ///< [in] handle of the context object
65436557
ur_device_handle_t hDevice, ///< [in] handle of the device object
65446558
ur_exp_interop_semaphore_handle_t
6545-
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
6559+
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
65466560
) {
65476561
ur_result_t result = UR_RESULT_SUCCESS;
65486562

@@ -6569,6 +6583,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
65696583
result =
65706584
pfnDestroyExternalSemaphoreExp(hContext, hDevice, hInteropSemaphore);
65716585

6586+
if (UR_RESULT_SUCCESS != result) {
6587+
return result;
6588+
}
6589+
6590+
// release loader handle
6591+
ur_exp_interop_semaphore_factory.release(hInteropSemaphore);
6592+
65726593
return result;
65736594
}
65746595

source/loader/ur_libapi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6536,7 +6536,7 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp(
65366536
ur_context_handle_t hContext, ///< [in] handle of the context object
65376537
ur_device_handle_t hDevice, ///< [in] handle of the device object
65386538
ur_exp_image_handle_t
6539-
hImage ///< [in] pointer to handle of image object to destroy
6539+
hImage ///< [in][release] pointer to handle of image object to destroy
65406540
) try {
65416541
auto pfnUnsampledImageHandleDestroyExp =
65426542
ur_lib::context->urDdiTable.BindlessImagesExp
@@ -6572,7 +6572,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp(
65726572
ur_context_handle_t hContext, ///< [in] handle of the context object
65736573
ur_device_handle_t hDevice, ///< [in] handle of the device object
65746574
ur_exp_image_handle_t
6575-
hImage ///< [in] pointer to handle of image object to destroy
6575+
hImage ///< [in][release] pointer to handle of image object to destroy
65766576
) try {
65776577
auto pfnSampledImageHandleDestroyExp =
65786578
ur_lib::context->urDdiTable.BindlessImagesExp
@@ -7156,7 +7156,7 @@ ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
71567156
ur_context_handle_t hContext, ///< [in] handle of the context object
71577157
ur_device_handle_t hDevice, ///< [in] handle of the device object
71587158
ur_exp_interop_semaphore_handle_t
7159-
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
7159+
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
71607160
) try {
71617161
auto pfnDestroyExternalSemaphoreExp =
71627162
ur_lib::context->urDdiTable.BindlessImagesExp

source/ur_api.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5589,7 +5589,7 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp(
55895589
ur_context_handle_t hContext, ///< [in] handle of the context object
55905590
ur_device_handle_t hDevice, ///< [in] handle of the device object
55915591
ur_exp_image_handle_t
5592-
hImage ///< [in] pointer to handle of image object to destroy
5592+
hImage ///< [in][release] pointer to handle of image object to destroy
55935593
) {
55945594
ur_result_t result = UR_RESULT_SUCCESS;
55955595
return result;
@@ -5617,7 +5617,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp(
56175617
ur_context_handle_t hContext, ///< [in] handle of the context object
56185618
ur_device_handle_t hDevice, ///< [in] handle of the device object
56195619
ur_exp_image_handle_t
5620-
hImage ///< [in] pointer to handle of image object to destroy
5620+
hImage ///< [in][release] pointer to handle of image object to destroy
56215621
) {
56225622
ur_result_t result = UR_RESULT_SUCCESS;
56235623
return result;
@@ -6095,7 +6095,7 @@ ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
60956095
ur_context_handle_t hContext, ///< [in] handle of the context object
60966096
ur_device_handle_t hDevice, ///< [in] handle of the device object
60976097
ur_exp_interop_semaphore_handle_t
6098-
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
6098+
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
60996099
) {
61006100
ur_result_t result = UR_RESULT_SUCCESS;
61016101
return result;

0 commit comments

Comments
 (0)