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:
Jonathan R. Madsen
2024-03-13 07:36:55 -05:00
committed by GitHub
parent 2a262235db
commit 8591ed1c96
14 changed files with 175 additions and 97 deletions
+22 -15
View File
@@ -107,26 +107,33 @@ get_val(Container& map, const Key& key)
return (pos != map.end() ? &pos->second : nullptr);
}
template <typename Tp>
constexpr void
assert_public_data_type_properties()
{
static_assert(std::is_standard_layout<Tp>::value,
"public data type struct should have a standard layout");
static_assert(std::is_trivial<Tp>::value, "public data type should be trivial");
static_assert(std::is_default_constructible<Tp>::value,
"public data type struct should be default constructible");
static_assert(std::is_trivially_copy_constructible<Tp>::value,
"public data type struct should be trivially copy constructible");
static_assert(std::is_trivially_move_constructible<Tp>::value,
"public data type struct should be trivially move constructible");
static_assert(std::is_trivially_copy_assignable<Tp>::value,
"public data type struct should be trivially move assignable");
static_assert(std::is_trivially_move_assignable<Tp>::value,
"public data type struct should be trivially move assignable");
static_assert(std::is_trivially_copyable<Tp>::value,
"public data type struct should be trivially move assignable");
}
template <typename Tp>
constexpr void
assert_public_api_struct_properties()
{
assert_public_data_type_properties<Tp>();
static_assert(std::is_class<Tp>::value, "this is not a public API struct");
static_assert(std::is_standard_layout<Tp>::value,
"public API struct should have a standard layout");
static_assert(std::is_trivially_default_constructible<Tp>::value,
"public API struct should be trivially default constructible");
static_assert(std::is_trivially_copy_constructible<Tp>::value,
"public API struct should be trivially copy constructible");
static_assert(std::is_trivially_move_constructible<Tp>::value,
"public API struct should be trivially move constructible");
static_assert(std::is_trivially_copy_assignable<Tp>::value,
"public API struct should be trivially move assignable");
static_assert(std::is_trivially_move_assignable<Tp>::value,
"public API struct should be trivially move assignable");
static_assert(std::is_trivially_copyable<Tp>::value,
"public API struct should be trivially move assignable");
static_assert(std::is_trivial<Tp>::value, "public API struct should be trivial");
static_assert(offsetof(Tp, size) == 0, "public API struct should have a size field first");
static_assert(sizeof(std::declval<Tp>().size) == sizeof(uint64_t),
"public API struct size field should be 64 bits");