42 struct RangeSelectorData
57 static const RangeUKernel available_kernels[] =
61 [](
const RangeSelectorData & data) {
return data.dt ==
DataType::F16; },
66 [](
const RangeSelectorData & data) {
return data.dt ==
DataType::F32; },
71 [](
const RangeSelectorData & data) {
return data.dt ==
DataType::U8; },
76 [](
const RangeSelectorData & data) {
return data.dt ==
DataType::U16; },
81 [](
const RangeSelectorData & data) {
return data.dt ==
DataType::U32; },
86 [](
const RangeSelectorData & data) {
return data.dt ==
DataType::S8; },
91 [](
const RangeSelectorData & data) {
return data.dt ==
DataType::S16; },
96 [](
const RangeSelectorData & data) {
return data.dt ==
DataType::S32; },
107 const RangeUKernel *get_implementation(
const RangeSelectorData &data)
109 for(
const auto &uk : available_kernels)
111 if(uk.is_selected(data))
121 const auto *uk = get_implementation(RangeSelectorData{ output.data_type() });
142 : _start(0), _end(1), _step(1), _output(nullptr)
163 INEKernel::configure(win);
180 const auto *uk = get_implementation(RangeSelectorData{ _output->
info()->
data_type() });
182 uk->ukernel(_output, _start, _step, window);
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
const Window & window() const
The maximum window the kernel can be executed on.
#define REGISTER_FP16_NEON(func_name)
1 channel, 1 U8 per channel
#define REGISTER_FP32_NEON(func_name)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
void configure(ITensor *output, float start, float end, float step)
Initialize the kernel's output tensor, start, end and step of the sequence.
1 channel, 1 F32 per channel
const RangeSelectorPtr is_selected
Store the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
1 channel, 1 U16 per channel
void fp16_neon_range_function(ITensor *output, float start, float step, const Window &window)
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
decltype(strategy::transforms) typedef type
Interface for CPU tensor.
Copyright (c) 2017-2022 Arm Limited.
1 channel, 1 F16 per channel
#define REGISTER_INTEGER_NEON(func_name)
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
1 channel, 1 S32 per channel
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.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
1 channel, 1 U32 per channel
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 fp32_neon_range_function(ITensor *output, float start, float step, const Window &window)
Class to describe a number of elements in each dimension.
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...
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void end(TokenStream &in, bool &valid)
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
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.
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
1 channel, 1 S16 per channel
void s16_neon_range_function(ITensor *output, float start, float step, const Window &window)
void s8_neon_range_function(ITensor *output, float start, float step, const Window &window)
void u8_neon_range_function(ITensor *output, float start, float step, const Window &window)
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Information about executing thread and CPU.
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Includes all wrapper headers at once.
void u32_neon_range_function(ITensor *output, float start, float step, const Window &window)
void u16_neon_range_function(ITensor *output, float start, float step, const Window &window)
DataType
Available data types.
Describe a multidimensional execution window.
NERangeKernel()
Default constructor.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
void s32_neon_range_function(ITensor *output, float start, float step, const Window &window)