30 using namespace utils;
32 class NEONScaleExample :
public Example 35 void do_setup(
int argc,
char **argv)
override 42 std::cout <<
"Usage: ./build/neon_scale[input_image.ppm]\n\n";
43 std::cout <<
"No input_image provided, creating a dummy 640x480 image\n";
53 constexpr
int scale_factor = 2;
55 TensorInfo dst_tensor_info(
src.info()->dimension(0) / scale_factor,
src.info()->dimension(1) / scale_factor,
65 src.allocator()->allocate();
72 output_filename = std::string(argv[1]) +
"_out.ppm";
75 void do_run()
override 80 void do_teardown()
override 83 if(!output_filename.empty())
92 std::string output_filename{};
100 int main(
int argc,
char **argv)
102 return utils::run_example<NEONScaleExample>(argc, argv);
void fill_image(T &image)
Fill an image with the content of the currently open PPM file.
void save_to_ppm(T &tensor, const std::string &ppm_filename)
Template helper function to save a tensor image to a PPM file.
ITensorAllocator * allocator()
Return a pointer to the tensor's allocator.
1 channel, 1 U8 per channel
Output values are defined to match the source pixel whose center is nearest to the sample position...
Basic function to run NEScaleKernel.
This file contains all available output stages for GEMMLowp on OpenCL.
void open(const std::string &ppm_filename)
Open a PPM file and reads its metadata (Width, height)
bool is_open()
Return true if a PPM file is currently open.
Structure to hold Image information.
virtual void allocate()=0
Interface to be implemented by the child class to allocate the tensor.
int main(int argc, char **argv)
Main program for convolution test.
Borders are left undefined.
void init(const TensorInfo &input)
Initialize a tensor based on the passed TensorInfo.
Store the tensor's metadata.
void init_image(T &image, arm_compute::Format format)
Initialise an image's metadata with the dimensions of the PPM file currently open.
convolution configure & src
Class to load the content of a PPM file into an Image.