Use static_object for dimension map (#616)

이 커밋은 다음에 포함됨:
Benjamin Welton 작성하고 GitHub가 2024-03-13 09:28:33 -05:00를 커밋함
1 부모 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>&