24 #define ARM_COMPUTE_CL 63 std::cout <<
"Usage: ./build/cl_convolution [input_image.ppm]\n\n";
64 std::cout <<
"No input_image provided, creating a dummy 640x480 image\n";
105 const std::string output_filename = std::string(argv[1]) +
"_out.ppm";
115 int main(
int argc,
const char **argv)
Basic function to execute convolution of size 3x3.
bool is_open()
Return true if a PPM file is currently open.
void configure(ICLTensor *input, ICLTensor *output, const int16_t *conv, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value=0)
Initialize the function's source, destination, conv and border_mode.
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.
void fill_image(T &image)
Fill an image with the content of the currently open PPM file.
void run() override
Run the kernels contained in the function.
void default_init()
Initialises the context and command queue used by the scheduler to default values and sets a default ...
int main(int argc, const char **argv)
Main program for convolution test.
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 main_cl_convolution(int argc, const char **argv)
const int16_t gaussian5x5[]
Gaussian 5x5 matrix.
void sync()
Blocks until all commands in the associated command queue have finished.
int run_example(int argc, const char **argv, example &func)
Run an example and handle the potential exceptions it throws.
Basic function to execute square convolution.Currently it supports 5x5, 7x7, 9x9. ...
const int16_t gaussian3x3[]
Gaussian 3x3 matrix.
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.
void configure(ICLTensor *input, ICLTensor *output, const int16_t *conv, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value=0)
Initialize the function's source, destination, conv and border_mode.
Borders are left undefined.
void init(const TensorInfo &input)
Initialize a tensor based on the passed TensorInfo.
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.
Basic implementation of the OpenCL tensor interface.