Compute Library
 22.08
Utils.h File Reference
#include "tests/AssetsLibrary.h"
#include "utils/Utils.h"
#include <chrono>
#include <limits>
#include <type_traits>

Go to the source code of this file.

Namespaces

 arm_compute
 Copyright (c) 2017-2022 Arm Limited.
 
 arm_compute::test
 
 arm_compute::test::validation
 
 arm_compute::test::validation::utils
 

Macros

#define TICK(clock_name)   auto clock_name##_tick = std::chrono::high_resolution_clock::now();
 A pair of macros which measures the wall clock time, and records it into a map measurement_map with name clock_name. More...
 
#define TOCK(clock_name, measurement_map)
 
#define TOCK_AVG(clock_name, measurement_map, num_iterations)
 

Functions

template<typename T , typename U >
void fill (U &&tensor, int seed, AssetsLibrary *library)
 

Macro Definition Documentation

◆ TICK

#define TICK (   clock_name)    auto clock_name##_tick = std::chrono::high_resolution_clock::now();

A pair of macros which measures the wall clock time, and records it into a map measurement_map with name clock_name.

Definition at line 45 of file Utils.h.

◆ TOCK

#define TOCK (   clock_name,
  measurement_map 
)
Value:
auto clock_name##_tock = std::chrono::high_resolution_clock::now(); \
measurement_map["\"" #clock_name "\""] = duration_cast<microseconds>(clock_name##_tock - clock_name##_tick);

Definition at line 47 of file Utils.h.

◆ TOCK_AVG

#define TOCK_AVG (   clock_name,
  measurement_map,
  num_iterations 
)
Value:
auto clock_name##_tock = std::chrono::high_resolution_clock::now(); \
measurement_map["\"" #clock_name "\""] = duration_cast<microseconds>((clock_name##_tock - clock_name##_tick) / (num_iterations));

Definition at line 50 of file Utils.h.