51 if(dst->total_size() != 0)
60 std::pair<Status, Window> validate_and_configure_window(
const ITensorInfo *src, ITensorInfo *dst)
67 std::pair<Status, Window> validate_and_configure_window_with_padding(
const ITensorInfo *src, ITensorInfo *dst,
const PaddingList &padding)
69 const TensorShape src_shape = src->tensor_shape();
74 return std::make_pair(Status{}, win);
86 std::pair<Status, Window> win_config;
89 win_config = validate_and_configure_window(src, dst);
93 win_config = validate_and_configure_window_with_padding(src, dst, padding);
97 ICpuKernel::configure(win_config.second);
127 Window dst_window{ window };
137 memcpy(dst_it.
ptr(), src_it.
ptr(), dst->info()->dimension(0) * dst->info()->element_size());
141 while(dst_window.slide_window_slice_1D(out_slice));
145 Window src_window{ window };
150 const size_t row_size_in_bytes = src->info()->dimension(0) * src->info()->element_size();
153 auto dst_ptr = dst_it.
ptr() + _padding[0].first * dst->info()->element_size();
154 std::memcpy(dst_ptr, src_it.
ptr(), row_size_in_bytes);
162 return "CpuCopyKernel";
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.
std::vector< PaddingInfo > PaddingList
List of padding information.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
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.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const PaddingList &padding=PaddingList())
Static function to check if given info will lead to a valid configuration of CpuCopyKernel.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
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 std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
TensorShape compute_padded_shape(const TensorShape &input_shape, const PaddingList &padding)
Calculate the padded shape of a tensor.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
Information about executing thread and CPU.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Status validate_arguments(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, const GEMMLowpOutputStageInfo *output_stage)
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
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...
void configure(const ITensorInfo *src, ITensorInfo *dst, const PaddingList &padding=PaddingList())
Configure kernel for a given list of arguments.
constexpr int end() const
Return the end of the dimension.
Iterator updated by execute_window_loop for each window element.
Describe a multidimensional execution window.
const char * name() const override
Name of the kernel.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Window first_slice_window_1D() const
First 1D slice of the window.
constexpr const Dimension & x() const
Alias to access the first dimension of the window.