Skip to content

Commit e089832

Browse files
committed
Add missing [release] tag to bindless image free entry points
1 parent abc0a8b commit e089832

File tree

8 files changed

+48
-28
lines changed

8 files changed

+48
-28
lines changed

include/ur_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7624,7 +7624,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
76247624
urBindlessImagesImageFreeExp(
76257625
ur_context_handle_t hContext, ///< [in] handle of the context object
76267626
ur_device_handle_t hDevice, ///< [in] handle of the device object
7627-
ur_exp_image_mem_handle_t hImageMem ///< [in] handle of image memory to be freed
7627+
ur_exp_image_mem_handle_t hImageMem ///< [in][release] handle of image memory to be freed
76287628
);
76297629

76307630
///////////////////////////////////////////////////////////////////////////////
@@ -7838,7 +7838,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
78387838
urBindlessImagesMipmapFreeExp(
78397839
ur_context_handle_t hContext, ///< [in] handle of the context object
78407840
ur_device_handle_t hDevice, ///< [in] handle of the device object
7841-
ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed
7841+
ur_exp_image_mem_handle_t hMem ///< [in][release] handle of image memory to be freed
78427842
);
78437843

78447844
///////////////////////////////////////////////////////////////////////////////

scripts/core/exp-bindless-images.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ params:
431431
desc: "[in] handle of the device object"
432432
- type: $x_exp_image_mem_handle_t
433433
name: hImageMem
434-
desc: "[in] handle of image memory to be freed"
434+
desc: "[in][release] handle of image memory to be freed"
435435
returns:
436436
- $X_RESULT_ERROR_INVALID_CONTEXT
437437
- $X_RESULT_ERROR_INVALID_VALUE
@@ -642,7 +642,7 @@ params:
642642
desc: "[in] handle of the device object"
643643
- type: $x_exp_image_mem_handle_t
644644
name: hMem
645-
desc: "[in] handle of image memory to be freed"
645+
desc: "[in][release] handle of image memory to be freed"
646646
returns:
647647
- $X_RESULT_ERROR_INVALID_CONTEXT
648648
- $X_RESULT_ERROR_INVALID_VALUE

source/adapters/null/ur_nullddi.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4310,7 +4310,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp(
43104310
ur_context_handle_t hContext, ///< [in] handle of the context object
43114311
ur_device_handle_t hDevice, ///< [in] handle of the device object
43124312
ur_exp_image_mem_handle_t
4313-
hImageMem ///< [in] handle of image memory to be freed
4313+
hImageMem ///< [in][release] handle of image memory to be freed
43144314
) try {
43154315
ur_result_t result = UR_RESULT_SUCCESS;
43164316

@@ -4506,9 +4506,10 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp(
45064506
///////////////////////////////////////////////////////////////////////////////
45074507
/// @brief Intercept function for urBindlessImagesMipmapFreeExp
45084508
__urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp(
4509-
ur_context_handle_t hContext, ///< [in] handle of the context object
4510-
ur_device_handle_t hDevice, ///< [in] handle of the device object
4511-
ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed
4509+
ur_context_handle_t hContext, ///< [in] handle of the context object
4510+
ur_device_handle_t hDevice, ///< [in] handle of the device object
4511+
ur_exp_image_mem_handle_t
4512+
hMem ///< [in][release] handle of image memory to be freed
45124513
) try {
45134514
ur_result_t result = UR_RESULT_SUCCESS;
45144515

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5581,7 +5581,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp(
55815581
ur_context_handle_t hContext, ///< [in] handle of the context object
55825582
ur_device_handle_t hDevice, ///< [in] handle of the device object
55835583
ur_exp_image_mem_handle_t
5584-
hImageMem ///< [in] handle of image memory to be freed
5584+
hImageMem ///< [in][release] handle of image memory to be freed
55855585
) {
55865586
auto pfnImageFreeExp = context.urDdiTable.BindlessImagesExp.pfnImageFreeExp;
55875587

@@ -5860,9 +5860,10 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp(
58605860
///////////////////////////////////////////////////////////////////////////////
58615861
/// @brief Intercept function for urBindlessImagesMipmapFreeExp
58625862
__urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp(
5863-
ur_context_handle_t hContext, ///< [in] handle of the context object
5864-
ur_device_handle_t hDevice, ///< [in] handle of the device object
5865-
ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed
5863+
ur_context_handle_t hContext, ///< [in] handle of the context object
5864+
ur_device_handle_t hDevice, ///< [in] handle of the device object
5865+
ur_exp_image_mem_handle_t
5866+
hMem ///< [in][release] handle of image memory to be freed
58665867
) {
58675868
auto pfnMipmapFreeExp =
58685869
context.urDdiTable.BindlessImagesExp.pfnMipmapFreeExp;

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6993,7 +6993,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp(
69936993
ur_context_handle_t hContext, ///< [in] handle of the context object
69946994
ur_device_handle_t hDevice, ///< [in] handle of the device object
69956995
ur_exp_image_mem_handle_t
6996-
hImageMem ///< [in] handle of image memory to be freed
6996+
hImageMem ///< [in][release] handle of image memory to be freed
69976997
) {
69986998
auto pfnImageFreeExp = context.urDdiTable.BindlessImagesExp.pfnImageFreeExp;
69996999

@@ -7354,9 +7354,10 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp(
73547354
///////////////////////////////////////////////////////////////////////////////
73557355
/// @brief Intercept function for urBindlessImagesMipmapFreeExp
73567356
__urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp(
7357-
ur_context_handle_t hContext, ///< [in] handle of the context object
7358-
ur_device_handle_t hDevice, ///< [in] handle of the device object
7359-
ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed
7357+
ur_context_handle_t hContext, ///< [in] handle of the context object
7358+
ur_device_handle_t hDevice, ///< [in] handle of the device object
7359+
ur_exp_image_mem_handle_t
7360+
hMem ///< [in][release] handle of image memory to be freed
73607361
) {
73617362
auto pfnMipmapFreeExp =
73627363
context.urDdiTable.BindlessImagesExp.pfnMipmapFreeExp;

source/loader/ur_ldrddi.cpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6008,7 +6008,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp(
60086008
ur_context_handle_t hContext, ///< [in] handle of the context object
60096009
ur_device_handle_t hDevice, ///< [in] handle of the device object
60106010
ur_exp_image_mem_handle_t
6011-
hImageMem ///< [in] handle of image memory to be freed
6011+
hImageMem ///< [in][release] handle of image memory to be freed
60126012
) {
60136013
ur_result_t result = UR_RESULT_SUCCESS;
60146014

@@ -6032,6 +6032,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp(
60326032
// forward to device-platform
60336033
result = pfnImageFreeExp(hContext, hDevice, hImageMem);
60346034

6035+
if (UR_RESULT_SUCCESS != result) {
6036+
return result;
6037+
}
6038+
6039+
// release loader handle
6040+
ur_exp_image_mem_factory.release(hImageMem);
6041+
60356042
return result;
60366043
}
60376044

@@ -6302,9 +6309,10 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp(
63026309
///////////////////////////////////////////////////////////////////////////////
63036310
/// @brief Intercept function for urBindlessImagesMipmapFreeExp
63046311
__urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp(
6305-
ur_context_handle_t hContext, ///< [in] handle of the context object
6306-
ur_device_handle_t hDevice, ///< [in] handle of the device object
6307-
ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed
6312+
ur_context_handle_t hContext, ///< [in] handle of the context object
6313+
ur_device_handle_t hDevice, ///< [in] handle of the device object
6314+
ur_exp_image_mem_handle_t
6315+
hMem ///< [in][release] handle of image memory to be freed
63086316
) {
63096317
ur_result_t result = UR_RESULT_SUCCESS;
63106318

@@ -6327,6 +6335,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp(
63276335
// forward to device-platform
63286336
result = pfnMipmapFreeExp(hContext, hDevice, hMem);
63296337

6338+
if (UR_RESULT_SUCCESS != result) {
6339+
return result;
6340+
}
6341+
6342+
// release loader handle
6343+
ur_exp_image_mem_factory.release(hMem);
6344+
63306345
return result;
63316346
}
63326347

source/loader/ur_libapi.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6655,7 +6655,7 @@ ur_result_t UR_APICALL urBindlessImagesImageFreeExp(
66556655
ur_context_handle_t hContext, ///< [in] handle of the context object
66566656
ur_device_handle_t hDevice, ///< [in] handle of the device object
66576657
ur_exp_image_mem_handle_t
6658-
hImageMem ///< [in] handle of image memory to be freed
6658+
hImageMem ///< [in][release] handle of image memory to be freed
66596659
) try {
66606660
auto pfnImageFreeExp =
66616661
ur_lib::context->urDdiTable.BindlessImagesExp.pfnImageFreeExp;
@@ -6944,9 +6944,10 @@ ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp(
69446944
/// - ::UR_RESULT_ERROR_INVALID_CONTEXT
69456945
/// - ::UR_RESULT_ERROR_INVALID_VALUE
69466946
ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp(
6947-
ur_context_handle_t hContext, ///< [in] handle of the context object
6948-
ur_device_handle_t hDevice, ///< [in] handle of the device object
6949-
ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed
6947+
ur_context_handle_t hContext, ///< [in] handle of the context object
6948+
ur_device_handle_t hDevice, ///< [in] handle of the device object
6949+
ur_exp_image_mem_handle_t
6950+
hMem ///< [in][release] handle of image memory to be freed
69506951
) try {
69516952
auto pfnMipmapFreeExp =
69526953
ur_lib::context->urDdiTable.BindlessImagesExp.pfnMipmapFreeExp;

source/ur_api.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5684,7 +5684,7 @@ ur_result_t UR_APICALL urBindlessImagesImageFreeExp(
56845684
ur_context_handle_t hContext, ///< [in] handle of the context object
56855685
ur_device_handle_t hDevice, ///< [in] handle of the device object
56865686
ur_exp_image_mem_handle_t
5687-
hImageMem ///< [in] handle of image memory to be freed
5687+
hImageMem ///< [in][release] handle of image memory to be freed
56885688
) {
56895689
ur_result_t result = UR_RESULT_SUCCESS;
56905690
return result;
@@ -5924,9 +5924,10 @@ ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp(
59245924
/// - ::UR_RESULT_ERROR_INVALID_CONTEXT
59255925
/// - ::UR_RESULT_ERROR_INVALID_VALUE
59265926
ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp(
5927-
ur_context_handle_t hContext, ///< [in] handle of the context object
5928-
ur_device_handle_t hDevice, ///< [in] handle of the device object
5929-
ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed
5927+
ur_context_handle_t hContext, ///< [in] handle of the context object
5928+
ur_device_handle_t hDevice, ///< [in] handle of the device object
5929+
ur_exp_image_mem_handle_t
5930+
hMem ///< [in][release] handle of image memory to be freed
59305931
) {
59315932
ur_result_t result = UR_RESULT_SUCCESS;
59325933
return result;

0 commit comments

Comments
 (0)