Add missing formatters for ompt_mutex_t and ompt_target_t. (#1343)
This are used by rocprofiler-system when it
generates perfetto output.
This commit is contained in:
@@ -211,6 +211,26 @@ struct formatter<ompt_work_t> : rocprofiler::ompt::details::base_formatter
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct formatter<ompt_mutex_t> : rocprofiler::ompt::details::base_formatter
|
||||
{
|
||||
template <typename Ctx>
|
||||
auto format(const ompt_mutex_t& v, Ctx& ctx) const
|
||||
{
|
||||
switch(v)
|
||||
{
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, mutex_lock);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, mutex_test_lock);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, mutex_nest_lock);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, mutex_test_nest_lock);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, mutex_critical);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, mutex_atomic);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, mutex_ordered);
|
||||
}
|
||||
return fmt::format_to(ctx.out(), "Unknown");
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct formatter<ompt_task_status_t> : rocprofiler::ompt::details::base_formatter
|
||||
{
|
||||
@@ -232,6 +252,27 @@ struct formatter<ompt_task_status_t> : rocprofiler::ompt::details::base_formatte
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct formatter<ompt_target_t> : rocprofiler::ompt::details::base_formatter
|
||||
{
|
||||
template <typename Ctx>
|
||||
auto format(const ompt_target_t& v, Ctx& ctx) const
|
||||
{
|
||||
switch(v)
|
||||
{
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, target);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, target_enter_data);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, target_exit_data);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, target_update);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, target_nowait);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, target_enter_data_nowait);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, target_exit_data_nowait);
|
||||
ROCP_SDK_OMPT_FORMAT_CASE_STMT(ompt, target_update_nowait);
|
||||
}
|
||||
return fmt::format_to(ctx.out(), "Unknown");
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct formatter<ompt_frame_t> : rocprofiler::ompt::details::base_formatter
|
||||
{
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user