Use small_vector for API iterate_args (#597)
* Use small_vector for API iterate_args - replace dim3 value arguments with rocprofiler_dim3_t - dim3 has a non-trivial destructor - common::mpl::unqualified_type - common::stringified_argument_array_t<N> alias - assert_public_data_type_properties() - common::container::small_vector<T>::at function - stringize returns small_vector<stringified_argument> - stack allocated vector - remove has_pc_sampling condition (HSA, HIP) - this will be handled in queue interception * Misc tweaks
This commit is contained in:
committed by
GitHub
parent
2a262235db
commit
8591ed1c96
@@ -22,6 +22,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "lib/common/container/small_vector.hpp"
|
||||
#include "lib/common/mpl.hpp"
|
||||
|
||||
#include <fmt/core.h>
|
||||
@@ -40,10 +41,14 @@ struct stringified_argument
|
||||
int32_t indirection_level = 0;
|
||||
int32_t dereference_count = 0;
|
||||
const char* type = nullptr;
|
||||
std::string name = {};
|
||||
const char* name = nullptr;
|
||||
std::string value = {};
|
||||
};
|
||||
|
||||
template <size_t N>
|
||||
using stringified_argument_array_t =
|
||||
container::small_vector<stringified_argument, std::min<size_t>(N, 6)>;
|
||||
|
||||
template <typename Tp, typename FuncT>
|
||||
auto
|
||||
stringize_arg_impl(const Tp& _v, const int32_t max_deref, int32_t& deref_cnt, FuncT&& impl)
|
||||
@@ -114,7 +119,7 @@ stringize_arg(int32_t max_deref, const std::pair<const char*, Tp>& arg, FuncT&&
|
||||
auto _arg = common::stringified_argument{};
|
||||
_arg.indirection_level = mpl::indirection_level<Tp>::value;
|
||||
_arg.type = typeid(Tp).name();
|
||||
_arg.name = std::string{arg.first};
|
||||
_arg.name = arg.first;
|
||||
_arg.value = stringize_arg_impl(
|
||||
arg.second, max_deref, _arg.dereference_count, std::forward<FuncT>(impl));
|
||||
return _arg;
|
||||
|
||||
Reference in New Issue
Block a user