From a5c68883c2c6c734413da8006b651e1c2dd2ff28 Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Tue, 6 Jun 2023 04:11:52 -0700 Subject: [PATCH 01/10] [UR] Proposal of new API for memory object properties Signed-off-by: Tikhomirova, Kseniya --- include/ur.py | 4 ++-- include/ur_api.h | 14 +++++++++++++- include/ur_ddi.h | 3 ++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/ur.py b/include/ur.py index 867e04a6cc..34a6f57733 100644 --- a/include/ur.py +++ b/include/ur.py @@ -2242,9 +2242,9 @@ class ur_program_dditable_t(Structure): ############################################################################### ## @brief Function-pointer for urKernelSetArgMemObj if __use_win_types: - _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t ) + _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, const ur_mem_obj_properties_t* ) else: - _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t ) + _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, const ur_mem_obj_properties_t* ) ############################################################################### ## @brief Function-pointer for urKernelSetSpecializationConstants diff --git a/include/ur_api.h b/include/ur_api.h index 79b732acdd..d1659a3ded 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -252,6 +252,7 @@ typedef enum ur_structure_type_t { UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES = 24, ///< ::ur_sampler_native_properties_t UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC = 25, ///< ::ur_queue_native_desc_t UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES = 26, ///< ::ur_device_partition_properties_t + UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES = 27, ///< ::ur_mem_obj_properties_t /// @cond UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -3837,6 +3838,15 @@ urKernelSetArgSampler( ur_sampler_handle_t hArgValue ///< [in] handle of Sampler object. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Memory object properties +typedef struct ur_mem_obj_properties_t { + ur_structure_type_t stype; ///< [in] type of this structure, must be + ///< ::UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES + void *pNext; ///< [in,out][optional] pointer to extension-specific structure + ur_mem_flags_t memory_access; ///< [in] Memory access flag. Allowed values are: UR_MEM_FLAG_READ_WRITE, UR_MEM_FLAG_WRITE_ONLY, UR_MEM_FLAG_READ_ONLY. +} ur_mem_obj_properties_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Set a Memory object as the argument value of a Kernel. /// @@ -3856,7 +3866,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. + ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. + const ur_mem_obj_properties_t* pProperties ///< [in][optional] pointer to memory object usage properties. ); /////////////////////////////////////////////////////////////////////////////// @@ -6461,6 +6472,7 @@ typedef struct ur_kernel_set_arg_mem_obj_params_t { ur_kernel_handle_t *phKernel; uint32_t *pargIndex; ur_mem_handle_t *phArgValue; + const ur_mem_obj_properties_t* pProperties; } ur_kernel_set_arg_mem_obj_params_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/ur_ddi.h b/include/ur_ddi.h index dded08af28..397d690cf5 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -509,7 +509,8 @@ typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgSampler_t)( typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgMemObj_t)( ur_kernel_handle_t, uint32_t, - ur_mem_handle_t); + ur_mem_handle_t, + const ur_mem_obj_properties_t*); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urKernelSetSpecializationConstants From b63df59c317272579185d5dfc82bd8917c91dc90 Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Tue, 6 Jun 2023 07:17:10 -0700 Subject: [PATCH 02/10] Revert "[UR] Proposal of new API for memory object properties" This reverts commit a5c68883c2c6c734413da8006b651e1c2dd2ff28. --- include/ur.py | 4 ++-- include/ur_api.h | 14 +------------- include/ur_ddi.h | 3 +-- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/include/ur.py b/include/ur.py index 34a6f57733..867e04a6cc 100644 --- a/include/ur.py +++ b/include/ur.py @@ -2242,9 +2242,9 @@ class ur_program_dditable_t(Structure): ############################################################################### ## @brief Function-pointer for urKernelSetArgMemObj if __use_win_types: - _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, const ur_mem_obj_properties_t* ) + _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t ) else: - _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, const ur_mem_obj_properties_t* ) + _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t ) ############################################################################### ## @brief Function-pointer for urKernelSetSpecializationConstants diff --git a/include/ur_api.h b/include/ur_api.h index d1659a3ded..79b732acdd 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -252,7 +252,6 @@ typedef enum ur_structure_type_t { UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES = 24, ///< ::ur_sampler_native_properties_t UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC = 25, ///< ::ur_queue_native_desc_t UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES = 26, ///< ::ur_device_partition_properties_t - UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES = 27, ///< ::ur_mem_obj_properties_t /// @cond UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -3838,15 +3837,6 @@ urKernelSetArgSampler( ur_sampler_handle_t hArgValue ///< [in] handle of Sampler object. ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Memory object properties -typedef struct ur_mem_obj_properties_t { - ur_structure_type_t stype; ///< [in] type of this structure, must be - ///< ::UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES - void *pNext; ///< [in,out][optional] pointer to extension-specific structure - ur_mem_flags_t memory_access; ///< [in] Memory access flag. Allowed values are: UR_MEM_FLAG_READ_WRITE, UR_MEM_FLAG_WRITE_ONLY, UR_MEM_FLAG_READ_ONLY. -} ur_mem_obj_properties_t; - /////////////////////////////////////////////////////////////////////////////// /// @brief Set a Memory object as the argument value of a Kernel. /// @@ -3866,8 +3856,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. - const ur_mem_obj_properties_t* pProperties ///< [in][optional] pointer to memory object usage properties. + ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ); /////////////////////////////////////////////////////////////////////////////// @@ -6472,7 +6461,6 @@ typedef struct ur_kernel_set_arg_mem_obj_params_t { ur_kernel_handle_t *phKernel; uint32_t *pargIndex; ur_mem_handle_t *phArgValue; - const ur_mem_obj_properties_t* pProperties; } ur_kernel_set_arg_mem_obj_params_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/ur_ddi.h b/include/ur_ddi.h index 397d690cf5..dded08af28 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -509,8 +509,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgSampler_t)( typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgMemObj_t)( ur_kernel_handle_t, uint32_t, - ur_mem_handle_t, - const ur_mem_obj_properties_t*); + ur_mem_handle_t); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urKernelSetSpecializationConstants From cb72aad90f8dacb4e6cb1f3c4baa5f9dbe234f9c Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Tue, 6 Jun 2023 07:31:18 -0700 Subject: [PATCH 03/10] update scripts Signed-off-by: Tikhomirova, Kseniya --- scripts/core/kernel.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/core/kernel.yml b/scripts/core/kernel.yml index 35012854e3..40d4fe757a 100644 --- a/scripts/core/kernel.yml +++ b/scripts/core/kernel.yml @@ -358,6 +358,16 @@ params: returns: - $X_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX --- #-------------------------------------------------------------------------- +type: struct +desc: "Properties for for $xKernelSetArgMemObj." +class: $xKernel +name: $x_mem_obj_properties_t +base: $x_base_properties_t +members: + - type: $x_mem_flags_t + name: memoryAccess + desc: "[in] Memory access flag. Allowed values are: $X_MEM_FLAG_READ_WRITE, $X_MEM_FLAG_WRITE_ONLY, $X_MEM_FLAG_READ_ONLY." +--- #-------------------------------------------------------------------------- type: function desc: "Set a Memory object as the argument value of a Kernel." class: $xKernel @@ -375,6 +385,9 @@ params: - type: "$x_mem_handle_t" name: hArgValue desc: "[in][optional] handle of Memory object." + - type: "$x_mem_obj_properties_t" + name: pProperties + desc: "[in][optional] pointer to Memory object properties." returns: - $X_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX --- #-------------------------------------------------------------------------- From 4a252b1b8deb6555af4a69147b8c6f808f8ca368 Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Tue, 6 Jun 2023 07:54:20 -0700 Subject: [PATCH 04/10] update script, add structure type Signed-off-by: Tikhomirova, Kseniya --- scripts/core/common.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/core/common.yml b/scripts/core/common.yml index 411dedc285..c082dd4e4f 100644 --- a/scripts/core/common.yml +++ b/scripts/core/common.yml @@ -318,6 +318,8 @@ etors: desc: $x_queue_native_desc_t - name: DEVICE_PARTITION_PROPERTIES desc: $x_device_partition_properties_t + - name: MEM_OBJ_PROPERTIES + desc: $x_mem_obj_properties_t --- #-------------------------------------------------------------------------- type: struct desc: "Base for all properties types" From 8e2c04b97a7d948b3f28868c88e99e4835d6a84f Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Tue, 6 Jun 2023 07:55:40 -0700 Subject: [PATCH 05/10] add result of make generate Signed-off-by: Tikhomirova, Kseniya --- include/ur.py | 16 +++++++- include/ur_api.h | 20 ++++++++-- include/ur_ddi.h | 3 +- source/adapters/null/ur_nullddi.cpp | 6 ++- source/common/ur_params.hpp | 38 +++++++++++++++++++ source/loader/layers/tracing/ur_trcddi.cpp | 9 +++-- source/loader/layers/validation/ur_valddi.cpp | 7 +++- source/loader/ur_ldrddi.cpp | 6 ++- source/loader/ur_libapi.cpp | 6 ++- source/ur_api.cpp | 4 +- 10 files changed, 97 insertions(+), 18 deletions(-) diff --git a/include/ur.py b/include/ur.py index 867e04a6cc..4de2a500f6 100644 --- a/include/ur.py +++ b/include/ur.py @@ -228,6 +228,7 @@ class ur_structure_type_v(IntEnum): SAMPLER_NATIVE_PROPERTIES = 24 ## ::ur_sampler_native_properties_t QUEUE_NATIVE_DESC = 25 ## ::ur_queue_native_desc_t DEVICE_PARTITION_PROPERTIES = 26 ## ::ur_device_partition_properties_t + MEM_OBJ_PROPERTIES = 27 ## ::ur_mem_obj_properties_t class ur_structure_type_t(c_int): def __str__(self): @@ -1474,6 +1475,17 @@ def __str__(self): return str(ur_kernel_exec_info_v(self.value)) +############################################################################### +## @brief Properties for for ::urKernelSetArgMemObj. +class ur_mem_obj_properties_t(Structure): + _fields_ = [ + ("stype", ur_structure_type_t), ## [in] type of this structure, must be + ## ::UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES + ("pNext", c_void_p), ## [in,out][optional] pointer to extension-specific structure + ("memoryAccess", ur_mem_flags_t) ## [in] Memory access flag. Allowed values are: ::UR_MEM_FLAG_READ_WRITE, + ## ::UR_MEM_FLAG_WRITE_ONLY, ::UR_MEM_FLAG_READ_ONLY. + ] + ############################################################################### ## @brief Properties for for ::urKernelCreateWithNativeHandle. class ur_kernel_native_properties_t(Structure): @@ -2242,9 +2254,9 @@ class ur_program_dditable_t(Structure): ############################################################################### ## @brief Function-pointer for urKernelSetArgMemObj if __use_win_types: - _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t ) + _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, ur_mem_obj_properties_t ) else: - _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t ) + _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, ur_mem_obj_properties_t ) ############################################################################### ## @brief Function-pointer for urKernelSetSpecializationConstants diff --git a/include/ur_api.h b/include/ur_api.h index 79b732acdd..6c0d2f792d 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -252,6 +252,7 @@ typedef enum ur_structure_type_t { UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES = 24, ///< ::ur_sampler_native_properties_t UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC = 25, ///< ::ur_queue_native_desc_t UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES = 26, ///< ::ur_device_partition_properties_t + UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES = 27, ///< ::ur_mem_obj_properties_t /// @cond UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -3837,6 +3838,17 @@ urKernelSetArgSampler( ur_sampler_handle_t hArgValue ///< [in] handle of Sampler object. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Properties for for ::urKernelSetArgMemObj. +typedef struct ur_mem_obj_properties_t { + ur_structure_type_t stype; ///< [in] type of this structure, must be + ///< ::UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES + void *pNext; ///< [in,out][optional] pointer to extension-specific structure + ur_mem_flags_t memoryAccess; ///< [in] Memory access flag. Allowed values are: ::UR_MEM_FLAG_READ_WRITE, + ///< ::UR_MEM_FLAG_WRITE_ONLY, ::UR_MEM_FLAG_READ_ONLY. + +} ur_mem_obj_properties_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Set a Memory object as the argument value of a Kernel. /// @@ -3854,9 +3866,10 @@ urKernelSetArgSampler( /// - ::UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgMemObj( - ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. + ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] + ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. + ur_mem_obj_properties_t pProperties ///< [in][optional] pointer to Memory object properties. ); /////////////////////////////////////////////////////////////////////////////// @@ -6461,6 +6474,7 @@ typedef struct ur_kernel_set_arg_mem_obj_params_t { ur_kernel_handle_t *phKernel; uint32_t *pargIndex; ur_mem_handle_t *phArgValue; + ur_mem_obj_properties_t *ppProperties; } ur_kernel_set_arg_mem_obj_params_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/ur_ddi.h b/include/ur_ddi.h index dded08af28..938f4e7e91 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -509,7 +509,8 @@ typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgSampler_t)( typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgMemObj_t)( ur_kernel_handle_t, uint32_t, - ur_mem_handle_t); + ur_mem_handle_t, + ur_mem_obj_properties_t); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urKernelSetSpecializationConstants diff --git a/source/adapters/null/ur_nullddi.cpp b/source/adapters/null/ur_nullddi.cpp index 422437fdc3..551e533adf 100644 --- a/source/adapters/null/ur_nullddi.cpp +++ b/source/adapters/null/ur_nullddi.cpp @@ -1951,14 +1951,16 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. + ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. + ur_mem_obj_properties_t + pProperties ///< [in][optional] pointer to Memory object properties. ) try { ur_result_t result = UR_RESULT_SUCCESS; // if the driver has created a custom function, then call it instead of using the generic path auto pfnSetArgMemObj = d_context.urDdiTable.Kernel.pfnSetArgMemObj; if (nullptr != pfnSetArgMemObj) { - result = pfnSetArgMemObj(hKernel, argIndex, hArgValue); + result = pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); } else { // generic implementation } diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index 783d9ef03b..a19c96abfb 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -305,6 +305,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_kernel_cache_config_t value); inline std::ostream &operator<<(std::ostream &os, enum ur_kernel_exec_info_t value); +inline std::ostream &operator<<(std::ostream &os, + const struct ur_mem_obj_properties_t params); inline std::ostream & operator<<(std::ostream &os, const struct ur_kernel_native_properties_t params); inline std::ostream &operator<<(std::ostream &os, enum ur_queue_info_t value); @@ -726,6 +728,10 @@ inline std::ostream &operator<<(std::ostream &os, case UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES: os << "UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES"; break; + + case UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES: + os << "UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES"; + break; default: os << "unknown enumerator"; break; @@ -895,6 +901,12 @@ inline void serializeStruct(std::ostream &os, const void *ptr) { (const ur_device_partition_properties_t *)ptr; ur_params::serializePtr(os, pstruct); } break; + + case UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES: { + const ur_mem_obj_properties_t *pstruct = + (const ur_mem_obj_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; default: os << "unknown enumerator"; break; @@ -6891,6 +6903,27 @@ inline void serializeTagged(std::ostream &os, const void *ptr, } } } // namespace ur_params +inline std::ostream &operator<<(std::ostream &os, + const struct ur_mem_obj_properties_t params) { + os << "(struct ur_mem_obj_properties_t){"; + + os << ".stype = "; + + os << (params.stype); + + os << ", "; + os << ".pNext = "; + + ur_params::serializeStruct(os, (params.pNext)); + + os << ", "; + os << ".memoryAccess = "; + + ur_params::serializeFlag(os, (params.memoryAccess)); + + os << "}"; + return os; +} inline std::ostream & operator<<(std::ostream &os, const struct ur_kernel_native_properties_t params) { @@ -10448,6 +10481,11 @@ operator<<(std::ostream &os, ur_params::serializePtr(os, *(params->phArgValue)); + os << ", "; + os << ".pProperties = "; + + os << *(params->ppProperties); + return os; } diff --git a/source/loader/layers/tracing/ur_trcddi.cpp b/source/loader/layers/tracing/ur_trcddi.cpp index 9672bab4ad..79cbc5d029 100644 --- a/source/loader/layers/tracing/ur_trcddi.cpp +++ b/source/loader/layers/tracing/ur_trcddi.cpp @@ -2223,7 +2223,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. + ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. + ur_mem_obj_properties_t + pProperties ///< [in][optional] pointer to Memory object properties. ) { auto pfnSetArgMemObj = context.urDdiTable.Kernel.pfnSetArgMemObj; @@ -2232,11 +2234,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( } ur_kernel_set_arg_mem_obj_params_t params = {&hKernel, &argIndex, - &hArgValue}; + &hArgValue, &pProperties}; uint64_t instance = context.notify_begin(UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, "urKernelSetArgMemObj", ¶ms); - ur_result_t result = pfnSetArgMemObj(hKernel, argIndex, hArgValue); + ur_result_t result = + pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); context.notify_end(UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, "urKernelSetArgMemObj", ¶ms, &result, instance); diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index fe9d22d3a7..97854e1c87 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -2729,7 +2729,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. + ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. + ur_mem_obj_properties_t + pProperties ///< [in][optional] pointer to Memory object properties. ) { auto pfnSetArgMemObj = context.urDdiTable.Kernel.pfnSetArgMemObj; @@ -2743,7 +2745,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( } } - ur_result_t result = pfnSetArgMemObj(hKernel, argIndex, hArgValue); + ur_result_t result = + pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); return result; } diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index b364d21dee..8534a1b544 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -2560,7 +2560,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. + ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. + ur_mem_obj_properties_t + pProperties ///< [in][optional] pointer to Memory object properties. ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -2580,7 +2582,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( : nullptr; // forward to device-platform - result = pfnSetArgMemObj(hKernel, argIndex, hArgValue); + result = pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); return result; } diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 5bbd16a6c2..0821e51d0a 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -3021,14 +3021,16 @@ ur_result_t UR_APICALL urKernelSetArgSampler( ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. + ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. + ur_mem_obj_properties_t + pProperties ///< [in][optional] pointer to Memory object properties. ) try { auto pfnSetArgMemObj = ur_lib::context->urDdiTable.Kernel.pfnSetArgMemObj; if (nullptr == pfnSetArgMemObj) { return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnSetArgMemObj(hKernel, argIndex, hArgValue); + return pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); } catch (...) { return exceptionToResult(std::current_exception()); } diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 6584106e66..56183aef42 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -2527,7 +2527,9 @@ ur_result_t UR_APICALL urKernelSetArgSampler( ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. + ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. + ur_mem_obj_properties_t + pProperties ///< [in][optional] pointer to Memory object properties. ) { ur_result_t result = UR_RESULT_SUCCESS; return result; From 3186b5398c3abcd418e9df35dd8f729b62b47127 Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Tue, 6 Jun 2023 07:59:39 -0700 Subject: [PATCH 06/10] fix properties type and update generated files Signed-off-by: Tikhomirova, Kseniya --- include/ur.py | 4 ++-- include/ur_api.h | 10 +++++----- include/ur_ddi.h | 2 +- scripts/core/kernel.yml | 2 +- source/adapters/null/ur_nullddi.cpp | 4 ++-- source/common/ur_params.hpp | 2 +- source/loader/layers/tracing/ur_trcddi.cpp | 4 ++-- source/loader/layers/validation/ur_valddi.cpp | 4 ++-- source/loader/ur_ldrddi.cpp | 4 ++-- source/loader/ur_libapi.cpp | 4 ++-- source/ur_api.cpp | 4 ++-- test/conformance/testing/include/uur/fixtures.h | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/ur.py b/include/ur.py index 4de2a500f6..a6b2c09d6a 100644 --- a/include/ur.py +++ b/include/ur.py @@ -2254,9 +2254,9 @@ class ur_program_dditable_t(Structure): ############################################################################### ## @brief Function-pointer for urKernelSetArgMemObj if __use_win_types: - _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, ur_mem_obj_properties_t ) + _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, POINTER(ur_mem_obj_properties_t) ) else: - _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, ur_mem_obj_properties_t ) + _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, POINTER(ur_mem_obj_properties_t) ) ############################################################################### ## @brief Function-pointer for urKernelSetSpecializationConstants diff --git a/include/ur_api.h b/include/ur_api.h index 6c0d2f792d..8de3d4d956 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -3866,10 +3866,10 @@ typedef struct ur_mem_obj_properties_t { /// - ::UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgMemObj( - ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. - ur_mem_obj_properties_t pProperties ///< [in][optional] pointer to Memory object properties. + ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] + ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. + const ur_mem_obj_properties_t *pProperties ///< [in][optional] pointer to Memory object properties. ); /////////////////////////////////////////////////////////////////////////////// @@ -6474,7 +6474,7 @@ typedef struct ur_kernel_set_arg_mem_obj_params_t { ur_kernel_handle_t *phKernel; uint32_t *pargIndex; ur_mem_handle_t *phArgValue; - ur_mem_obj_properties_t *ppProperties; + const ur_mem_obj_properties_t **ppProperties; } ur_kernel_set_arg_mem_obj_params_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/ur_ddi.h b/include/ur_ddi.h index 938f4e7e91..312090b80e 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -510,7 +510,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgMemObj_t)( ur_kernel_handle_t, uint32_t, ur_mem_handle_t, - ur_mem_obj_properties_t); + const ur_mem_obj_properties_t *); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urKernelSetSpecializationConstants diff --git a/scripts/core/kernel.yml b/scripts/core/kernel.yml index 40d4fe757a..3a6955ae3d 100644 --- a/scripts/core/kernel.yml +++ b/scripts/core/kernel.yml @@ -385,7 +385,7 @@ params: - type: "$x_mem_handle_t" name: hArgValue desc: "[in][optional] handle of Memory object." - - type: "$x_mem_obj_properties_t" + - type: "const $x_mem_obj_properties_t*" name: pProperties desc: "[in][optional] pointer to Memory object properties." returns: diff --git a/source/adapters/null/ur_nullddi.cpp b/source/adapters/null/ur_nullddi.cpp index 551e533adf..808858df2d 100644 --- a/source/adapters/null/ur_nullddi.cpp +++ b/source/adapters/null/ur_nullddi.cpp @@ -1952,8 +1952,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. - ur_mem_obj_properties_t - pProperties ///< [in][optional] pointer to Memory object properties. + const ur_mem_obj_properties_t + *pProperties ///< [in][optional] pointer to Memory object properties. ) try { ur_result_t result = UR_RESULT_SUCCESS; diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index a19c96abfb..fc573be848 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -10484,7 +10484,7 @@ operator<<(std::ostream &os, os << ", "; os << ".pProperties = "; - os << *(params->ppProperties); + ur_params::serializePtr(os, *(params->ppProperties)); return os; } diff --git a/source/loader/layers/tracing/ur_trcddi.cpp b/source/loader/layers/tracing/ur_trcddi.cpp index 79cbc5d029..81769a9252 100644 --- a/source/loader/layers/tracing/ur_trcddi.cpp +++ b/source/loader/layers/tracing/ur_trcddi.cpp @@ -2224,8 +2224,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. - ur_mem_obj_properties_t - pProperties ///< [in][optional] pointer to Memory object properties. + const ur_mem_obj_properties_t + *pProperties ///< [in][optional] pointer to Memory object properties. ) { auto pfnSetArgMemObj = context.urDdiTable.Kernel.pfnSetArgMemObj; diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index 97854e1c87..eb1887a2fd 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -2730,8 +2730,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. - ur_mem_obj_properties_t - pProperties ///< [in][optional] pointer to Memory object properties. + const ur_mem_obj_properties_t + *pProperties ///< [in][optional] pointer to Memory object properties. ) { auto pfnSetArgMemObj = context.urDdiTable.Kernel.pfnSetArgMemObj; diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index 8534a1b544..fab98ced78 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -2561,8 +2561,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. - ur_mem_obj_properties_t - pProperties ///< [in][optional] pointer to Memory object properties. + const ur_mem_obj_properties_t + *pProperties ///< [in][optional] pointer to Memory object properties. ) { ur_result_t result = UR_RESULT_SUCCESS; diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 0821e51d0a..70f3fad826 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -3022,8 +3022,8 @@ ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. - ur_mem_obj_properties_t - pProperties ///< [in][optional] pointer to Memory object properties. + const ur_mem_obj_properties_t + *pProperties ///< [in][optional] pointer to Memory object properties. ) try { auto pfnSetArgMemObj = ur_lib::context->urDdiTable.Kernel.pfnSetArgMemObj; if (nullptr == pfnSetArgMemObj) { diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 56183aef42..d919d416b8 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -2528,8 +2528,8 @@ ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. - ur_mem_obj_properties_t - pProperties ///< [in][optional] pointer to Memory object properties. + const ur_mem_obj_properties_t + *pProperties ///< [in][optional] pointer to Memory object properties. ) { ur_result_t result = UR_RESULT_SUCCESS; return result; diff --git a/test/conformance/testing/include/uur/fixtures.h b/test/conformance/testing/include/uur/fixtures.h index b14a9e8ebb..64b5d951b3 100644 --- a/test/conformance/testing/include/uur/fixtures.h +++ b/test/conformance/testing/include/uur/fixtures.h @@ -696,8 +696,8 @@ struct urKernelExecutionTest : urKernelTest { sizeof(zero), 0, size, 0, nullptr, nullptr)); ASSERT_SUCCESS(urQueueFinish(queue)); - ASSERT_SUCCESS( - urKernelSetArgMemObj(kernel, current_arg_index, mem_handle)); + ASSERT_SUCCESS(urKernelSetArgMemObj(kernel, current_arg_index, + mem_handle, nullptr)); // This emulates the offset struct sycl adds for a 1D buffer accessor. struct { From e6f5e8180d94379a26538bc5a9c56951263c8979 Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Wed, 7 Jun 2023 09:09:46 -0700 Subject: [PATCH 07/10] fix code-review comments Signed-off-by: Tikhomirova, Kseniya --- include/ur.py | 4 ++-- include/ur_api.h | 10 +++++----- include/ur_ddi.h | 4 ++-- scripts/core/PROG.rst | 6 +++--- scripts/core/kernel.yml | 6 +++--- source/adapters/null/ur_nullddi.cpp | 6 +++--- source/common/ur_params.hpp | 8 ++++---- source/loader/layers/tracing/ur_trcddi.cpp | 8 ++++---- source/loader/layers/validation/ur_valddi.cpp | 6 +++--- source/loader/ur_ldrddi.cpp | 6 +++--- source/loader/ur_libapi.cpp | 6 +++--- source/ur_api.cpp | 4 ++-- 12 files changed, 37 insertions(+), 37 deletions(-) diff --git a/include/ur.py b/include/ur.py index a6b2c09d6a..2638732060 100644 --- a/include/ur.py +++ b/include/ur.py @@ -2254,9 +2254,9 @@ class ur_program_dditable_t(Structure): ############################################################################### ## @brief Function-pointer for urKernelSetArgMemObj if __use_win_types: - _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, POINTER(ur_mem_obj_properties_t) ) + _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, POINTER(ur_mem_obj_properties_t), ur_mem_handle_t ) else: - _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, ur_mem_handle_t, POINTER(ur_mem_obj_properties_t) ) + _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, POINTER(ur_mem_obj_properties_t), ur_mem_handle_t ) ############################################################################### ## @brief Function-pointer for urKernelSetSpecializationConstants diff --git a/include/ur_api.h b/include/ur_api.h index 8de3d4d956..c95ce56a4a 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -3866,10 +3866,10 @@ typedef struct ur_mem_obj_properties_t { /// - ::UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgMemObj( - ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. - const ur_mem_obj_properties_t *pProperties ///< [in][optional] pointer to Memory object properties. + ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] + const ur_mem_obj_properties_t *pProperties, ///< [in][optional] pointer to Memory object properties. + ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ); /////////////////////////////////////////////////////////////////////////////// @@ -6473,8 +6473,8 @@ typedef struct ur_kernel_set_arg_sampler_params_t { typedef struct ur_kernel_set_arg_mem_obj_params_t { ur_kernel_handle_t *phKernel; uint32_t *pargIndex; - ur_mem_handle_t *phArgValue; const ur_mem_obj_properties_t **ppProperties; + ur_mem_handle_t *phArgValue; } ur_kernel_set_arg_mem_obj_params_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/ur_ddi.h b/include/ur_ddi.h index 312090b80e..11a69d9cc6 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -509,8 +509,8 @@ typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgSampler_t)( typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgMemObj_t)( ur_kernel_handle_t, uint32_t, - ur_mem_handle_t, - const ur_mem_obj_properties_t *); + const ur_mem_obj_properties_t *, + ur_mem_handle_t); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urKernelSetSpecializationConstants diff --git a/scripts/core/PROG.rst b/scripts/core/PROG.rst index bbb2209cb9..89784236ef 100644 --- a/scripts/core/PROG.rst +++ b/scripts/core/PROG.rst @@ -216,9 +216,9 @@ explicit and implicit kernel arguments along with data needed for launch. // Create kernel object from program ${x}_kernel_handle_t hKernel; ${x}KernelCreate(hProgram, "addVectors", &hKernel); - ${x}KernelSetArgMemObj(hKernel, 0, A); - ${x}KernelSetArgMemObj(hKernel, 1, B); - ${x}KernelSetArgMemObj(hKernel, 2, C); + ${x}KernelSetArgMemObj(hKernel, 0, nullptr, A); + ${x}KernelSetArgMemObj(hKernel, 1, nullptr, B); + ${x}KernelSetArgMemObj(hKernel, 2, nullptr, C); Queue and Enqueue ================= diff --git a/scripts/core/kernel.yml b/scripts/core/kernel.yml index 3a6955ae3d..acbf03a67d 100644 --- a/scripts/core/kernel.yml +++ b/scripts/core/kernel.yml @@ -382,12 +382,12 @@ params: - type: "uint32_t" name: argIndex desc: "[in] argument index in range [0, num args - 1]" - - type: "$x_mem_handle_t" - name: hArgValue - desc: "[in][optional] handle of Memory object." - type: "const $x_mem_obj_properties_t*" name: pProperties desc: "[in][optional] pointer to Memory object properties." + - type: "$x_mem_handle_t" + name: hArgValue + desc: "[in][optional] handle of Memory object." returns: - $X_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX --- #-------------------------------------------------------------------------- diff --git a/source/adapters/null/ur_nullddi.cpp b/source/adapters/null/ur_nullddi.cpp index 808858df2d..b1a6efd937 100644 --- a/source/adapters/null/ur_nullddi.cpp +++ b/source/adapters/null/ur_nullddi.cpp @@ -1951,16 +1951,16 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. const ur_mem_obj_properties_t - *pProperties ///< [in][optional] pointer to Memory object properties. + *pProperties, ///< [in][optional] pointer to Memory object properties. + ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) try { ur_result_t result = UR_RESULT_SUCCESS; // if the driver has created a custom function, then call it instead of using the generic path auto pfnSetArgMemObj = d_context.urDdiTable.Kernel.pfnSetArgMemObj; if (nullptr != pfnSetArgMemObj) { - result = pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); + result = pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue); } else { // generic implementation } diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index fc573be848..0908e67e10 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -10477,14 +10477,14 @@ operator<<(std::ostream &os, os << *(params->pargIndex); os << ", "; - os << ".hArgValue = "; + os << ".pProperties = "; - ur_params::serializePtr(os, *(params->phArgValue)); + ur_params::serializePtr(os, *(params->ppProperties)); os << ", "; - os << ".pProperties = "; + os << ".hArgValue = "; - ur_params::serializePtr(os, *(params->ppProperties)); + ur_params::serializePtr(os, *(params->phArgValue)); return os; } diff --git a/source/loader/layers/tracing/ur_trcddi.cpp b/source/loader/layers/tracing/ur_trcddi.cpp index 81769a9252..d342fa23b5 100644 --- a/source/loader/layers/tracing/ur_trcddi.cpp +++ b/source/loader/layers/tracing/ur_trcddi.cpp @@ -2223,9 +2223,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. const ur_mem_obj_properties_t - *pProperties ///< [in][optional] pointer to Memory object properties. + *pProperties, ///< [in][optional] pointer to Memory object properties. + ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) { auto pfnSetArgMemObj = context.urDdiTable.Kernel.pfnSetArgMemObj; @@ -2234,12 +2234,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( } ur_kernel_set_arg_mem_obj_params_t params = {&hKernel, &argIndex, - &hArgValue, &pProperties}; + &pProperties, &hArgValue}; uint64_t instance = context.notify_begin(UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, "urKernelSetArgMemObj", ¶ms); ur_result_t result = - pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); + pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue); context.notify_end(UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, "urKernelSetArgMemObj", ¶ms, &result, instance); diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index eb1887a2fd..7d622b3f63 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -2729,9 +2729,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. const ur_mem_obj_properties_t - *pProperties ///< [in][optional] pointer to Memory object properties. + *pProperties, ///< [in][optional] pointer to Memory object properties. + ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) { auto pfnSetArgMemObj = context.urDdiTable.Kernel.pfnSetArgMemObj; @@ -2746,7 +2746,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( } ur_result_t result = - pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); + pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue); return result; } diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index fab98ced78..3111081822 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -2560,9 +2560,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. const ur_mem_obj_properties_t - *pProperties ///< [in][optional] pointer to Memory object properties. + *pProperties, ///< [in][optional] pointer to Memory object properties. + ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -2582,7 +2582,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( : nullptr; // forward to device-platform - result = pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); + result = pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue); return result; } diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 70f3fad826..ec0f046c16 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -3021,16 +3021,16 @@ ur_result_t UR_APICALL urKernelSetArgSampler( ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. const ur_mem_obj_properties_t - *pProperties ///< [in][optional] pointer to Memory object properties. + *pProperties, ///< [in][optional] pointer to Memory object properties. + ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) try { auto pfnSetArgMemObj = ur_lib::context->urDdiTable.Kernel.pfnSetArgMemObj; if (nullptr == pfnSetArgMemObj) { return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnSetArgMemObj(hKernel, argIndex, hArgValue, pProperties); + return pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue); } catch (...) { return exceptionToResult(std::current_exception()); } diff --git a/source/ur_api.cpp b/source/ur_api.cpp index d919d416b8..eaad968459 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -2527,9 +2527,9 @@ ur_result_t UR_APICALL urKernelSetArgSampler( ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - ur_mem_handle_t hArgValue, ///< [in][optional] handle of Memory object. const ur_mem_obj_properties_t - *pProperties ///< [in][optional] pointer to Memory object properties. + *pProperties, ///< [in][optional] pointer to Memory object properties. + ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) { ur_result_t result = UR_RESULT_SUCCESS; return result; From 87062026b61250c722f2bb9c0f738226f207543a Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Wed, 14 Jun 2023 05:17:24 -0700 Subject: [PATCH 08/10] fix tests Signed-off-by: Tikhomirova, Kseniya --- test/conformance/kernel/urKernelSetArgMemObj.cpp | 6 +++--- test/conformance/testing/include/uur/fixtures.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/conformance/kernel/urKernelSetArgMemObj.cpp b/test/conformance/kernel/urKernelSetArgMemObj.cpp index 79c22e5298..87bf384487 100644 --- a/test/conformance/kernel/urKernelSetArgMemObj.cpp +++ b/test/conformance/kernel/urKernelSetArgMemObj.cpp @@ -26,12 +26,12 @@ struct urKernelSetArgMemObjTest : uur::urKernelTest { UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgMemObjTest); TEST_P(urKernelSetArgMemObjTest, Success) { - ASSERT_SUCCESS(urKernelSetArgMemObj(kernel, 0, buffer)); + ASSERT_SUCCESS(urKernelSetArgMemObj(kernel, 0, nullptr, buffer)); } TEST_P(urKernelSetArgMemObjTest, InvalidNullHandleKernel) { ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, - urKernelSetArgMemObj(nullptr, 0, buffer)); + urKernelSetArgMemObj(nullptr, 0, nullptr, buffer)); } TEST_P(urKernelSetArgMemObjTest, InvalidKernelArgumentIndex) { @@ -40,5 +40,5 @@ TEST_P(urKernelSetArgMemObjTest, InvalidKernelArgumentIndex) { sizeof(num_kernel_args), &num_kernel_args, nullptr)); ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX, - urKernelSetArgMemObj(kernel, num_kernel_args + 1, buffer)); + urKernelSetArgMemObj(kernel, num_kernel_args + 1, nullptr, buffer)); } diff --git a/test/conformance/testing/include/uur/fixtures.h b/test/conformance/testing/include/uur/fixtures.h index 64b5d951b3..82d1bcbd3a 100644 --- a/test/conformance/testing/include/uur/fixtures.h +++ b/test/conformance/testing/include/uur/fixtures.h @@ -697,7 +697,7 @@ struct urKernelExecutionTest : urKernelTest { nullptr)); ASSERT_SUCCESS(urQueueFinish(queue)); ASSERT_SUCCESS(urKernelSetArgMemObj(kernel, current_arg_index, - mem_handle, nullptr)); + nullptr, mem_handle)); // This emulates the offset struct sycl adds for a 1D buffer accessor. struct { From 85393506eda9c7c77fb6c3ca2d36f46c24c5329b Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Thu, 15 Jun 2023 05:19:36 -0700 Subject: [PATCH 09/10] rename structure Signed-off-by: Tikhomirova, Kseniya --- include/ur.py | 10 +++++----- include/ur_api.h | 18 +++++++++--------- include/ur_ddi.h | 2 +- scripts/core/common.yml | 2 +- scripts/core/kernel.yml | 4 ++-- source/adapters/null/ur_nullddi.cpp | 2 +- source/common/ur_params.hpp | 16 +++++++++------- source/loader/layers/tracing/ur_trcddi.cpp | 2 +- source/loader/layers/validation/ur_valddi.cpp | 2 +- source/loader/ur_ldrddi.cpp | 2 +- source/loader/ur_libapi.cpp | 2 +- source/ur_api.cpp | 2 +- 12 files changed, 33 insertions(+), 31 deletions(-) diff --git a/include/ur.py b/include/ur.py index e4d4ec5331..cc026f53ca 100644 --- a/include/ur.py +++ b/include/ur.py @@ -233,7 +233,7 @@ class ur_structure_type_v(IntEnum): DEVICE_PARTITION_PROPERTIES = 26 ## ::ur_device_partition_properties_t EXP_COMMAND_BUFFER_DESC = 27 ## ::ur_exp_command_buffer_desc_t EXP_SAMPLER_MIP_PROPERTIES = 28 ## ::ur_exp_sampler_mip_properties_t - MEM_OBJ_PROPERTIES = 29 ## ::ur_mem_obj_properties_t + MEM_OBJ_PROPERTIES = 29 ## ::ur_kernel_arg_mem_obj_properties_t class ur_structure_type_t(c_int): def __str__(self): @@ -1517,10 +1517,10 @@ def __str__(self): ############################################################################### ## @brief Properties for for ::urKernelSetArgMemObj. -class ur_mem_obj_properties_t(Structure): +class ur_kernel_arg_mem_obj_properties_t(Structure): _fields_ = [ ("stype", ur_structure_type_t), ## [in] type of this structure, must be - ## ::UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES + ## ::UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES ("pNext", c_void_p), ## [in,out][optional] pointer to extension-specific structure ("memoryAccess", ur_mem_flags_t) ## [in] Memory access flag. Allowed values are: ::UR_MEM_FLAG_READ_WRITE, ## ::UR_MEM_FLAG_WRITE_ONLY, ::UR_MEM_FLAG_READ_ONLY. @@ -2400,9 +2400,9 @@ class ur_program_dditable_t(Structure): ############################################################################### ## @brief Function-pointer for urKernelSetArgMemObj if __use_win_types: - _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, POINTER(ur_mem_obj_properties_t), ur_mem_handle_t ) + _urKernelSetArgMemObj_t = WINFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, POINTER(ur_kernel_arg_mem_obj_properties_t), ur_mem_handle_t ) else: - _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, POINTER(ur_mem_obj_properties_t), ur_mem_handle_t ) + _urKernelSetArgMemObj_t = CFUNCTYPE( ur_result_t, ur_kernel_handle_t, c_ulong, POINTER(ur_kernel_arg_mem_obj_properties_t), ur_mem_handle_t ) ############################################################################### ## @brief Function-pointer for urKernelSetSpecializationConstants diff --git a/include/ur_api.h b/include/ur_api.h index 15beb5579d..9d259f3f39 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -257,7 +257,7 @@ typedef enum ur_structure_type_t { UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES = 26, ///< ::ur_device_partition_properties_t UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC = 27, ///< ::ur_exp_command_buffer_desc_t UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES = 28, ///< ::ur_exp_sampler_mip_properties_t - UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES = 29, ///< ::ur_mem_obj_properties_t + UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES = 29, ///< ::ur_kernel_arg_mem_obj_properties_t /// @cond UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -3880,14 +3880,14 @@ urKernelSetArgSampler( /////////////////////////////////////////////////////////////////////////////// /// @brief Properties for for ::urKernelSetArgMemObj. -typedef struct ur_mem_obj_properties_t { +typedef struct ur_kernel_arg_mem_obj_properties_t { ur_structure_type_t stype; ///< [in] type of this structure, must be - ///< ::UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES + ///< ::UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES void *pNext; ///< [in,out][optional] pointer to extension-specific structure ur_mem_flags_t memoryAccess; ///< [in] Memory access flag. Allowed values are: ::UR_MEM_FLAG_READ_WRITE, ///< ::UR_MEM_FLAG_WRITE_ONLY, ::UR_MEM_FLAG_READ_ONLY. -} ur_mem_obj_properties_t; +} ur_kernel_arg_mem_obj_properties_t; /////////////////////////////////////////////////////////////////////////////// /// @brief Set a Memory object as the argument value of a Kernel. @@ -3906,10 +3906,10 @@ typedef struct ur_mem_obj_properties_t { /// - ::UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgMemObj( - ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - const ur_mem_obj_properties_t *pProperties, ///< [in][optional] pointer to Memory object properties. - ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. + ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] + const ur_kernel_arg_mem_obj_properties_t *pProperties, ///< [in][optional] pointer to Memory object properties. + ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ); /////////////////////////////////////////////////////////////////////////////// @@ -7418,7 +7418,7 @@ typedef struct ur_kernel_set_arg_sampler_params_t { typedef struct ur_kernel_set_arg_mem_obj_params_t { ur_kernel_handle_t *phKernel; uint32_t *pargIndex; - const ur_mem_obj_properties_t **ppProperties; + const ur_kernel_arg_mem_obj_properties_t **ppProperties; ur_mem_handle_t *phArgValue; } ur_kernel_set_arg_mem_obj_params_t; diff --git a/include/ur_ddi.h b/include/ur_ddi.h index 498f61df9e..0515cf4d02 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -509,7 +509,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgSampler_t)( typedef ur_result_t(UR_APICALL *ur_pfnKernelSetArgMemObj_t)( ur_kernel_handle_t, uint32_t, - const ur_mem_obj_properties_t *, + const ur_kernel_arg_mem_obj_properties_t *, ur_mem_handle_t); /////////////////////////////////////////////////////////////////////////////// diff --git a/scripts/core/common.yml b/scripts/core/common.yml index 907313881a..c7dd338810 100644 --- a/scripts/core/common.yml +++ b/scripts/core/common.yml @@ -332,7 +332,7 @@ etors: - name: EXP_SAMPLER_MIP_PROPERTIES desc: $x_exp_sampler_mip_properties_t - name: MEM_OBJ_PROPERTIES - desc: $x_mem_obj_properties_t + desc: $x_kernel_arg_mem_obj_properties_t --- #-------------------------------------------------------------------------- type: struct desc: "Base for all properties types" diff --git a/scripts/core/kernel.yml b/scripts/core/kernel.yml index acbf03a67d..103bb20e8e 100644 --- a/scripts/core/kernel.yml +++ b/scripts/core/kernel.yml @@ -361,7 +361,7 @@ returns: type: struct desc: "Properties for for $xKernelSetArgMemObj." class: $xKernel -name: $x_mem_obj_properties_t +name: $x_kernel_arg_mem_obj_properties_t base: $x_base_properties_t members: - type: $x_mem_flags_t @@ -382,7 +382,7 @@ params: - type: "uint32_t" name: argIndex desc: "[in] argument index in range [0, num args - 1]" - - type: "const $x_mem_obj_properties_t*" + - type: "const $x_kernel_arg_mem_obj_properties_t*" name: pProperties desc: "[in][optional] pointer to Memory object properties." - type: "$x_mem_handle_t" diff --git a/source/adapters/null/ur_nullddi.cpp b/source/adapters/null/ur_nullddi.cpp index 3e31ab013a..781f567d6d 100644 --- a/source/adapters/null/ur_nullddi.cpp +++ b/source/adapters/null/ur_nullddi.cpp @@ -1951,7 +1951,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - const ur_mem_obj_properties_t + const ur_kernel_arg_mem_obj_properties_t *pProperties, ///< [in][optional] pointer to Memory object properties. ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) try { diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index 1eea7cd8f4..70d62fcf67 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -309,8 +309,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_kernel_cache_config_t value); inline std::ostream &operator<<(std::ostream &os, enum ur_kernel_exec_info_t value); -inline std::ostream &operator<<(std::ostream &os, - const struct ur_mem_obj_properties_t params); +inline std::ostream & +operator<<(std::ostream &os, + const struct ur_kernel_arg_mem_obj_properties_t params); inline std::ostream & operator<<(std::ostream &os, const struct ur_kernel_native_properties_t params); inline std::ostream &operator<<(std::ostream &os, enum ur_queue_info_t value); @@ -946,8 +947,8 @@ inline void serializeStruct(std::ostream &os, const void *ptr) { } break; case UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES: { - const ur_mem_obj_properties_t *pstruct = - (const ur_mem_obj_properties_t *)ptr; + const ur_kernel_arg_mem_obj_properties_t *pstruct = + (const ur_kernel_arg_mem_obj_properties_t *)ptr; ur_params::serializePtr(os, pstruct); } break; default: @@ -7252,9 +7253,10 @@ inline void serializeTagged(std::ostream &os, const void *ptr, } } } // namespace ur_params -inline std::ostream &operator<<(std::ostream &os, - const struct ur_mem_obj_properties_t params) { - os << "(struct ur_mem_obj_properties_t){"; +inline std::ostream & +operator<<(std::ostream &os, + const struct ur_kernel_arg_mem_obj_properties_t params) { + os << "(struct ur_kernel_arg_mem_obj_properties_t){"; os << ".stype = "; diff --git a/source/loader/layers/tracing/ur_trcddi.cpp b/source/loader/layers/tracing/ur_trcddi.cpp index 50d3c77abf..53ae4ef075 100644 --- a/source/loader/layers/tracing/ur_trcddi.cpp +++ b/source/loader/layers/tracing/ur_trcddi.cpp @@ -2223,7 +2223,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - const ur_mem_obj_properties_t + const ur_kernel_arg_mem_obj_properties_t *pProperties, ///< [in][optional] pointer to Memory object properties. ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) { diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index b8295396d0..0ce648c171 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -2729,7 +2729,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - const ur_mem_obj_properties_t + const ur_kernel_arg_mem_obj_properties_t *pProperties, ///< [in][optional] pointer to Memory object properties. ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) { diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index bab48dd320..24f339187b 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -2565,7 +2565,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - const ur_mem_obj_properties_t + const ur_kernel_arg_mem_obj_properties_t *pProperties, ///< [in][optional] pointer to Memory object properties. ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) { diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index c338e19bf8..62ad99dd24 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -3021,7 +3021,7 @@ ur_result_t UR_APICALL urKernelSetArgSampler( ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - const ur_mem_obj_properties_t + const ur_kernel_arg_mem_obj_properties_t *pProperties, ///< [in][optional] pointer to Memory object properties. ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) try { diff --git a/source/ur_api.cpp b/source/ur_api.cpp index e38814bc12..843732c84f 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -2527,7 +2527,7 @@ ur_result_t UR_APICALL urKernelSetArgSampler( ur_result_t UR_APICALL urKernelSetArgMemObj( ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - const ur_mem_obj_properties_t + const ur_kernel_arg_mem_obj_properties_t *pProperties, ///< [in][optional] pointer to Memory object properties. ur_mem_handle_t hArgValue ///< [in][optional] handle of Memory object. ) { From bee29aec36c8fad3edfd2bc9246e74b0c0c9cf01 Mon Sep 17 00:00:00 2001 From: "Tikhomirova, Kseniya" Date: Thu, 15 Jun 2023 05:35:36 -0700 Subject: [PATCH 10/10] fix name Signed-off-by: Tikhomirova, Kseniya --- include/ur.py | 2 +- include/ur_api.h | 2 +- scripts/core/common.yml | 2 +- source/common/ur_params.hpp | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/ur.py b/include/ur.py index cc026f53ca..dd178365b8 100644 --- a/include/ur.py +++ b/include/ur.py @@ -233,7 +233,7 @@ class ur_structure_type_v(IntEnum): DEVICE_PARTITION_PROPERTIES = 26 ## ::ur_device_partition_properties_t EXP_COMMAND_BUFFER_DESC = 27 ## ::ur_exp_command_buffer_desc_t EXP_SAMPLER_MIP_PROPERTIES = 28 ## ::ur_exp_sampler_mip_properties_t - MEM_OBJ_PROPERTIES = 29 ## ::ur_kernel_arg_mem_obj_properties_t + KERNEL_ARG_MEM_OBJ_PROPERTIES = 29 ## ::ur_kernel_arg_mem_obj_properties_t class ur_structure_type_t(c_int): def __str__(self): diff --git a/include/ur_api.h b/include/ur_api.h index 9d259f3f39..a6b9f62b34 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -257,7 +257,7 @@ typedef enum ur_structure_type_t { UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES = 26, ///< ::ur_device_partition_properties_t UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC = 27, ///< ::ur_exp_command_buffer_desc_t UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES = 28, ///< ::ur_exp_sampler_mip_properties_t - UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES = 29, ///< ::ur_kernel_arg_mem_obj_properties_t + UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES = 29, ///< ::ur_kernel_arg_mem_obj_properties_t /// @cond UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff /// @endcond diff --git a/scripts/core/common.yml b/scripts/core/common.yml index c7dd338810..af0af4aaff 100644 --- a/scripts/core/common.yml +++ b/scripts/core/common.yml @@ -331,7 +331,7 @@ etors: desc: $x_exp_command_buffer_desc_t - name: EXP_SAMPLER_MIP_PROPERTIES desc: $x_exp_sampler_mip_properties_t - - name: MEM_OBJ_PROPERTIES + - name: KERNEL_ARG_MEM_OBJ_PROPERTIES desc: $x_kernel_arg_mem_obj_properties_t --- #-------------------------------------------------------------------------- type: struct diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index 70d62fcf67..1acd701851 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -761,8 +761,8 @@ inline std::ostream &operator<<(std::ostream &os, os << "UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES"; break; - case UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES: - os << "UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES"; + case UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES: + os << "UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES"; break; default: os << "unknown enumerator"; @@ -946,7 +946,7 @@ inline void serializeStruct(std::ostream &os, const void *ptr) { ur_params::serializePtr(os, pstruct); } break; - case UR_STRUCTURE_TYPE_MEM_OBJ_PROPERTIES: { + case UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES: { const ur_kernel_arg_mem_obj_properties_t *pstruct = (const ur_kernel_arg_mem_obj_properties_t *)ptr; ur_params::serializePtr(os, pstruct);