24.02.1
|
Go to the documentation of this file.
44 struct RangeSelectorData
49 using RangeSelectorPtr = std::add_pointer<bool(
const RangeSelectorData &data)>
::type;
50 using RangeUKernelPtr = std::add_pointer<void(ITensor *,
float,
float,
const Window &)>
::type;
59 static const RangeUKernel available_kernels[] = {
60 {
"fp16_neon_range", [](
const RangeSelectorData &data) {
return data.dt ==
DataType::F16; },
62 {
"f32_neon_range", [](
const RangeSelectorData &data) {
return data.dt ==
DataType::F32; },
64 {
"u8_neon_range", [](
const RangeSelectorData &data) {
return data.dt ==
DataType::U8; },
66 {
"u16_neon_range", [](
const RangeSelectorData &data) {
return data.dt ==
DataType::U16; },
68 {
"u32_neon_range", [](
const RangeSelectorData &data) {
return data.dt ==
DataType::U32; },
70 {
"s8_neon_range", [](
const RangeSelectorData &data) {
return data.dt ==
DataType::S8; },
72 {
"s16_neon_range", [](
const RangeSelectorData &data) {
return data.dt ==
DataType::S16; },
74 {
"s32_neon_range", [](
const RangeSelectorData &data) {
return data.dt ==
DataType::S32; },
84 const RangeUKernel *get_implementation(
const RangeSelectorData &data)
86 for (
const auto &uk : available_kernels)
88 if (uk.is_selected(data))
98 const auto *uk = get_implementation(RangeSelectorData{output.data_type()});
106 "start value is outside the range of the data type");
108 "end value is outside the range of the data type");
110 "step value is outside the range of the data type");
116 "Output tensor size is incorrect");
144 INEKernel::configure(win);
161 const auto *uk = get_implementation(RangeSelectorData{_output->
info()->
data_type()});
163 uk->ukernel(_output, _start, _step,
window);
Class to describe a number of elements in each dimension.
void s16_neon_range_function(ITensor *output, float start, float step, const Window &window)
decltype(strategy::transforms) typedef type
void u32_neon_range_function(ITensor *output, float start, float step, const Window &window)
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
@ U16
unsigned 16-bit number
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
void u16_neon_range_function(ITensor *output, float start, float step, const Window &window)
Interface for CPU tensor.
void s32_neon_range_function(ITensor *output, float start, float step, const Window &window)
#define REGISTER_FP16_NEON(func_name)
Includes all wrapper headers at once.
void s8_neon_range_function(ITensor *output, float start, float step, const Window &window)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
#define REGISTER_FP32_NEON(func_name)
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
NERangeKernel()
Default constructor.
void u8_neon_range_function(ITensor *output, float start, float step, const Window &window)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
@ U32
unsigned 32-bit number
bool check_value_range(T val, DataType dt, QuantizationInfo qinfo=QuantizationInfo())
Returns true if the value can be represented by the given data type.
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
@ U8
unsigned 8-bit number
@ S16
signed 16-bit number
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
#define REGISTER_INTEGER_NEON(func_name)
virtual DataType data_type() const =0
Data type used for each element of the tensor.
void fp16_neon_range_function(ITensor *output, float start, float step, const Window &window)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
const Window & window() const
The maximum window the kernel can be executed on.
static Status validate(const ITensorInfo *output, float start, float end, float step)
Static function to check if given info will lead to a valid configuration of NERangeKernel.
Information about executing thread and CPU.
Describe a multidimensional execution window.
void fp32_neon_range_function(ITensor *output, float start, float step, const Window &window)
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Copyright (c) 2017-2024 Arm Limited.
@ F16
16-bit floating-point number
size_t num_of_elements_in_range(const float start, const float end, const float step)
Returns the number of elements required to go from start to end with the wanted step.
@ S32
signed 32-bit number
void end(TokenStream &in, bool &valid)
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Store the tensor's metadata.
@ F32
32-bit floating-point number
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
void configure(ITensor *output, float start, float end, float step)
Initialize the kernel's output tensor, start, end and step of the sequence.
const RangeSelectorPtr is_selected
DataType
Available data types.