Skip to content

Commit

Permalink
Add missing [release] tag to bindless image Destroy entry points.
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongreig committed Jul 2, 2024
1 parent e089832 commit 326bad6
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 24 deletions.
6 changes: 3 additions & 3 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -7539,7 +7539,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
urBindlessImagesUnsampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy
ur_exp_image_handle_t hImage ///< [in][release] pointer to handle of image object to destroy
);

///////////////////////////////////////////////////////////////////////////////
Expand All @@ -7564,7 +7564,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
urBindlessImagesSampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy
ur_exp_image_handle_t hImage ///< [in][release] pointer to handle of image object to destroy
);

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -7985,7 +7985,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
urBindlessImagesDestroyExternalSemaphoreExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
);

///////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions scripts/core/exp-bindless-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ params:
desc: "[in] handle of the device object"
- type: $x_exp_image_handle_t
name: hImage
desc: "[in] pointer to handle of image object to destroy"
desc: "[in][release] pointer to handle of image object to destroy"
returns:
- $X_RESULT_ERROR_INVALID_CONTEXT
- $X_RESULT_ERROR_INVALID_VALUE
Expand All @@ -378,7 +378,7 @@ params:
desc: "[in] handle of the device object"
- type: $x_exp_image_handle_t
name: hImage
desc: "[in] pointer to handle of image object to destroy"
desc: "[in][release] pointer to handle of image object to destroy"
returns:
- $X_RESULT_ERROR_INVALID_CONTEXT
- $X_RESULT_ERROR_INVALID_VALUE
Expand Down Expand Up @@ -775,7 +775,7 @@ params:
desc: "[in] handle of the device object"
- type: $x_exp_interop_semaphore_handle_t
name: hInteropSemaphore
desc: "[in] handle of interop semaphore to be destroyed"
desc: "[in][release] handle of interop semaphore to be destroyed"
returns:
- $X_RESULT_ERROR_INVALID_CONTEXT
- $X_RESULT_ERROR_INVALID_VALUE
Expand Down
6 changes: 3 additions & 3 deletions source/adapters/null/ur_nullddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4230,7 +4230,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) try {
ur_result_t result = UR_RESULT_SUCCESS;

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

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

Expand Down
6 changes: 3 additions & 3 deletions source/loader/layers/tracing/ur_trcddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5458,7 +5458,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) {
auto pfnUnsampledImageHandleDestroyExp =
context.urDdiTable.BindlessImagesExp.pfnUnsampledImageHandleDestroyExp;
Expand Down Expand Up @@ -5500,7 +5500,7 @@ urBindlessImagesSampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) {
auto pfnSampledImageHandleDestroyExp =
context.urDdiTable.BindlessImagesExp.pfnSampledImageHandleDestroyExp;
Expand Down Expand Up @@ -6072,7 +6072,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_interop_semaphore_handle_t
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
) {
auto pfnDestroyExternalSemaphoreExp =
context.urDdiTable.BindlessImagesExp.pfnDestroyExternalSemaphoreExp;
Expand Down
6 changes: 3 additions & 3 deletions source/loader/layers/validation/ur_valddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6842,7 +6842,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) {
auto pfnUnsampledImageHandleDestroyExp =
context.urDdiTable.BindlessImagesExp.pfnUnsampledImageHandleDestroyExp;
Expand Down Expand Up @@ -6888,7 +6888,7 @@ urBindlessImagesSampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) {
auto pfnSampledImageHandleDestroyExp =
context.urDdiTable.BindlessImagesExp.pfnSampledImageHandleDestroyExp;
Expand Down Expand Up @@ -7628,7 +7628,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_interop_semaphore_handle_t
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
) {
auto pfnDestroyExternalSemaphoreExp =
context.urDdiTable.BindlessImagesExp.pfnDestroyExternalSemaphoreExp;
Expand Down
27 changes: 24 additions & 3 deletions source/loader/ur_ldrddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5895,7 +5895,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) {
ur_result_t result = UR_RESULT_SUCCESS;

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

if (UR_RESULT_SUCCESS != result) {
return result;
}

// release loader handle
ur_exp_image_factory.release(hImage);

return result;
}

Expand All @@ -5929,7 +5936,7 @@ urBindlessImagesSampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) {
ur_result_t result = UR_RESULT_SUCCESS;

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

if (UR_RESULT_SUCCESS != result) {
return result;
}

// release loader handle
ur_exp_image_factory.release(hImage);

return result;
}

Expand Down Expand Up @@ -6542,7 +6556,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_interop_semaphore_handle_t
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
) {
ur_result_t result = UR_RESULT_SUCCESS;

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

if (UR_RESULT_SUCCESS != result) {
return result;
}

// release loader handle
ur_exp_interop_semaphore_factory.release(hInteropSemaphore);

return result;
}

Expand Down
6 changes: 3 additions & 3 deletions source/loader/ur_libapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6536,7 +6536,7 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) try {
auto pfnUnsampledImageHandleDestroyExp =
ur_lib::context->urDdiTable.BindlessImagesExp
Expand Down Expand Up @@ -6572,7 +6572,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) try {
auto pfnSampledImageHandleDestroyExp =
ur_lib::context->urDdiTable.BindlessImagesExp
Expand Down Expand Up @@ -7156,7 +7156,7 @@ ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_interop_semaphore_handle_t
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
) try {
auto pfnDestroyExternalSemaphoreExp =
ur_lib::context->urDdiTable.BindlessImagesExp
Expand Down
6 changes: 3 additions & 3 deletions source/ur_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5589,7 +5589,7 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) {
ur_result_t result = UR_RESULT_SUCCESS;
return result;
Expand Down Expand Up @@ -5617,7 +5617,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_image_handle_t
hImage ///< [in] pointer to handle of image object to destroy
hImage ///< [in][release] pointer to handle of image object to destroy
) {
ur_result_t result = UR_RESULT_SUCCESS;
return result;
Expand Down Expand Up @@ -6095,7 +6095,7 @@ ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp(
ur_context_handle_t hContext, ///< [in] handle of the context object
ur_device_handle_t hDevice, ///< [in] handle of the device object
ur_exp_interop_semaphore_handle_t
hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed
hInteropSemaphore ///< [in][release] handle of interop semaphore to be destroyed
) {
ur_result_t result = UR_RESULT_SUCCESS;
return result;
Expand Down

0 comments on commit 326bad6

Please sign in to comment.