24.02.1
|
Go to the documentation of this file.
52 if (
dst->total_size() != 0)
69 std::pair<Status, Window>
70 validate_and_configure_window_with_padding(
const ITensorInfo *
src, ITensorInfo *
dst,
const PaddingList &padding)
72 const TensorShape src_shape =
src->tensor_shape();
77 return std::make_pair(Status{}, win);
89 std::pair<Status, Window> win_config;
96 win_config = validate_and_configure_window_with_padding(
src,
dst, padding);
100 ICpuKernel::configure(win_config.second);
116 validate_and_configure_window_with_padding(
src->clone().get(),
dst->clone().get(), padding).first);
131 if (_padding.empty())
145 { memcpy(dst_it.
ptr(), src_it.
ptr(),
dst->info()->dimension(0) *
dst->info()->element_size()); },
147 }
while (dst_window.slide_window_slice_1D(out_slice));
157 const size_t row_size_in_bytes =
src->info()->dimension(0) *
src->info()->element_size();
162 auto dst_ptr = dst_it.
ptr() + _padding[0].first *
dst->info()->element_size();
163 std::memcpy(dst_ptr, src_it.
ptr(), row_size_in_bytes);
171 return "CpuCopyKernel";
SimpleTensor< float > src
std::vector< PaddingInfo > PaddingList
List of padding information.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
const char * name() const override
Name of the kernel.
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
Window first_slice_window_1D() const
First 1D slice of the window.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
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.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
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...
Iterator updated by execute_window_loop for each window element.
#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...
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *src, ITensorInfo *dst)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Describe one of the image's dimensions with a start, end and step.
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.
const Window & window() const
The maximum window the kernel can be executed on.
Information about executing thread and CPU.
Describe a multidimensional execution window.
Copyright (c) 2017-2024 Arm Limited.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
Store the tensor's metadata.
void configure(const ITensorInfo *src, ITensorInfo *dst, const PaddingList &padding=PaddingList())
Configure kernel for a given list of arguments.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
@ UNKNOWN
Unknown data type.
constexpr int end() const
Return the end of the dimension.
constexpr const Dimension & x() const
Alias to access the first dimension of the window.