Async memory copy callback tracing + memory copy size (#791)

* Async memory copy tracing update

- rocprofiler_buffer_tracing_memory_copy_record_t: thread_id and bytes
- support ROCPROFILER_CALLBACK_TRACING_MEMORY_COPY
- init_public_api_struct can fully construct

* Testing for callback async copy tracing
This commit is contained in:
Jonathan R. Madsen
2024-04-18 04:31:59 -05:00
committed by GitHub
parent edb1883a05
commit 12c836f95f
13 changed files with 378 additions and 170 deletions
+16 -6
View File
@@ -170,25 +170,35 @@ compute_runtime_sizeof()
return compute_runtime_sizeof<Tp>(0);
}
template <typename Tp>
template <typename Tp, typename... Args>
decltype(auto)
init_public_api_struct(Tp&& val)
init_public_api_struct(Tp&& val, Args&&... args)
{
assert_public_api_struct_properties<Tp>();
::memset(&val, 0, sizeof(Tp));
val.size = compute_runtime_sizeof<Tp>();
if constexpr(sizeof...(Args) == 0)
val.size = compute_runtime_sizeof<Tp>();
else
val = {compute_runtime_sizeof<Tp>(), std::forward<Args>(args)...};
return std::forward<Tp>(val);
}
template <typename Tp>
template <typename Tp, typename... Args>
Tp&
init_public_api_struct(Tp& val)
init_public_api_struct(Tp& val, Args&&... args)
{
assert_public_api_struct_properties<Tp>();
::memset(&val, 0, sizeof(Tp));
val.size = compute_runtime_sizeof<Tp>();
if constexpr(sizeof...(Args) == 0)
val.size = compute_runtime_sizeof<Tp>();
else
val = {compute_runtime_sizeof<Tp>(), std::forward<Args>(args)...};
return val;
}