34 #define UNREACHABLE(why) __builtin_unreachable() 44 std::string s = __PRETTY_FUNCTION__;
46 auto start = s.find(
"cls_");
48 if (start==std::string::npos) {
52 for(
size_t x = start+4; x<s.size(); x++) {
53 if (s[x] ==
';' || s[x] ==
']') {
54 return s.substr(start+4, x-(start+4));
60 return "(unsupported)";
66 return (a + b - 1) /
b;
100 direct.stride = stride;
110 direct.base =
nullptr;
143 const T *
const *
const *
ptr;
152 direct.stride = stride;
156 IndirectInputArg(
const T *
const *
const *ptr,
unsigned int start_row,
unsigned int start_col) : is_indirect(true) {
163 direct.base =
nullptr;
175 template <
typename T>
177 #if defined(__aarch64__) 188 return vl /
sizeof(T);
189 #else // !defined(__aarch64__) 190 return 16 /
sizeof(T);
191 #endif // defined(__aarch64__) 198 template <
typename T>
202 return get_vector_length<T>();
204 return 16 /
sizeof(T);
209 template <
typename T>
212 const T min =
static_cast<T
>(std::numeric_limits<T>::min());
213 const T max =
static_cast<T
>(std::numeric_limits<T>::max());
215 return std::make_tuple(min, max);
222 const float min =
static_cast<float>(-std::numeric_limits<float>::infinity());
223 const float max =
static_cast<float>(std::numeric_limits<float>::infinity());
225 return std::make_tuple(min, max);
228 #if defined(__ARM_FP16_ARGS) 233 const __fp16 min =
static_cast<__fp16
>(-std::numeric_limits<float>::infinity());
234 const __fp16 max =
static_cast<__fp16
>(std::numeric_limits<float>::infinity());
236 return std::make_tuple(min, max);
238 #endif // defined(__ARM_FP16_ARGS) T roundup(const T a, const T b)
IndirectOutputArg(T *const *ptr, size_t offset)
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
const int32_t * per_channel_left_shifts
bool quant_hybrid_symmetric(const Requantize32 &qp)
T iceildiv(const T a, const T b)
int32_t per_layer_left_shift
std::tuple< float, float > get_default_activation_values()
bool quant_no_left_shift(const Requantize32 &qp)
std::string get_type_name()
unsigned long get_vector_length(VLType vl_type)
IndirectOutputArg(T *base, size_t stride)
bool quant_hybrid_asymmetric(const Requantize32 &qp)