53 constexpr
unsigned int num_elems_read_per_iteration = 16;
54 constexpr
unsigned int num_elems_written_per_iteration = 8;
55 constexpr
unsigned int num_rows_read_per_iteration = 3;
66 INEKernel::configure(win);
78 const uint8_t *input_bot_ptr = _input->ptr_to_element(
Coordinates(-1, -1));
79 const uint8_t *input_mid_ptr = _input->ptr_to_element(
Coordinates(-1, 0));
80 const uint8_t *input_top_ptr = _input->ptr_to_element(
Coordinates(-1, +1));
82 static const int16x8_t two = vdupq_n_s16(2);
83 static const int16x8_t four = vdupq_n_s16(4);
87 uint8x16_t top_data = vld1q_u8(input_top_ptr + input.
offset());
88 uint8x16_t mid_data = vld1q_u8(input_mid_ptr + input.
offset());
89 uint8x16_t bot_data = vld1q_u8(input_bot_ptr + input.
offset());
91 const int16x8x2_t top_s16 =
94 vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(top_data))),
95 vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(top_data)))
98 const int16x8x2_t mid_s16 =
101 vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(mid_data))),
102 vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(mid_data)))
105 const int16x8x2_t bot_s16 =
108 vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(bot_data))),
109 vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(bot_data)))
114 int16x8_t out = top_s16.val[0];
116 out = vmlaq_s16(out, vextq_s16(top_s16.val[0], top_s16.val[1], 1), two);
118 out = vaddq_s16(out, vextq_s16(top_s16.val[0], top_s16.val[1], 2));
120 out = vmlaq_s16(out, mid_s16.val[0], two);
122 out = vmlaq_s16(out, vextq_s16(mid_s16.val[0], mid_s16.val[1], 1), four);
124 out = vmlaq_s16(out, vextq_s16(mid_s16.val[0], mid_s16.val[1], 2), two);
126 out = vaddq_s16(out, bot_s16.val[0]);
128 out = vmlaq_s16(out, vextq_s16(bot_s16.val[0], bot_s16.val[1], 1), two);
130 out = vaddq_s16(out, vextq_s16(bot_s16.val[0], bot_s16.val[1], 2));
132 vst1_u8(output.
ptr(), vqshrun_n_s16(out, 4));
unsigned int top
top of the border
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.
void configure(const ITensor *input, ITensor *output, bool border_undefined)
Set the source, destination and border mode of the kernel.
Container for 2D border size.
1 channel, 1 U8 per channel
Interface for Neon tensor.
Copyright (c) 2017-2021 Arm Limited.
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
Implementation of a rectangular access pattern.
bool update_window_and_padding(Window &win, Ts &&... patterns)
Update window and padding size for each of the access patterns.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Class to describe a number of elements in each dimension.
Implementation of a row access pattern.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
unsigned int left
left of the border
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Information about executing thread and CPU.
unsigned int num_elems_processed_per_iteration
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&... iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
BorderSize border_size() const override
The size of the border for that kernel.
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
constexpr size_t offset() const
Return the offset in bytes from the first element to the current position of the iterator.
Iterator updated by execute_window_loop for each window element.
Describe a multidimensional execution window.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)