ArmNN
 24.02
StringMapping.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 namespace armnn
9 {
10 
11 ///
12 /// StringMapping is helper class to be able to use strings as template
13 /// parameters, so this allows simplifying code which only differs in
14 /// a string, such as a debug string literal.
15 ///
17 {
18 public:
19  enum Id {
27  };
28 
29  const char * Get(Id id) const
30  {
31  return m_Strings[id];
32  }
33 
34  static const StringMapping& Instance();
35 
36 private:
38  {
39  m_Strings[RefAdditionWorkload_Execute] = "RefAdditionWorkload_Execute";
40  m_Strings[RefDivisionWorkload_Execute] = "RefDivisionWorkload_Execute";
41  m_Strings[RefMaximumWorkload_Execute] = "RefMaximumWorkload_Execute";
42  m_Strings[RefMinimumWorkload_Execute] = "RefMinimumWorkload_Execute";
43  m_Strings[RefMultiplicationWorkload_Execute] = "RefMultiplicationWorkload_Execute";
44  m_Strings[RefSubtractionWorkload_Execute] = "RefSubtractionWorkload_Execute";
45  }
46 
47  StringMapping(const StringMapping &) = delete;
48  StringMapping& operator=(const StringMapping &) = delete;
49 
50  const char * m_Strings[MAX_STRING_ID];
51 };
52 
53 } //namespace armnn
armnn::StringMapping
StringMapping is helper class to be able to use strings as template parameters, so this allows simpli...
Definition: StringMapping.hpp:16
armnn::StringMapping::RefMaximumWorkload_Execute
@ RefMaximumWorkload_Execute
Definition: StringMapping.hpp:22
armnn::StringMapping::MAX_STRING_ID
@ MAX_STRING_ID
Definition: StringMapping.hpp:26
armnn::StringMapping::RefDivisionWorkload_Execute
@ RefDivisionWorkload_Execute
Definition: StringMapping.hpp:21
armnn::StringMapping::RefAdditionWorkload_Execute
@ RefAdditionWorkload_Execute
Definition: StringMapping.hpp:20
armnn::StringMapping::Id
Id
Definition: StringMapping.hpp:19
armnn::StringMapping::RefMultiplicationWorkload_Execute
@ RefMultiplicationWorkload_Execute
Definition: StringMapping.hpp:24
armnn::StringMapping::RefSubtractionWorkload_Execute
@ RefSubtractionWorkload_Execute
Definition: StringMapping.hpp:25
armnn::StringMapping::RefMinimumWorkload_Execute
@ RefMinimumWorkload_Execute
Definition: StringMapping.hpp:23
armnn::StringMapping::Get
const char * Get(Id id) const
Definition: StringMapping.hpp:29
armnn::StringMapping::Instance
static const StringMapping & Instance()
Definition: StringMapping.cpp:11
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6