diff --git a/scripts/templates/params.hpp.mako b/scripts/templates/params.hpp.mako index 863c3d37ea..01a5c48ba8 100644 --- a/scripts/templates/params.hpp.mako +++ b/scripts/templates/params.hpp.mako @@ -104,7 +104,7 @@ template <> struct is_handle<${th.make_type_name(n, tags, obj)}> : std::true_typ %endfor template inline constexpr bool is_handle_v = is_handle::value; -template inline void serializePtr(std::ostream &os, T *ptr); +template inline void serializePtr(std::ostream &os, const T *ptr); template inline void serializeFlag(std::ostream &os, uint32_t flag); template inline void serializeTagged(std::ostream &os, const void *ptr, T value, size_t size); @@ -192,7 +192,11 @@ template inline void serializeTagged(std::ostream &os, const void * case ${ename}: { %if th.value_traits.is_array(vtype): <% atype = th.value_traits.get_array_name(vtype) %> + %if 'void' in atype: + const ${atype} const *tptr = (const ${atype} const*)ptr; + %else: const ${atype} *tptr = (const ${atype} *)ptr; + %endif %if "char" in atype: ## print char* arrays as simple NULL-terminated strings serializePtr(os, tptr); %else: @@ -209,12 +213,16 @@ template inline void serializeTagged(std::ostream &os, const void * os << "}"; %endif %else: + %if 'void' in vtype: + const ${vtype} const *tptr = (const ${vtype} const *)ptr; + %else: const ${vtype} *tptr = (const ${vtype} *)ptr; + %endif if (sizeof(${vtype}) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(${vtype}) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; <%call expr="member(tptr, vtype, False)"> *tptr @@ -237,7 +245,7 @@ template inline void serializeTagged(std::ostream &os, const void * } ## structure type enum value must be first - enum ${th.make_enum_name(n, tags, obj)} *value = (enum ${th.make_enum_name(n, tags, obj)} *)ptr; + const enum ${th.make_enum_name(n, tags, obj)} *value = (const enum ${th.make_enum_name(n, tags, obj)} *)ptr; switch (*value) { %for n, item in enumerate(obj['etors']): <% @@ -362,21 +370,21 @@ inline std::ostream &operator<<(std::ostream &os, const struct ${th.make_pfncb_p namespace ${x}_params { -template inline void serializePtr(std::ostream &os, T *ptr) { +template inline void serializePtr(std::ostream &os, const T *ptr) { if (ptr == nullptr) { os << "nullptr"; } else if constexpr (std::is_pointer_v) { - os << (void *)(ptr) << " ("; + os << (const void *)(ptr) << " ("; serializePtr(os, *ptr); os << ")"; } else if constexpr (std::is_void_v || is_handle_v) { - os << (void *)ptr; + os << (const void *)ptr; } else if constexpr (std::is_same_v, char>) { - os << (void *)(ptr) << " ("; + os << (const void *)(ptr) << " ("; os << ptr; os << ")"; } else { - os << (void *)(ptr) << " ("; + os << (const void *)(ptr) << " ("; os << *ptr; os << ")"; } diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index 4c1c90e993..999952f09a 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -40,7 +40,7 @@ struct is_handle : std::true_type {}; template <> struct is_handle : std::true_type {}; template inline constexpr bool is_handle_v = is_handle::value; -template inline void serializePtr(std::ostream &os, T *ptr); +template inline void serializePtr(std::ostream &os, const T *ptr); template inline void serializeFlag(std::ostream &os, uint32_t flag); template @@ -1323,7 +1323,8 @@ inline void serializeStruct(std::ostream &os, const void *ptr) { return; } - enum ur_structure_type_t *value = (enum ur_structure_type_t *)ptr; + const enum ur_structure_type_t *value = + (const enum ur_structure_type_t *)ptr; switch (*value) { case UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES: { @@ -2076,7 +2077,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -2123,7 +2124,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_adapter_backend_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -2137,7 +2138,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -2263,7 +2264,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_platform_backend_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -2945,7 +2946,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_device_type_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -2959,7 +2960,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -2973,7 +2974,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -2987,7 +2988,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3001,7 +3002,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3030,7 +3031,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3046,7 +3047,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -3062,7 +3063,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -3078,7 +3079,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -3092,7 +3093,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_queue_flags_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -3106,7 +3107,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3120,7 +3121,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3134,7 +3135,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3148,7 +3149,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3162,7 +3163,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3176,7 +3177,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3190,7 +3191,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3204,7 +3205,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3218,7 +3219,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3232,7 +3233,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3246,7 +3247,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3260,7 +3261,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3274,7 +3275,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3288,7 +3289,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3302,7 +3303,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3316,7 +3317,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3330,7 +3331,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3344,7 +3345,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3358,7 +3359,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3372,7 +3373,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3386,7 +3387,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3400,7 +3401,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3414,7 +3415,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3428,7 +3429,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3442,7 +3443,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3456,7 +3457,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3470,7 +3471,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3484,7 +3485,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3498,7 +3499,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3512,7 +3513,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3526,7 +3527,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3540,7 +3541,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3555,7 +3556,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_device_mem_cache_type_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3569,7 +3570,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3583,7 +3584,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3597,7 +3598,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3611,7 +3612,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3625,7 +3626,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3639,7 +3640,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3654,7 +3655,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_device_local_mem_type_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3668,7 +3669,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3682,7 +3683,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3696,7 +3697,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3710,7 +3711,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3724,7 +3725,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3738,7 +3739,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3752,7 +3753,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3766,7 +3767,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3782,7 +3783,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -3796,7 +3797,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_queue_flags_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -3810,7 +3811,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_queue_flags_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -3830,7 +3831,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_platform_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -3844,7 +3845,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3906,7 +3907,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3920,7 +3921,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3934,7 +3935,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_device_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -3963,7 +3964,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -3979,7 +3980,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4009,7 +4010,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4023,7 +4024,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4053,7 +4054,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << sizeof(ur_device_usm_access_capability_flags_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4069,7 +4070,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << sizeof(ur_device_usm_access_capability_flags_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4085,7 +4086,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << sizeof(ur_device_usm_access_capability_flags_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4101,7 +4102,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << sizeof(ur_device_usm_access_capability_flags_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4117,7 +4118,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << sizeof(ur_device_usm_access_capability_flags_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4144,7 +4145,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4158,7 +4159,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4172,7 +4173,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4186,7 +4187,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4200,7 +4201,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4214,7 +4215,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4228,7 +4229,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4242,7 +4243,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4256,7 +4257,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4270,7 +4271,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4286,7 +4287,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4302,7 +4303,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4318,7 +4319,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4334,7 +4335,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -4348,7 +4349,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4362,7 +4363,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4376,7 +4377,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4390,7 +4391,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4419,7 +4420,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4433,7 +4434,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4447,7 +4448,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4461,7 +4462,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4475,7 +4476,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4489,7 +4490,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4503,7 +4504,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4517,7 +4518,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4531,7 +4532,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4545,7 +4546,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4559,7 +4560,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4573,7 +4574,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4587,7 +4588,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4601,7 +4602,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4615,7 +4616,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4629,7 +4630,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4643,7 +4644,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4657,7 +4658,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4671,7 +4672,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4685,7 +4686,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4699,7 +4700,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4713,7 +4714,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -4727,7 +4728,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -5648,7 +5649,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -5677,7 +5678,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -5691,7 +5692,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -5705,7 +5706,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -5721,7 +5722,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -5737,7 +5738,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -5753,7 +5754,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -5769,7 +5770,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -5985,7 +5986,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -5999,7 +6000,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_context_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -6203,7 +6204,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_image_format_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6217,7 +6218,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6231,7 +6232,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6245,7 +6246,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6259,7 +6260,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6273,7 +6274,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6287,7 +6288,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6594,7 +6595,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6608,7 +6609,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_context_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -6622,7 +6623,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6638,7 +6639,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6653,7 +6654,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_sampler_filter_mode_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6944,7 +6945,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_usm_type_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6952,13 +6953,13 @@ inline void serializeTagged(std::ostream &os, const void *ptr, } break; case UR_USM_ALLOC_INFO_BASE_PTR: { - const void **tptr = (const void **)ptr; + const void *const *tptr = (const void *const *)ptr; if (sizeof(void *) > size) { os << "invalid size (is: " << size << ", expected: >=" << sizeof(void *) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6972,7 +6973,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -6986,7 +6987,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_device_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -7000,7 +7001,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_usm_pool_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -7414,7 +7415,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -7428,7 +7429,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_context_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -7476,7 +7477,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -7490,7 +7491,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -7607,7 +7608,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -7869,7 +7870,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -7883,7 +7884,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_context_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -7897,7 +7898,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -7953,7 +7954,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8065,7 +8066,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_program_build_status_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8092,7 +8093,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_program_binary_type_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8242,7 +8243,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8256,7 +8257,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8270,7 +8271,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_context_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -8284,7 +8285,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_program_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -8304,7 +8305,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8382,7 +8383,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8411,7 +8412,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8425,7 +8426,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8439,7 +8440,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(size_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8494,7 +8495,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8508,7 +8509,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8522,7 +8523,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8536,7 +8537,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8608,7 +8609,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8617,7 +8618,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, case UR_KERNEL_EXEC_INFO_USM_PTRS: { - const void **tptr = (const void **)ptr; + const void *const *tptr = (const void *const *)ptr; os << "{"; size_t nelems = size / sizeof(void *); for (size_t i = 0; i < nelems; ++i) { @@ -8638,7 +8639,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_kernel_cache_config_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8799,7 +8800,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_queue_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -8813,7 +8814,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_device_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -8827,7 +8828,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_queue_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -8841,7 +8842,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_queue_flags_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializeFlag(os, *tptr); @@ -8855,7 +8856,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8869,7 +8870,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -8883,7 +8884,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_bool_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9359,7 +9360,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_queue_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -9373,7 +9374,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_context_handle_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; ur_params::serializePtr(os, *tptr); @@ -9387,7 +9388,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_command_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9401,7 +9402,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(ur_event_status_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9415,7 +9416,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9474,7 +9475,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9488,7 +9489,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9502,7 +9503,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9516,7 +9517,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9530,7 +9531,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint64_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9933,7 +9934,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -9947,7 +9948,7 @@ inline void serializeTagged(std::ostream &os, const void *ptr, << ", expected: >=" << sizeof(uint32_t) << ")"; return; } - os << (void *)(tptr) << " ("; + os << (const void *)(tptr) << " ("; os << *tptr; @@ -15310,21 +15311,21 @@ operator<<(std::ostream &os, namespace ur_params { -template inline void serializePtr(std::ostream &os, T *ptr) { +template inline void serializePtr(std::ostream &os, const T *ptr) { if (ptr == nullptr) { os << "nullptr"; } else if constexpr (std::is_pointer_v) { - os << (void *)(ptr) << " ("; + os << (const void *)(ptr) << " ("; serializePtr(os, *ptr); os << ")"; } else if constexpr (std::is_void_v || is_handle_v) { - os << (void *)ptr; + os << (const void *)ptr; } else if constexpr (std::is_same_v, char>) { - os << (void *)(ptr) << " ("; + os << (const void *)(ptr) << " ("; os << ptr; os << ")"; } else { - os << (void *)(ptr) << " ("; + os << (const void *)(ptr) << " ("; os << *ptr; os << ")"; }