24 #define ARM_COMPUTE_CL 43 CLImage src, scale_median, median_gauss, dst;
50 std::cout <<
"Usage: ./build/cl_convolution [input_image.ppm]\n\n";
51 std::cout <<
"No input_image provided, creating a dummy 640x480 image\n";
100 scale_median.
unmap();
101 median_gauss.
unmap();
112 const std::string output_filename = std::string(argv[1]) +
"_out.ppm";
123 int main(
int argc,
const char **argv)
void configure(ICLTensor *input, ICLTensor *output, BorderMode border_mode, uint8_t constant_border_value=0)
Initialise the function's source, destinations and border mode.
bool is_open()
Return true if a PPM file is currently open.
ITensorAllocator * allocator()
Return a pointer to the tensor's allocator.
TensorInfo * info() const override
Interface to be implemented by the child class to return the tensor's metadata.
Output values are defined to match the source pixel whose center is nearest to the sample position...
void run() override
Run the kernels contained in the function.
void fill_image(T &image)
Fill an image with the content of the currently open PPM file.
Basic function to run CLScaleKernel.
void map(bool blocking=true)
Enqueue a map operation of the allocated buffer.
void default_init()
Initialises the context and command queue used by the scheduler to default values and sets a default ...
size_t dimension(size_t index) const
Return the size of the requested dimension.
static CLScheduler & get()
Access the scheduler singleton.
virtual void allocate()=0
Interface to be implemented by the child class to allocate the tensor.
void open(const std::string &ppm_filename)
Open a PPM file and reads its metadata (Width, height)
void sync()
Blocks until all commands in the associated command queue have finished.
Basic function to execute gaussian filter 5x5.
int run_example(int argc, const char **argv, example &func)
Run an example and handle the potential exceptions it throws.
Class to load the content of a PPM file into an Image.
void init_image(T &image, Format format)
Initialise an image's metadata with the dimensions of the PPM file currently open.
Pixels outside the image are assumed to have the same value as the closest image pixel.
void init(const TensorInfo &input)
Initialize a tensor based on the passed TensorInfo.
void run() overridefinal
Run the kernels contained in the function.
void save_to_ppm(T &tensor, const std::string &ppm_filename)
Template helper function to save a tensor image to a PPM file.
Store the tensor's metadata.
void run() overridefinal
Run the kernels contained in the function.
void unmap()
Enqueue an unmap operation of the allocated and mapped buffer.
void configure(ICLTensor *input, ICLTensor *output, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value=0)
Initialize the function's source, destination, interpolation type and border_mode.
Basic implementation of the OpenCL tensor interface.