Compute Library
 23.05
arm_compute::test::framework Namespace Reference

Namespaces

 dataset
 
 detail
 

Data Structures

class  CommonOptions
 Common command line options used to configure the framework. More...
 
class  DataTestCase
 Data test case class. More...
 
class  DataTestCaseFactory
 Implementation of a test case factory to create data test cases. More...
 
class  FileNotFound
 Error class for when some external assets are missing. More...
 
class  Fixture
 Abstract fixture class. More...
 
class  Framework
 Main framework class. More...
 
struct  FrameworkConfig
 Framework configuration structure. More...
 
class  Instrument
 Interface for classes that can be used to measure performance. More...
 
struct  InstrumentsInfo
 
class  InstrumentsStats
 Generate common statistics for a set of measurements. More...
 
class  ISchedulerUser
 Scheduler user interface. More...
 
class  JSONPrinter
 Implementation of a Printer that produces JSON output. More...
 
class  MaliCounter
 Instrument implementation for mali hw counters. More...
 
struct  Measurement
 Generic measurement that stores values as either double or long long int. More...
 
class  OpenCLClock
 Instrument creating measurements based on the information returned by clGetEventProfilingInfo for each OpenCL kernel executed. More...
 
class  OpenCLMemoryUsage
 Instrument collecting memory usage information for OpenCL. More...
 
class  PMU
 Class provides access to CPU hardware counters. More...
 
class  PMUCounter
 Implementation of an instrument to count CPU cycles. More...
 
class  PrettyPrinter
 Implementation of a Printer that produces human readable output. More...
 
class  Printer
 Abstract printer class used by the Framework to present output. More...
 
class  Profiler
 Profiler class to collect benchmark numbers. More...
 
class  SchedulerClock
 Instrument creating measurements based on the information returned by clGetEventProfilingInfo for each OpenCL kernel executed. More...
 
class  SimpleTestCaseFactory
 Implementation of a test case factory to create non-data test cases. More...
 
class  TestCase
 Abstract test case class. More...
 
class  TestCaseFactory
 Abstract factory class to create test cases. More...
 
class  TestError
 Error class for failures during test execution. More...
 
class  TestFilter
 Test filter class. More...
 
struct  TestInfo
 Information about a test case. More...
 
struct  TestResult
 Class to store results of a test. More...
 
class  WallClock
 Implementation of an instrument to measure elapsed wall-clock time in milliseconds. More...
 

Typedefs

using InstrumentsDescription = std::pair< InstrumentType, ScaleFactor >
 
using OpenCLTimer = OpenCLClock< false >
 
using OpenCLTimestamps = OpenCLClock< true >
 
using SchedulerTimer = SchedulerClock< false >
 
using SchedulerTimestamps = SchedulerClock< true >
 
using WallClockTimer = WallClock< false >
 
using WallClockTimestamps = WallClock< true >
 

Enumerations

enum  DatasetMode : unsigned int { ALL = ~0U, DISABLED = 0, PRECOMMIT = 1, NIGHTLY = 2 }
 Possible dataset modes. More...
 
enum  LogLevel {
  NONE, CONFIG, TESTS, ERRORS,
  DEBUG, MEASUREMENTS, ALL
}
 Severity of the information. More...
 
enum  ScaleFactor : unsigned int {
  NONE, SCALE_1K, SCALE_1M, TIME_US,
  TIME_MS, TIME_S
}
 
enum  InstrumentType : unsigned int {
  ALL = ~0U, NONE = 0, WALL_CLOCK_TIMER = 0x0100, PMU = 0x0200,
  PMU_CYCLE_COUNTER = 0x0201, PMU_INSTRUCTION_COUNTER = 0x0202, MALI = 0x0300, OPENCL_TIMER = 0x0400,
  SCHEDULER_TIMER = 0x0500, OPENCL_MEMORY_USAGE = 0x0600, WALL_CLOCK_TIMESTAMPS = 0x0700, OPENCL_TIMESTAMPS = 0x0800,
  SCHEDULER_TIMESTAMPS = 0x0900
}
 
enum  LogFormat { NONE, JSON, PRETTY }
 

Functions

int make_printable (int8_t value)
 
std::string make_printable (const arm_compute::WeightFormat wf)
 
unsigned int make_printable (uint8_t value)
 
template<typename T >
make_printable (T &&value)
 
void ARM_COMPUTE_PRINT_INFO ()
 
DatasetMode dataset_mode_from_name (const std::string &name)
 
DatasetMode operator & (DatasetMode t1, DatasetMode t2)
 
DatasetMode operator| (DatasetMode t1, DatasetMode t2)
 
DatasetModeoperator|= (DatasetMode &t1, DatasetMode t2)
 
inline ::std::istream & operator>> (::std::istream &stream, DatasetMode &mode)
 
inline ::std::ostream & operator<< (::std::ostream &stream, DatasetMode mode)
 
std::string to_string (DatasetMode mode)
 
LogLevel log_level_from_name (const std::string &name)
 
::std::istream & operator>> (::std::istream &stream, LogLevel &level)
 
::std::ostream & operator<< (::std::ostream &stream, LogLevel level)
 
std::string to_string (LogLevel level)
 
bool operator< (const TestInfo &lhs, const TestInfo &rhs)
 
InstrumentsDescription instrument_type_from_name (const std::string &name)
 
inline ::std::stringstream & operator>> (::std::stringstream &stream, InstrumentsDescription &instrument)
 
inline ::std::stringstream & operator<< (::std::stringstream &stream, InstrumentsDescription instrument)
 
LogFormat log_format_from_name (const std::string &name)
 
inline ::std::stringstream & operator>> (::std::stringstream &stream, LogFormat &format)
 
inline ::std::stringstream & operator<< (::std::stringstream &stream, LogFormat format)
 
inline ::std::ostream & operator<< (::std::ostream &stream, TestCaseFactory::Status status)
 
void sleep_in_seconds (float seconds)
 Makes the calling thread to sleep for a specified number of seconds. More...
 
template<typename O , typename F , typename... As, int... S>
void apply_impl (O *obj, F &&func, const std::tuple< As... > &args, detail::sequence< S... >)
 

Variables

std::unique_ptr< InstrumentsInfoinstruments_info
 

Typedef Documentation

◆ InstrumentsDescription

Definition at line 69 of file Instruments.h.

◆ OpenCLTimer

using OpenCLTimer = OpenCLClock<false>

Definition at line 81 of file OpenCLTimer.h.

◆ OpenCLTimestamps

Definition at line 82 of file OpenCLTimer.h.

◆ SchedulerTimer

Definition at line 112 of file SchedulerTimer.h.

◆ SchedulerTimestamps

Definition at line 113 of file SchedulerTimer.h.

◆ WallClockTimer

using WallClockTimer = WallClock<false>

Definition at line 83 of file WallClockTimer.h.

◆ WallClockTimestamps

Definition at line 84 of file WallClockTimer.h.

Enumeration Type Documentation

◆ DatasetMode

enum DatasetMode : unsigned int
strong

Possible dataset modes.

Enumerator
ALL 
DISABLED 
PRECOMMIT 
NIGHTLY 

Definition at line 40 of file DatasetModes.h.

◆ InstrumentType

enum InstrumentType : unsigned int
strong
Enumerator
ALL 
NONE 
WALL_CLOCK_TIMER 
PMU 
PMU_CYCLE_COUNTER 
PMU_INSTRUCTION_COUNTER 
MALI 
OPENCL_TIMER 
SCHEDULER_TIMER 
OPENCL_MEMORY_USAGE 
WALL_CLOCK_TIMESTAMPS 
OPENCL_TIMESTAMPS 
SCHEDULER_TIMESTAMPS 

Definition at line 46 of file Instruments.h.

◆ LogFormat

enum LogFormat
strong
Enumerator
NONE 
JSON 
PRETTY 

Definition at line 36 of file Printers.h.

◆ LogLevel

enum LogLevel
strong

Severity of the information.

Each category includes the ones above it.

NONE == Only for filtering. Not used to tag information. CONFIG == Configuration info. TESTS == Information about the tests. ERRORS == Violated assertions/expectations. DEBUG == More violated assertions/expectations. MEASUREMENTS == Information about measurements. ALL == Only for filtering. Not used to tag information.

Enumerator
NONE 
CONFIG 
TESTS 
ERRORS 
DEBUG 
MEASUREMENTS 
ALL 

Definition at line 50 of file Exceptions.h.

◆ ScaleFactor

enum ScaleFactor : unsigned int
strong
Enumerator
NONE 
SCALE_1K 
SCALE_1M 
TIME_US 
TIME_MS 
TIME_S 

Definition at line 40 of file Instrument.h.

Function Documentation

◆ apply_impl()

void arm_compute::test::framework::apply_impl ( O *  obj,
F &&  func,
const std::tuple< As... > &  args,
detail::sequence< S... >   
)

Definition at line 72 of file Utils.h.

Referenced by arm_compute::test::apply().

73 {
74  (obj->*func)(std::get<S>(args)...);
75 }

◆ ARM_COMPUTE_PRINT_INFO()

void arm_compute::test::framework::ARM_COMPUTE_PRINT_INFO ( )
inline

◆ dataset_mode_from_name()

DatasetMode dataset_mode_from_name ( const std::string &  name)

Definition at line 36 of file DatasetModes.cpp.

References ALL, DISABLED, NIGHTLY, PRECOMMIT, and arm_compute::test::tolower().

Referenced by operator>>(), and operator|=().

37 {
38  static const std::map<std::string, DatasetMode> modes =
39  {
40  { "all", DatasetMode::ALL },
41  { "disabled", DatasetMode::DISABLED },
42  { "precommit", DatasetMode::PRECOMMIT },
43  { "nightly", DatasetMode::NIGHTLY },
44  };
45 
46  try
47  {
48  return modes.at(tolower(name));
49  }
50  catch(const std::out_of_range &)
51  {
52  throw std::invalid_argument(name);
53  }
54 }
std::string tolower(std::string string)
Convert string to lower case.
Definition: Utility.h:206
const char * name

◆ instrument_type_from_name()

InstrumentsDescription instrument_type_from_name ( const std::string &  name)

Definition at line 37 of file Instruments.cpp.

References ALL, MALI, NONE, OPENCL_MEMORY_USAGE, OPENCL_TIMER, OPENCL_TIMESTAMPS, PMU, PMU_CYCLE_COUNTER, PMU_INSTRUCTION_COUNTER, SCALE_1K, SCALE_1M, SCHEDULER_TIMER, SCHEDULER_TIMESTAMPS, TIME_MS, TIME_S, TIME_US, arm_compute::test::tolower(), WALL_CLOCK_TIMER, and WALL_CLOCK_TIMESTAMPS.

Referenced by operator>>().

38 {
39  static const std::map<std::string, framework::InstrumentsDescription> types =
40  {
41  { "all", std::pair<InstrumentType, ScaleFactor>(InstrumentType::ALL, ScaleFactor::NONE) },
42  { "none", std::pair<InstrumentType, ScaleFactor>(InstrumentType::NONE, ScaleFactor::NONE) },
43  { "wall_clock", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::NONE) },
44  { "wall_clock_timer", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::NONE) },
45  { "wall_clock_timer_ms", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::TIME_MS) },
46  { "wall_clock_timer_s", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::TIME_S) },
47  { "wall_clock_timestamps", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMESTAMPS, ScaleFactor::NONE) },
48  { "wall_clock_timestamps_ms", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMESTAMPS, ScaleFactor::TIME_MS) },
49  { "wall_clock_timestamps_s", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMESTAMPS, ScaleFactor::TIME_S) },
50  { "scheduler_timestamps", std::pair<InstrumentType, ScaleFactor>(InstrumentType::SCHEDULER_TIMESTAMPS, ScaleFactor::NONE) },
51  { "scheduler_timestamps_ms", std::pair<InstrumentType, ScaleFactor>(InstrumentType::SCHEDULER_TIMESTAMPS, ScaleFactor::TIME_MS) },
52  { "scheduler_timestamps_s", std::pair<InstrumentType, ScaleFactor>(InstrumentType::SCHEDULER_TIMESTAMPS, ScaleFactor::TIME_S) },
53  { "scheduler_timer", std::pair<InstrumentType, ScaleFactor>(InstrumentType::SCHEDULER_TIMER, ScaleFactor::NONE) },
54  { "scheduler_timer_ms", std::pair<InstrumentType, ScaleFactor>(InstrumentType::SCHEDULER_TIMER, ScaleFactor::TIME_MS) },
55  { "scheduler_timer_s", std::pair<InstrumentType, ScaleFactor>(InstrumentType::SCHEDULER_TIMER, ScaleFactor::TIME_S) },
56  { "pmu", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU, ScaleFactor::NONE) },
57  { "pmu_k", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU, ScaleFactor::SCALE_1K) },
58  { "pmu_m", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU, ScaleFactor::SCALE_1M) },
59  { "pmu_cycles", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU_CYCLE_COUNTER, ScaleFactor::NONE) },
60  { "pmu_instructions", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU_INSTRUCTION_COUNTER, ScaleFactor::NONE) },
61  { "mali", std::pair<InstrumentType, ScaleFactor>(InstrumentType::MALI, ScaleFactor::NONE) },
62  { "mali_k", std::pair<InstrumentType, ScaleFactor>(InstrumentType::MALI, ScaleFactor::SCALE_1K) },
63  { "mali_m", std::pair<InstrumentType, ScaleFactor>(InstrumentType::MALI, ScaleFactor::SCALE_1M) },
64  { "opencl_timestamps", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMESTAMPS, ScaleFactor::NONE) },
65  { "opencl_timestamps_us", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMESTAMPS, ScaleFactor::TIME_US) },
66  { "opencl_timestamps_ms", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMESTAMPS, ScaleFactor::TIME_MS) },
67  { "opencl_timestamps_s", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMESTAMPS, ScaleFactor::TIME_S) },
68  { "opencl_timer", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMER, ScaleFactor::NONE) },
69  { "opencl_timer_us", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMER, ScaleFactor::TIME_US) },
70  { "opencl_timer_ms", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMER, ScaleFactor::TIME_MS) },
71  { "opencl_timer_s", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMER, ScaleFactor::TIME_S) },
72  { "opencl_memory_usage", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_MEMORY_USAGE, ScaleFactor::NONE) },
73  { "opencl_memory_usage_k", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_MEMORY_USAGE, ScaleFactor::SCALE_1K) },
74  { "opencl_memory_usage_m", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_MEMORY_USAGE, ScaleFactor::SCALE_1M) },
75  };
76 
77  try
78  {
79  return types.at(tolower(name));
80  }
81  catch(const std::out_of_range &)
82  {
83  throw std::invalid_argument(name);
84  }
85 }
std::string tolower(std::string string)
Convert string to lower case.
Definition: Utility.h:206
const char * name

◆ log_format_from_name()

LogFormat log_format_from_name ( const std::string &  name)

Definition at line 37 of file Printers.cpp.

References JSON, NONE, PRETTY, and arm_compute::test::tolower().

Referenced by operator>>().

38 {
39  static const std::map<std::string, LogFormat> formats =
40  {
41  { "pretty", LogFormat::PRETTY },
42  { "none", LogFormat::NONE },
43  { "json", LogFormat::JSON },
44  };
45 
46  try
47  {
48  return formats.at(tolower(name));
49  }
50  catch(const std::out_of_range &)
51  {
52  throw std::invalid_argument(name);
53  }
54 }
std::string tolower(std::string string)
Convert string to lower case.
Definition: Utility.h:206
const char * name

◆ log_level_from_name()

LogLevel log_level_from_name ( const std::string &  name)

Definition at line 37 of file Exceptions.cpp.

References ALL, CONFIG, DEBUG, ERRORS, MEASUREMENTS, NONE, TESTS, and arm_compute::test::tolower().

Referenced by operator>>().

38 {
39  static const std::map<std::string, LogLevel> levels =
40  {
41  { "none", LogLevel::NONE },
42  { "config", LogLevel::CONFIG },
43  { "tests", LogLevel::TESTS },
44  { "errors", LogLevel::ERRORS },
45  { "debug", LogLevel::DEBUG },
46  { "measurements", LogLevel::MEASUREMENTS },
47  { "all", LogLevel::ALL },
48  };
49 
50  try
51  {
52  return levels.at(tolower(name));
53  }
54  catch(const std::out_of_range &)
55  {
56  throw std::invalid_argument(name);
57  }
58 }
std::string tolower(std::string string)
Convert string to lower case.
Definition: Utility.h:206
const char * name

◆ make_printable() [1/4]

int arm_compute::test::framework::make_printable ( int8_t  value)
inline

Definition at line 42 of file Asserts.h.

Referenced by arm_compute::test::validation::validate(), and arm_compute::test::validation::validate_wrap().

43 {
44  return value;
45 }

◆ make_printable() [2/4]

std::string arm_compute::test::framework::make_printable ( const arm_compute::WeightFormat  wf)
inline

Definition at line 47 of file Asserts.h.

References arm_compute::to_string().

48 {
49  return arm_compute::to_string(wf);
50 }
std::string to_string(const T &val)
Fallback method: try to use std::to_string:
Definition: TypePrinter.h:88

◆ make_printable() [3/4]

unsigned int arm_compute::test::framework::make_printable ( uint8_t  value)
inline

Definition at line 52 of file Asserts.h.

53 {
54  return value;
55 }

◆ make_printable() [4/4]

T arm_compute::test::framework::make_printable ( T &&  value)
inline

Definition at line 59 of file Asserts.h.

60 {
61  return value;
62 }

◆ operator &()

DatasetMode arm_compute::test::framework::operator& ( DatasetMode  t1,
DatasetMode  t2 
)
inline

Definition at line 48 of file DatasetModes.h.

References type.

49 {
51  return static_cast<DatasetMode>(static_cast<type>(t1) & static_cast<type>(t2));
52 }
decltype(strategy::transforms) typedef type
DatasetMode
Possible dataset modes.
Definition: DatasetModes.h:40

◆ operator<()

bool arm_compute::test::framework::operator< ( const TestInfo lhs,
const TestInfo rhs 
)
inline

Definition at line 86 of file Framework.h.

References TestInfo::id.

87 {
88  return lhs.id < rhs.id;
89 }

◆ operator<<() [1/5]

inline ::std::stringstream& arm_compute::test::framework::operator<< ( ::std::stringstream &  stream,
LogFormat  format 
)

Definition at line 53 of file Printers.h.

References JSON, NONE, and PRETTY.

54 {
55  switch(format)
56  {
57  case LogFormat::PRETTY:
58  stream << "PRETTY";
59  break;
60  case LogFormat::NONE:
61  stream << "NONE";
62  break;
63  case LogFormat::JSON:
64  stream << "JSON";
65  break;
66  default:
67  throw std::invalid_argument("Unsupported log format");
68  }
69 
70  return stream;
71 }

◆ operator<<() [2/5]

std::ostream & operator<< ( ::std::ostream &  stream,
LogLevel  level 
)

Definition at line 68 of file Exceptions.cpp.

References ALL, CONFIG, DEBUG, ERRORS, MEASUREMENTS, NONE, and TESTS.

69 {
70  switch(level)
71  {
72  case LogLevel::NONE:
73  stream << "NONE";
74  break;
75  case LogLevel::CONFIG:
76  stream << "CONFIG";
77  break;
78  case LogLevel::TESTS:
79  stream << "TESTS";
80  break;
81  case LogLevel::ERRORS:
82  stream << "ERRORS";
83  break;
84  case LogLevel::DEBUG:
85  stream << "DEBUG";
86  break;
87  case LogLevel::MEASUREMENTS:
88  stream << "MEASUREMENTS";
89  break;
90  case LogLevel::ALL:
91  stream << "ALL";
92  break;
93  default:
94  throw std::invalid_argument("Unsupported log level");
95  }
96 
97  return stream;
98 }

◆ operator<<() [3/5]

inline ::std::ostream& arm_compute::test::framework::operator<< ( ::std::ostream &  stream,
DatasetMode  mode 
)

Definition at line 77 of file DatasetModes.h.

References ALL, DISABLED, NIGHTLY, and PRECOMMIT.

78 {
79  switch(mode)
80  {
81  case DatasetMode::DISABLED:
82  stream << "DISABLED";
83  break;
84  case DatasetMode::PRECOMMIT:
85  stream << "PRECOMMIT";
86  break;
87  case DatasetMode::NIGHTLY:
88  stream << "NIGHTLY";
89  break;
90  case DatasetMode::ALL:
91  stream << "ALL";
92  break;
93  default:
94  throw std::invalid_argument("Unsupported dataset mode");
95  }
96 
97  return stream;
98 }

◆ operator<<() [4/5]

inline ::std::stringstream& arm_compute::test::framework::operator<< ( ::std::stringstream &  stream,
InstrumentsDescription  instrument 
)

Definition at line 81 of file Instruments.h.

References ALL, MALI, NONE, OPENCL_MEMORY_USAGE, OPENCL_TIMER, OPENCL_TIMESTAMPS, PMU, PMU_CYCLE_COUNTER, PMU_INSTRUCTION_COUNTER, SCALE_1K, SCALE_1M, SCHEDULER_TIMER, SCHEDULER_TIMESTAMPS, TIME_MS, TIME_S, TIME_US, WALL_CLOCK_TIMER, and WALL_CLOCK_TIMESTAMPS.

82 {
83  switch(instrument.first)
84  {
85  case InstrumentType::WALL_CLOCK_TIMESTAMPS:
86  switch(instrument.second)
87  {
88  case ScaleFactor::NONE:
89  stream << "WALL_CLOCK_TIMESTAMPS";
90  break;
91  case ScaleFactor::TIME_MS:
92  stream << "WALL_CLOCK_TIMESTAMPS_MS";
93  break;
94  case ScaleFactor::TIME_S:
95  stream << "WALL_CLOCK_TIMESTAMPS_S";
96  break;
97  default:
98  throw std::invalid_argument("Unsupported instrument scale");
99  }
100  break;
101  case InstrumentType::WALL_CLOCK_TIMER:
102  switch(instrument.second)
103  {
104  case ScaleFactor::NONE:
105  stream << "WALL_CLOCK_TIMER";
106  break;
107  case ScaleFactor::TIME_MS:
108  stream << "WALL_CLOCK_TIMER_MS";
109  break;
110  case ScaleFactor::TIME_S:
111  stream << "WALL_CLOCK_TIMER_S";
112  break;
113  default:
114  throw std::invalid_argument("Unsupported instrument scale");
115  }
116  break;
117  case InstrumentType::SCHEDULER_TIMESTAMPS:
118  switch(instrument.second)
119  {
120  case ScaleFactor::NONE:
121  stream << "SCHEDULER_TIMESTAMPS";
122  break;
123  case ScaleFactor::TIME_MS:
124  stream << "SCHEDULER_TIMESTAMPS_MS";
125  break;
126  case ScaleFactor::TIME_S:
127  stream << "SCHEDULER_TIMESTAMPS_S";
128  break;
129  default:
130  throw std::invalid_argument("Unsupported instrument scale");
131  }
132  break;
133  case InstrumentType::SCHEDULER_TIMER:
134  switch(instrument.second)
135  {
136  case ScaleFactor::NONE:
137  stream << "SCHEDULER_TIMER";
138  break;
139  case ScaleFactor::TIME_MS:
140  stream << "SCHEDULER_TIMER_MS";
141  break;
142  case ScaleFactor::TIME_S:
143  stream << "SCHEDULER_TIMER_S";
144  break;
145  default:
146  throw std::invalid_argument("Unsupported instrument scale");
147  }
148  break;
149  case InstrumentType::PMU:
150  switch(instrument.second)
151  {
152  case ScaleFactor::NONE:
153  stream << "PMU";
154  break;
155  case ScaleFactor::SCALE_1K:
156  stream << "PMU_K";
157  break;
158  case ScaleFactor::SCALE_1M:
159  stream << "PMU_M";
160  break;
161  default:
162  throw std::invalid_argument("Unsupported instrument scale");
163  }
164  break;
165  case InstrumentType::PMU_CYCLE_COUNTER:
166  stream << "PMU_CYCLE_COUNTER";
167  break;
168  case InstrumentType::PMU_INSTRUCTION_COUNTER:
169  stream << "PMU_INSTRUCTION_COUNTER";
170  break;
171  case InstrumentType::MALI:
172  switch(instrument.second)
173  {
174  case ScaleFactor::NONE:
175  stream << "MALI";
176  break;
177  case ScaleFactor::SCALE_1K:
178  stream << "MALI_K";
179  break;
180  case ScaleFactor::SCALE_1M:
181  stream << "MALI_M";
182  break;
183  default:
184  throw std::invalid_argument("Unsupported instrument scale");
185  }
186  break;
187  case InstrumentType::OPENCL_TIMESTAMPS:
188  switch(instrument.second)
189  {
190  case ScaleFactor::NONE:
191  stream << "OPENCL_TIMESTAMPS";
192  break;
193  case ScaleFactor::TIME_US:
194  stream << "OPENCL_TIMESTAMPS_US";
195  break;
196  case ScaleFactor::TIME_MS:
197  stream << "OPENCL_TIMESTAMPS_MS";
198  break;
199  case ScaleFactor::TIME_S:
200  stream << "OPENCL_TIMESTAMPS_S";
201  break;
202  default:
203  throw std::invalid_argument("Unsupported instrument scale");
204  }
205  break;
206  case InstrumentType::OPENCL_TIMER:
207  switch(instrument.second)
208  {
209  case ScaleFactor::NONE:
210  stream << "OPENCL_TIMER";
211  break;
212  case ScaleFactor::TIME_US:
213  stream << "OPENCL_TIMER_US";
214  break;
215  case ScaleFactor::TIME_MS:
216  stream << "OPENCL_TIMER_MS";
217  break;
218  case ScaleFactor::TIME_S:
219  stream << "OPENCL_TIMER_S";
220  break;
221  default:
222  throw std::invalid_argument("Unsupported instrument scale");
223  }
224  break;
225  case InstrumentType::OPENCL_MEMORY_USAGE:
226  switch(instrument.second)
227  {
228  case ScaleFactor::NONE:
229  stream << "OPENCL_MEMORY_USAGE";
230  break;
231  case ScaleFactor::SCALE_1K:
232  stream << "OPENCL_MEMORY_USAGE_K";
233  break;
234  case ScaleFactor::SCALE_1M:
235  stream << "OPENCL_MEMORY_USAGE_M";
236  break;
237  default:
238  throw std::invalid_argument("Unsupported instrument scale");
239  }
240  break;
241  case InstrumentType::ALL:
242  stream << "ALL";
243  break;
244  case InstrumentType::NONE:
245  stream << "NONE";
246  break;
247  default:
248  throw std::invalid_argument("Unsupported instrument type");
249  }
250 
251  return stream;
252 }

◆ operator<<() [5/5]

inline ::std::ostream& arm_compute::test::framework::operator<< ( ::std::ostream &  stream,
TestCaseFactory::Status  status 
)

Definition at line 162 of file TestCaseFactory.h.

References TestCaseFactory::ACTIVE, TestCaseFactory::DISABLED, and TestCaseFactory::EXPECTED_FAILURE.

163 {
164  switch(status)
165  {
166  case TestCaseFactory::Status::ACTIVE:
167  stream << "ACTIVE";
168  break;
169  case TestCaseFactory::Status::EXPECTED_FAILURE:
170  stream << "EXPECTED_FAILURE";
171  break;
172  case TestCaseFactory::Status::DISABLED:
173  stream << "DISABLED";
174  break;
175  default:
176  throw std::invalid_argument("Unsupported test case factory status");
177  }
178 
179  return stream;
180 }

◆ operator>>() [1/4]

inline ::std::stringstream& arm_compute::test::framework::operator>> ( ::std::stringstream &  stream,
LogFormat format 
)

Definition at line 45 of file Printers.h.

References log_format_from_name().

46 {
47  std::string value;
48  stream >> value;
49  format = log_format_from_name(value);
50  return stream;
51 }
LogFormat log_format_from_name(const std::string &name)
Definition: Printers.cpp:37

◆ operator>>() [2/4]

std::istream & operator>> ( ::std::istream &  stream,
LogLevel level 
)

Definition at line 60 of file Exceptions.cpp.

References log_level_from_name().

61 {
62  std::string value;
63  stream >> value;
64  level = log_level_from_name(value);
65  return stream;
66 }
LogLevel log_level_from_name(const std::string &name)
Definition: Exceptions.cpp:37

◆ operator>>() [3/4]

inline ::std::istream& arm_compute::test::framework::operator>> ( ::std::istream &  stream,
DatasetMode mode 
)

Definition at line 69 of file DatasetModes.h.

References dataset_mode_from_name().

70 {
71  std::string value;
72  stream >> value;
74  return stream;
75 }
DatasetMode dataset_mode_from_name(const std::string &name)

◆ operator>>() [4/4]

inline ::std::stringstream& arm_compute::test::framework::operator>> ( ::std::stringstream &  stream,
InstrumentsDescription instrument 
)

Definition at line 73 of file Instruments.h.

References instrument_type_from_name().

74 {
75  std::string value;
76  stream >> value;
77  instrument = instrument_type_from_name(value);
78  return stream;
79 }
InstrumentsDescription instrument_type_from_name(const std::string &name)
Definition: Instruments.cpp:37

◆ operator|()

DatasetMode arm_compute::test::framework::operator| ( DatasetMode  t1,
DatasetMode  t2 
)
inline

Definition at line 54 of file DatasetModes.h.

References type.

55 {
57  return static_cast<DatasetMode>(static_cast<type>(t1) | static_cast<type>(t2));
58 }
decltype(strategy::transforms) typedef type
DatasetMode
Possible dataset modes.
Definition: DatasetModes.h:40

◆ operator|=()

DatasetMode& arm_compute::test::framework::operator|= ( DatasetMode t1,
DatasetMode  t2 
)
inline

Definition at line 60 of file DatasetModes.h.

References dataset_mode_from_name(), name, and type.

61 {
63  t1 = static_cast<DatasetMode>(static_cast<type>(t1) | static_cast<type>(t2));
64  return t1;
65 }
decltype(strategy::transforms) typedef type
DatasetMode
Possible dataset modes.
Definition: DatasetModes.h:40

◆ sleep_in_seconds()

void arm_compute::test::framework::sleep_in_seconds ( float  seconds)

Makes the calling thread to sleep for a specified number of seconds.

Parameters
[in]secondsAmount of seconds to sleep. Will return immediately if less or equal to zero.

Definition at line 38 of file Utils.cpp.

Referenced by arm_compute::test::arithmetic_to_string(), and Framework::run().

39 {
40  // Early return on non-positive input
41  if(seconds <= 0.f)
42  {
43  return;
44  }
45 
46 #ifndef NO_MULTI_THREADING
47  const int64_t us = static_cast<int64_t>(seconds * 1e6);
48  std::this_thread::sleep_for(std::chrono::microseconds(us));
49 #endif /* NO_MULTI_THREADING */
50 }

◆ to_string() [1/2]

std::string arm_compute::test::framework::to_string ( DatasetMode  mode)
inline

Definition at line 100 of file DatasetModes.h.

References clang_tidy_rules::mode.

Referenced by RangeDataset< T >::iterator::description(), SingletonDataset< T >::iterator::description(), and ContainerDataset< T >::iterator::description().

101 {
102  std::stringstream stream;
103  stream << mode;
104  return stream.str();
105 }

◆ to_string() [2/2]

std::string to_string ( LogLevel  level)

Definition at line 100 of file Exceptions.cpp.

References GemmTuner::level.

101 {
102  std::stringstream stream;
103  stream << level;
104  return stream.str();
105 }

Variable Documentation

◆ instruments_info

std::unique_ptr< InstrumentsInfo > instruments_info

Definition at line 50 of file Framework.cpp.

Referenced by main(), and SchedulerClock< output_timestamps >::SchedulerClock().