43 _constant_value = constant_value;
47 ICpuKernel::configure(win);
59 bool has_collapsed =
true;
63 uint8_t *
const start_valid_region = inout->ptr_to_element(inout->info()->valid_region().anchor);
64 const auto window_width = static_cast<int>(collapsed.
x().
end()) - static_cast<int>(collapsed.
x().
start());
65 const size_t element_size = inout->info()->element_size();
70 Iterator tensor_it(inout, collapsed);
73 uint8_t *base_addr = start_valid_region + tensor_it.
offset();
75 for(
int i = 0; i < window_width; ++i)
77 std::memcpy(base_addr + i * element_size, &_constant_value.
value, element_size);
86 return "CpuFillKernel";
Class describing the value of a pixel for any image format.
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 ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Store the tensor's metadata.
Describe one of the image's dimensions with a start, end and step.
Copyright (c) 2017-2021 Arm Limited.
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Window collapse_if_possible(const Window &full_window, size_t first, size_t last, bool *has_collapsed=nullptr) const
Collapse the dimensions between first and last if possible.
Class to describe a number of elements in each dimension.
const char * name() const override
Name of the kernel.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
void configure(const ITensorInfo *tensor, const PixelValue &constant_value)
Configure kernel for a given list of arguments.
union arm_compute::PixelValue::@0 value
Union which describes the value of a pixel for any image format.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
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.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
#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...
constexpr size_t offset() const
Return the offset in bytes from the first element to the current position of the iterator.
constexpr int end() const
Return the end of the dimension.
Iterator updated by execute_window_loop for each window element.
constexpr int start() const
Return the start of the dimension.
Describe a multidimensional execution window.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
constexpr const Dimension & x() const
Alias to access the first dimension of the window.