24 #ifndef ARM_COMPUTE_TEST_UTILS 25 #define ARM_COMPUTE_TEST_UTILS 37 #include <type_traits> 53 template <
int N,
int... Ns>
54 struct sequence_generator;
57 struct sequence_generator<0, Ns...>
59 using type = sequence<Ns...>;
62 template <
int N,
int... Ns>
63 struct sequence_generator : sequence_generator < N - 1, N - 1, Ns... >
71 template <
typename O,
typename F,
typename... As,
int... S>
74 (obj->*
func)(std::get<S>(args)...);
78 template <
typename O,
typename F,
typename... As>
92 template <typename T, typename std::enable_if<std::is_same<typename T::value_type, std::string>::value,
int>
::type = 0>
93 std::string
join(T first, T last,
const std::string &separator)
95 return std::accumulate(std::next(first), last, *first, [&separator](
const std::string & base,
const std::string & suffix)
97 return base + separator + suffix;
116 template <
typename T,
typename UnaryOp>
117 std::string
join(T &&first, T &&last,
const std::string &separator, UnaryOp &&op)
119 return std::accumulate(std::next(first), last, op(*first), [&separator, &op](
const std::string & base,
const typename T::value_type & suffix)
121 return base + separator + op(suffix);
135 template <typename T, typename std::enable_if<std::is_arithmetic<typename T::value_type>::value,
int>::type = 0>
136 std::string
join(T && first, T && last,
const std::string &separator)
147 inline std::string
tolower(std::string
string)
149 std::transform(
string.begin(),
string.
end(),
string.begin(), [](
unsigned char c)
163 template <typename T, typename std::enable_if<std::is_arithmetic<T>::value,
int>::type = 0>
166 std::stringstream
ss;
168 ss.precision((decimal_places) ? decimal_places : std::numeric_limits<T>::digits10 + 1);
std::string join(T first, T last, const std::string &separator)
Helper function to concatenate multiple strings.
std::string tolower(std::string string)
Convert string to lower case.
std::string to_string(T &&value)
Convert integer and float values to string.
std::stringstream ss(mlgo_str)
decltype(strategy::transforms) typedef type
Copyright (c) 2017-2021 Arm Limited.
void apply_impl(O *obj, F &&func, const std::tuple< As... > &args, detail::sequence< S... >)
void end(TokenStream &in, bool &valid)
void apply(O *obj, F &&func, const std::tuple< As... > &args)
void sleep_in_seconds(float seconds)
Makes the calling thread to sleep for a specified number of seconds.
__kernel void accumulate(__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_offset_first_element_in_bytes, __global uchar *accu_ptr, uint accu_stride_x, uint accu_step_x, uint accu_stride_y, uint accu_step_y, uint accu_offset_first_element_in_bytes)
This function accumulates an input image into output image.
std::string arithmetic_to_string(T val, int decimal_places=0)
Create a string with the arithmetic value in full precision.