Use static_object for dimension map (#616)

이 커밋은 다음에 포함됨:
Benjamin Welton
2024-03-13 07:28:33 -07:00
커밋한 사람 GitHub
부모 8591ed1c96
커밋 a06eef3488
2개의 변경된 파일8개의 추가작업 그리고 5개의 파일을 삭제
+4 -4
파일 보기
@@ -34,10 +34,10 @@ namespace rocprofiler
{
namespace counters
{
const std::unordered_map<rocprofiler_profile_counter_instance_types, std::string_view>&
const DimensionMap&
dimension_map()
{
static std::unordered_map<rocprofiler_profile_counter_instance_types, std::string_view> map = {
static auto*& _v = common::static_object<DimensionMap>::construct(DimensionMap{
{ROCPROFILER_DIMENSION_NONE, std::string_view("DIMENSION_NONE")},
{ROCPROFILER_DIMENSION_XCC, std::string_view("DIMENSION_XCC")},
{ROCPROFILER_DIMENSION_SHADER_ENGINE, std::string_view("DIMENSION_SHADER_ENGINE")},
@@ -45,8 +45,8 @@ dimension_map()
{ROCPROFILER_DIMENSION_SHADER_ARRAY, std::string_view("DIMENSION_SHADER_ARRAY")},
{ROCPROFILER_DIMENSION_CU, std::string_view("DIMENSION_CU")},
{ROCPROFILER_DIMENSION_INSTANCE, std::string_view("DIMENSION_INSTANCE")},
};
return map;
});
return *_v;
}
const std::unordered_map<int, rocprofiler_profile_counter_instance_types>&