23.11
|
Go to the documentation of this file.
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;
52 file, line,
"This CPU architecture does not support F16 data type, you need v8.2 or above");
68 bool bf16_kernels_enabled =
false;
69 #if defined(ARM_COMPUTE_ENABLE_BF16)
70 bf16_kernels_enabled =
true;
76 function, file, line,
"This CPU architecture does not support BFloat16 data type, you need v8.6 or above");
114 #define ARM_COMPUTE_ERROR_ON_CPU_F16_UNSUPPORTED(tensor) \
115 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_unsupported_cpu_fp16(__func__, __FILE__, __LINE__, tensor))
117 #define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor) \
118 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_unsupported_cpu_fp16(__func__, __FILE__, __LINE__, tensor))
120 #define ARM_COMPUTE_ERROR_ON_CPU_BF16_UNSUPPORTED(tensor) \
121 ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_unsupported_cpu_bf16(__func__, __FILE__, __LINE__, tensor))
123 #define ARM_COMPUTE_RETURN_ERROR_ON_CPU_BF16_UNSUPPORTED(tensor) \
124 ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_unsupported_cpu_bf16(__func__, __FILE__, __LINE__, tensor))
@ BFLOAT16
16-bit brain floating-point number
static CPUInfo & get()
Access the KernelLibrary singleton.
Interface for CPU tensor.
DataType data_type() const override
Data type used for each element of the tensor.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
bool has_bf16() const
Checks if the cpu model supports bf16.
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...
bool has_fp16() const
Checks if the cpu model supports fp16.
CLTensor * tensor
Pointer to the auxiliary tensor.
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...
Copyright (c) 2017-2023 Arm Limited.
@ F16
16-bit floating-point number
TensorInfo * info() const override
Interface to be implemented by the child class to return the tensor's metadata.
Store the tensor's metadata.
TensorInfo tensor_info
Associated tensor info.
#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.