24 #ifndef ARM_COMPUTE_CPP_VALIDATE_H 25 #define ARM_COMPUTE_CPP_VALIDATE_H 44 bool fp16_kernels_enabled =
false;
45 #if defined(ARM_COMPUTE_ENABLE_FP16) && defined(ENABLE_FP16_KERNELS) 46 fp16_kernels_enabled =
true;
51 function, file, line,
"This CPU architecture does not support F16 data type, you need v8.2 or above");
67 bool bf16_kernels_enabled =
false;
68 #if defined(ARM_COMPUTE_ENABLE_BF16) 69 bf16_kernels_enabled =
true;
74 function, file, line,
"This CPU architecture does not support BFloat16 data type, you need v8.6 or above");
112 #define ARM_COMPUTE_ERROR_ON_CPU_F16_UNSUPPORTED(tensor) \ 113 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_unsupported_cpu_fp16(__func__, __FILE__, __LINE__, tensor)) 115 #define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor) \ 116 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_unsupported_cpu_fp16(__func__, __FILE__, __LINE__, tensor)) 118 #define ARM_COMPUTE_ERROR_ON_CPU_BF16_UNSUPPORTED(tensor) \ 119 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_unsupported_cpu_bf16(__func__, __FILE__, __LINE__, tensor)) 121 #define ARM_COMPUTE_RETURN_ERROR_ON_CPU_BF16_UNSUPPORTED(tensor) \ 122 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_unsupported_cpu_bf16(__func__, __FILE__, __LINE__, tensor)) bool has_bf16() const
Checks if the cpu model supports bf16.
#define ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(cond, func, file, line, msg)
If the condition is true, an error is thrown.
#define ARM_COMPUTE_RETURN_ERROR_ON_LOC(cond, func, file, line)
If the condition is true, an error is returned.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
bool has_fp16() const
Checks if the cpu model supports fp16.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
Store the tensor's metadata.
Interface for CPU tensor.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
16-bit brain floating-point number
Status error_on_unsupported_cpu_bf16(const char *function, const char *file, const int line, const ITensorInfo *tensor_info)
Return an error if the data type of the passed tensor info is BFLOAT16 and BFLOAT16 support is not co...
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
Status error_on_unsupported_cpu_fp16(const char *function, const char *file, const int line, const ITensorInfo *tensor_info)
Return an error if the data type of the passed tensor info is FP16 and FP16 support is not compiled i...
static CPUInfo & get()
Access the KernelLibrary singleton.