46 struct ROIAlignSelectorData
61 static const ROIAlignKernel available_kernels[] =
65 [](
const ROIAlignSelectorData & data) {
return data.dt ==
DataType::F32; },
68 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 71 [](
const ROIAlignSelectorData & data) {
return data.dt ==
DataType::F16; },
74 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 75 #if defined(ARM_COMPUTE_ENABLE_NEON) 86 #endif //defined(ARM_COMPUTE_ENABLE_NEON) 95 const ROIAlignKernel *get_implementation(
const ROIAlignSelectorData &data)
97 for(
const auto &uk : available_kernels)
99 if(uk.is_selected(data))
107 Status validate_arguments(
const ITensorInfo *
input,
const ITensorInfo *rois, ITensorInfo *output,
const ROIPoolingLayerInfo &pool_info)
117 if(output->total_size() != 0)
128 const UniformQuantizationInfo rois_qinfo = rois->quantization_info().uniform();
142 : _input(nullptr), _output(nullptr), _rois(nullptr), _pool_info(0, 0, 0.f)
165 _pool_info = pool_info;
167 INEKernel::configure(window);
181 const auto *uk = get_implementation(ROIAlignSelectorData{ _input->
info()->
data_type() });
184 uk->ukernel(_input, _output, _rois, _pool_info, window, info);
const Window & window() const
The maximum window the kernel can be executed on.
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_LAYOUT_NOT_IN(t,...)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor)
#define REGISTER_FP16_NEON(func_name)
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
TensorShape compute_roi_align_shape(const ITensorInfo &input, const ITensorInfo &rois, ROIPoolingLayerInfo pool_info)
Calculate the output roi align shape of a tensor.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
#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.
1 channel, 1 F32 per channel
void neon_qs8_roialign(const ITensor *input, ITensor *output, const ITensor *rois, ROIPoolingLayerInfo pool_info, const Window &window, const ThreadInfo &info)
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
#define REGISTER_QASYMM8_SIGNED_NEON(func_name)
Store the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Describe one of the image's dimensions with a start, end and step.
quantized, asymmetric fixed-point 16-bit number
void neon_qu8_roialign(const ITensor *input, ITensor *output, const ITensor *rois, ROIPoolingLayerInfo pool_info, const Window &window, const ThreadInfo &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.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
ROIAlignUKernelPtr ukernel
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
#define REGISTER_QASYMM8_NEON(func_name)
void neon_fp16_roialign(const ITensor *input, ITensor *output, const ITensor *rois, ROIPoolingLayerInfo pool_info, const Window &window, const ThreadInfo &info)
virtual ITensorInfo & set_data_layout(const DataLayout &data_layout)=0
Set the data layout of the tensor.
quantized, asymmetric fixed-point 8-bit number unsigned
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 set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
Num samples, channels, height, width.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
void neon_fp32_roialign(const ITensor *input, ITensor *output, const ITensor *rois, ROIPoolingLayerInfo pool_info, const Window &window, const ThreadInfo &info)
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
Information about executing thread and CPU.
ROI Pooling Layer Information class.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Num samples, height, width, channels.
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
NEROIAlignLayerKernel()
Constructor.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
const ROIAlignSelctorPtr is_selected
quantized, asymmetric fixed-point 8-bit number signed
DataType
Available data types.
DataLayout
[DataLayout enum definition]
void configure(const ITensor *input, const ITensor *rois, ITensor *output, const ROIPoolingLayerInfo &pool_info)
Set the input and output tensors.
Describe a multidimensional execution window.
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
static Status validate(const ITensorInfo *input, const ITensorInfo *rois, ITensorInfo *output, const ROIPoolingLayerInfo &pool_info)
Static function to check if given info will lead to a valid configuration of NEROIAlignLayerKernel.