Skip to content

Commit bc0b581

Browse files
authored
Merge pull request #718 from przemektmalon/przemek/fix-interop-struct-param-name-style
[Bindless][Exp] Update struct and param naming style to adhere to convention
2 parents 9b5b8b9 + e46f3fb commit bc0b581

File tree

12 files changed

+59
-57
lines changed

12 files changed

+59
-57
lines changed

include/ur.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class ur_structure_type_v(IntEnum):
232232
KERNEL_ARG_LOCAL_PROPERTIES = 33 ## ::ur_kernel_arg_local_properties_t
233233
EXP_COMMAND_BUFFER_DESC = 0x1000 ## ::ur_exp_command_buffer_desc_t
234234
EXP_SAMPLER_MIP_PROPERTIES = 0x2000 ## ::ur_exp_sampler_mip_properties_t
235-
EXP_INTEROP_MEMORY_DESC = 0x2001 ## ::ur_exp_interop_memory_desc_t
235+
EXP_INTEROP_MEM_DESC = 0x2001 ## ::ur_exp_interop_mem_desc_t
236236
EXP_INTEROP_SEMAPHORE_DESC = 0x2002 ## ::ur_exp_interop_semaphore_desc_t
237237
EXP_FILE_DESCRIPTOR = 0x2003 ## ::ur_exp_file_descriptor_t
238238
EXP_WIN32_HANDLE = 0x2004 ## ::ur_exp_win32_handle_t
@@ -2143,10 +2143,10 @@ class ur_exp_sampler_mip_properties_t(Structure):
21432143

21442144
###############################################################################
21452145
## @brief Describes an interop memory resource descriptor
2146-
class ur_exp_interop_memory_desc_t(Structure):
2146+
class ur_exp_interop_mem_desc_t(Structure):
21472147
_fields_ = [
21482148
("stype", ur_structure_type_t), ## [in] type of this structure, must be
2149-
## ::UR_STRUCTURE_TYPE_EXP_INTEROP_MEMORY_DESC
2149+
## ::UR_STRUCTURE_TYPE_EXP_INTEROP_MEM_DESC
21502150
("pNext", c_void_p) ## [in][optional] pointer to extension-specific structure
21512151
]
21522152

@@ -3159,9 +3159,9 @@ class ur_queue_dditable_t(Structure):
31593159
###############################################################################
31603160
## @brief Function-pointer for urBindlessImagesImportOpaqueFDExp
31613161
if __use_win_types:
3162-
_urBindlessImagesImportOpaqueFDExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, c_size_t, POINTER(ur_exp_interop_memory_desc_t), POINTER(ur_exp_interop_mem_handle_t) )
3162+
_urBindlessImagesImportOpaqueFDExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, c_size_t, POINTER(ur_exp_interop_mem_desc_t), POINTER(ur_exp_interop_mem_handle_t) )
31633163
else:
3164-
_urBindlessImagesImportOpaqueFDExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, c_size_t, POINTER(ur_exp_interop_memory_desc_t), POINTER(ur_exp_interop_mem_handle_t) )
3164+
_urBindlessImagesImportOpaqueFDExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, c_size_t, POINTER(ur_exp_interop_mem_desc_t), POINTER(ur_exp_interop_mem_handle_t) )
31653165

31663166
###############################################################################
31673167
## @brief Function-pointer for urBindlessImagesMapExternalArrayExp

include/ur_api.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ typedef enum ur_structure_type_t {
241241
UR_STRUCTURE_TYPE_KERNEL_ARG_LOCAL_PROPERTIES = 33, ///< ::ur_kernel_arg_local_properties_t
242242
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC = 0x1000, ///< ::ur_exp_command_buffer_desc_t
243243
UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES = 0x2000, ///< ::ur_exp_sampler_mip_properties_t
244-
UR_STRUCTURE_TYPE_EXP_INTEROP_MEMORY_DESC = 0x2001, ///< ::ur_exp_interop_memory_desc_t
244+
UR_STRUCTURE_TYPE_EXP_INTEROP_MEM_DESC = 0x2001, ///< ::ur_exp_interop_mem_desc_t
245245
UR_STRUCTURE_TYPE_EXP_INTEROP_SEMAPHORE_DESC = 0x2002, ///< ::ur_exp_interop_semaphore_desc_t
246246
UR_STRUCTURE_TYPE_EXP_FILE_DESCRIPTOR = 0x2003, ///< ::ur_exp_file_descriptor_t
247247
UR_STRUCTURE_TYPE_EXP_WIN32_HANDLE = 0x2004, ///< ::ur_exp_win32_handle_t
@@ -6662,12 +6662,12 @@ typedef struct ur_exp_sampler_mip_properties_t {
66626662

66636663
///////////////////////////////////////////////////////////////////////////////
66646664
/// @brief Describes an interop memory resource descriptor
6665-
typedef struct ur_exp_interop_memory_desc_t {
6665+
typedef struct ur_exp_interop_mem_desc_t {
66666666
ur_structure_type_t stype; ///< [in] type of this structure, must be
6667-
///< ::UR_STRUCTURE_TYPE_EXP_INTEROP_MEMORY_DESC
6667+
///< ::UR_STRUCTURE_TYPE_EXP_INTEROP_MEM_DESC
66686668
const void *pNext; ///< [in][optional] pointer to extension-specific structure
66696669

6670-
} ur_exp_interop_memory_desc_t;
6670+
} ur_exp_interop_mem_desc_t;
66716671

66726672
///////////////////////////////////////////////////////////////////////////////
66736673
/// @brief Describes an interop semaphore resource descriptor
@@ -7076,18 +7076,18 @@ urBindlessImagesMipmapFreeExp(
70767076
/// + `NULL == hContext`
70777077
/// + `NULL == hDevice`
70787078
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
7079-
/// + `NULL == interopMemDesc`
7079+
/// + `NULL == pInteropMemDesc`
70807080
/// + `NULL == phInteropMem`
70817081
/// - ::UR_RESULT_ERROR_INVALID_CONTEXT
70827082
/// - ::UR_RESULT_ERROR_INVALID_VALUE
70837083
/// - ::UR_RESULT_ERROR_INVALID_MEM_OBJECT
70847084
UR_APIEXPORT ur_result_t UR_APICALL
70857085
urBindlessImagesImportOpaqueFDExp(
7086-
ur_context_handle_t hContext, ///< [in] handle of the context object
7087-
ur_device_handle_t hDevice, ///< [in] handle of the device object
7088-
size_t size, ///< [in] size of the external memory
7089-
ur_exp_interop_memory_desc_t *interopMemDesc, ///< [in] the interop memory descriptor
7090-
ur_exp_interop_mem_handle_t *phInteropMem ///< [out] interop memory handle to the external memory
7086+
ur_context_handle_t hContext, ///< [in] handle of the context object
7087+
ur_device_handle_t hDevice, ///< [in] handle of the device object
7088+
size_t size, ///< [in] size of the external memory
7089+
ur_exp_interop_mem_desc_t *pInteropMemDesc, ///< [in] the interop memory descriptor
7090+
ur_exp_interop_mem_handle_t *phInteropMem ///< [out] interop memory handle to the external memory
70917091
);
70927092

70937093
///////////////////////////////////////////////////////////////////////////////
@@ -9243,7 +9243,7 @@ typedef struct ur_bindless_images_import_opaque_fd_exp_params_t {
92439243
ur_context_handle_t *phContext;
92449244
ur_device_handle_t *phDevice;
92459245
size_t *psize;
9246-
ur_exp_interop_memory_desc_t **pinteropMemDesc;
9246+
ur_exp_interop_mem_desc_t **ppInteropMemDesc;
92479247
ur_exp_interop_mem_handle_t **pphInteropMem;
92489248
} ur_bindless_images_import_opaque_fd_exp_params_t;
92499249

include/ur_ddi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImportOpaqueFDExp_t)(
13751375
ur_context_handle_t,
13761376
ur_device_handle_t,
13771377
size_t,
1378-
ur_exp_interop_memory_desc_t *,
1378+
ur_exp_interop_mem_desc_t *,
13791379
ur_exp_interop_mem_handle_t *);
13801380

13811381
///////////////////////////////////////////////////////////////////////////////

scripts/core/EXP-BINDLESS-IMAGES.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Enums
6464
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6565
* ${x}_structure_type_t
6666
${X}_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES
67-
${X}_STRUCTURE_TYPE_EXP_INTEROP_MEMORY_DESC
67+
${X}_STRUCTURE_TYPE_EXP_INTEROP_MEM_DESC
6868
${X}_STRUCTURE_TYPE_EXP_INTEROP_SEMAPHORE_DESC
6969
${X}_STRUCTURE_TYPE_EXP_FILE_DESCRIPTOR
7070
${X}_STRUCTURE_TYPE_EXP_WIN32_HANDLE
@@ -123,7 +123,7 @@ Types
123123
* ${x}_exp_image_mem_handle_t
124124
* ${x}_exp_interop_mem_handle_t
125125
* ${x}_exp_interop_semaphore_handle_t
126-
* ${x}_exp_interop_memory_desc_t
126+
* ${x}_exp_interop_mem_desc_t
127127
* ${x}_exp_interop_semaphore_desc_t
128128
* ${x}_exp_file_descriptor_t
129129
* ${x}_exp_win32_handle_t
@@ -172,6 +172,8 @@ Changelog
172172
| 4.0 || Added platform specific interop resource handles. |
173173
| || Added and updated to use new interop resource descriptors. |
174174
+----------+-------------------------------------------------------------+
175+
| 5.0 | Update interop struct and func param names to adhere to convention. |
176+
+----------+-------------------------------------------------------------+
175177

176178
Contributors
177179
--------------------------------------------------------------------------------

scripts/core/exp-bindless-images.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ etors:
8686
- name: EXP_SAMPLER_MIP_PROPERTIES
8787
desc: $x_exp_sampler_mip_properties_t
8888
value: "0x2000"
89-
- name: EXP_INTEROP_MEMORY_DESC
90-
desc: $x_exp_interop_memory_desc_t
89+
- name: EXP_INTEROP_MEM_DESC
90+
desc: $x_exp_interop_mem_desc_t
9191
value: "0x2001"
9292
- name: EXP_INTEROP_SEMAPHORE_DESC
9393
desc: $x_exp_interop_semaphore_desc_t
@@ -166,7 +166,7 @@ members:
166166
type: struct
167167
desc: "Describes an interop memory resource descriptor"
168168
class: $xBindlessImages
169-
name: $x_exp_interop_memory_desc_t
169+
name: $x_exp_interop_mem_desc_t
170170
base: $x_base_desc_t
171171
members: []
172172
--- #--------------------------------------------------------------------------
@@ -562,8 +562,8 @@ params:
562562
- type: size_t
563563
name: size
564564
desc: "[in] size of the external memory"
565-
- type: $x_exp_interop_memory_desc_t*
566-
name: interopMemDesc
565+
- type: $x_exp_interop_mem_desc_t*
566+
name: pInteropMemDesc
567567
desc: "[in] the interop memory descriptor"
568568
- type: $x_exp_interop_mem_handle_t*
569569
name: phInteropMem

source/adapters/null/ur_nullddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4128,8 +4128,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp(
41284128
ur_context_handle_t hContext, ///< [in] handle of the context object
41294129
ur_device_handle_t hDevice, ///< [in] handle of the device object
41304130
size_t size, ///< [in] size of the external memory
4131-
ur_exp_interop_memory_desc_t
4132-
*interopMemDesc, ///< [in] the interop memory descriptor
4131+
ur_exp_interop_mem_desc_t
4132+
*pInteropMemDesc, ///< [in] the interop memory descriptor
41334133
ur_exp_interop_mem_handle_t
41344134
*phInteropMem ///< [out] interop memory handle to the external memory
41354135
) try {
@@ -4139,7 +4139,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp(
41394139
auto pfnImportOpaqueFDExp =
41404140
d_context.urDdiTable.BindlessImagesExp.pfnImportOpaqueFDExp;
41414141
if (nullptr != pfnImportOpaqueFDExp) {
4142-
result = pfnImportOpaqueFDExp(hContext, hDevice, size, interopMemDesc,
4142+
result = pfnImportOpaqueFDExp(hContext, hDevice, size, pInteropMemDesc,
41434143
phInteropMem);
41444144
} else {
41454145
// generic implementation

source/common/ur_params.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ inline std::ostream &operator<<(std::ostream &os,
396396
inline std::ostream &
397397
operator<<(std::ostream &os,
398398
const struct ur_exp_sampler_mip_properties_t params);
399-
inline std::ostream &
400-
operator<<(std::ostream &os, const struct ur_exp_interop_memory_desc_t params);
399+
inline std::ostream &operator<<(std::ostream &os,
400+
const struct ur_exp_interop_mem_desc_t params);
401401
inline std::ostream &
402402
operator<<(std::ostream &os,
403403
const struct ur_exp_interop_semaphore_desc_t params);
@@ -1223,8 +1223,8 @@ inline std::ostream &operator<<(std::ostream &os,
12231223
os << "UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES";
12241224
break;
12251225

1226-
case UR_STRUCTURE_TYPE_EXP_INTEROP_MEMORY_DESC:
1227-
os << "UR_STRUCTURE_TYPE_EXP_INTEROP_MEMORY_DESC";
1226+
case UR_STRUCTURE_TYPE_EXP_INTEROP_MEM_DESC:
1227+
os << "UR_STRUCTURE_TYPE_EXP_INTEROP_MEM_DESC";
12281228
break;
12291229

12301230
case UR_STRUCTURE_TYPE_EXP_INTEROP_SEMAPHORE_DESC:
@@ -1462,9 +1462,9 @@ inline void serializeStruct(std::ostream &os, const void *ptr) {
14621462
ur_params::serializePtr(os, pstruct);
14631463
} break;
14641464

1465-
case UR_STRUCTURE_TYPE_EXP_INTEROP_MEMORY_DESC: {
1466-
const ur_exp_interop_memory_desc_t *pstruct =
1467-
(const ur_exp_interop_memory_desc_t *)ptr;
1465+
case UR_STRUCTURE_TYPE_EXP_INTEROP_MEM_DESC: {
1466+
const ur_exp_interop_mem_desc_t *pstruct =
1467+
(const ur_exp_interop_mem_desc_t *)ptr;
14681468
ur_params::serializePtr(os, pstruct);
14691469
} break;
14701470

@@ -9590,9 +9590,9 @@ operator<<(std::ostream &os,
95909590
os << "}";
95919591
return os;
95929592
}
9593-
inline std::ostream &
9594-
operator<<(std::ostream &os, const struct ur_exp_interop_memory_desc_t params) {
9595-
os << "(struct ur_exp_interop_memory_desc_t){";
9593+
inline std::ostream &operator<<(std::ostream &os,
9594+
const struct ur_exp_interop_mem_desc_t params) {
9595+
os << "(struct ur_exp_interop_mem_desc_t){";
95969596

95979597
os << ".stype = ";
95989598

@@ -10083,9 +10083,9 @@ inline std::ostream &operator<<(
1008310083
os << *(params->psize);
1008410084

1008510085
os << ", ";
10086-
os << ".interopMemDesc = ";
10086+
os << ".pInteropMemDesc = ";
1008710087

10088-
ur_params::serializePtr(os, *(params->pinteropMemDesc));
10088+
ur_params::serializePtr(os, *(params->ppInteropMemDesc));
1008910089

1009010090
os << ", ";
1009110091
os << ".phInteropMem = ";

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4700,8 +4700,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp(
47004700
ur_context_handle_t hContext, ///< [in] handle of the context object
47014701
ur_device_handle_t hDevice, ///< [in] handle of the device object
47024702
size_t size, ///< [in] size of the external memory
4703-
ur_exp_interop_memory_desc_t
4704-
*interopMemDesc, ///< [in] the interop memory descriptor
4703+
ur_exp_interop_mem_desc_t
4704+
*pInteropMemDesc, ///< [in] the interop memory descriptor
47054705
ur_exp_interop_mem_handle_t
47064706
*phInteropMem ///< [out] interop memory handle to the external memory
47074707
) {
@@ -4713,13 +4713,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp(
47134713
}
47144714

47154715
ur_bindless_images_import_opaque_fd_exp_params_t params = {
4716-
&hContext, &hDevice, &size, &interopMemDesc, &phInteropMem};
4716+
&hContext, &hDevice, &size, &pInteropMemDesc, &phInteropMem};
47174717
uint64_t instance =
47184718
context.notify_begin(UR_FUNCTION_BINDLESS_IMAGES_IMPORT_OPAQUE_FD_EXP,
47194719
"urBindlessImagesImportOpaqueFDExp", &params);
47204720

47214721
ur_result_t result = pfnImportOpaqueFDExp(hContext, hDevice, size,
4722-
interopMemDesc, phInteropMem);
4722+
pInteropMemDesc, phInteropMem);
47234723

47244724
context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_IMPORT_OPAQUE_FD_EXP,
47254725
"urBindlessImagesImportOpaqueFDExp", &params, &result,

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5955,8 +5955,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp(
59555955
ur_context_handle_t hContext, ///< [in] handle of the context object
59565956
ur_device_handle_t hDevice, ///< [in] handle of the device object
59575957
size_t size, ///< [in] size of the external memory
5958-
ur_exp_interop_memory_desc_t
5959-
*interopMemDesc, ///< [in] the interop memory descriptor
5958+
ur_exp_interop_mem_desc_t
5959+
*pInteropMemDesc, ///< [in] the interop memory descriptor
59605960
ur_exp_interop_mem_handle_t
59615961
*phInteropMem ///< [out] interop memory handle to the external memory
59625962
) {
@@ -5976,7 +5976,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp(
59765976
return UR_RESULT_ERROR_INVALID_NULL_HANDLE;
59775977
}
59785978

5979-
if (NULL == interopMemDesc) {
5979+
if (NULL == pInteropMemDesc) {
59805980
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
59815981
}
59825982

@@ -5986,7 +5986,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp(
59865986
}
59875987

59885988
ur_result_t result = pfnImportOpaqueFDExp(hContext, hDevice, size,
5989-
interopMemDesc, phInteropMem);
5989+
pInteropMemDesc, phInteropMem);
59905990

59915991
return result;
59925992
}

source/loader/ur_ldrddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5725,8 +5725,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp(
57255725
ur_context_handle_t hContext, ///< [in] handle of the context object
57265726
ur_device_handle_t hDevice, ///< [in] handle of the device object
57275727
size_t size, ///< [in] size of the external memory
5728-
ur_exp_interop_memory_desc_t
5729-
*interopMemDesc, ///< [in] the interop memory descriptor
5728+
ur_exp_interop_mem_desc_t
5729+
*pInteropMemDesc, ///< [in] the interop memory descriptor
57305730
ur_exp_interop_mem_handle_t
57315731
*phInteropMem ///< [out] interop memory handle to the external memory
57325732
) {
@@ -5747,7 +5747,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp(
57475747
hDevice = reinterpret_cast<ur_device_object_t *>(hDevice)->handle;
57485748

57495749
// forward to device-platform
5750-
result = pfnImportOpaqueFDExp(hContext, hDevice, size, interopMemDesc,
5750+
result = pfnImportOpaqueFDExp(hContext, hDevice, size, pInteropMemDesc,
57515751
phInteropMem);
57525752

57535753
if (UR_RESULT_SUCCESS != result) {

0 commit comments

Comments
 (0)