Skip to content

Commit b92de6f

Browse files
feature: add to_string support for callbacks (#463)
Related-To: NEO-14577 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
1 parent fd6a69d commit b92de6f

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

scripts/templates/validation/to_string.h.mako

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ inline std::string to_string(${th.make_type_name(n, tags, obj)} handle) {
5858
return to_string(reinterpret_cast<const void*>(handle));
5959
}
6060

61+
%endfor
62+
// Callback to_string functions (function pointers)
63+
%for obj in th.extract_objs(specs, r"callback"):
64+
inline std::string to_string(${th.make_type_name(n, tags, obj)} ptr) {
65+
return to_string(reinterpret_cast<const void*>(ptr));
66+
}
67+
6168
%endfor
6269
%endif
6370
%if n == 'ze':

source/utils/ze_to_string.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ inline std::string to_string(ze_rtas_parallel_operation_exp_handle_t handle) {
120120
return to_string(reinterpret_cast<const void*>(handle));
121121
}
122122

123+
// Callback to_string functions (function pointers)
124+
inline std::string to_string(ze_rtas_geometry_aabbs_cb_ext_t ptr) {
125+
return to_string(reinterpret_cast<const void*>(ptr));
126+
}
127+
128+
inline std::string to_string(ze_rtas_geometry_aabbs_cb_exp_t ptr) {
129+
return to_string(reinterpret_cast<const void*>(ptr));
130+
}
131+
123132
// For primitive types and Level Zero typedef'd types
124133
// Since most Level Zero types are typedef'd to uint32_t, we can't distinguish them by type
125134
inline std::string to_string(uint32_t value) { return std::to_string(value); }

0 commit comments

Comments
 (0)