How to convert Halide::Buffer<unsigned char> to c++ array

260 Views Asked by At

In lesson_02_input_image.cpp, I am trying to transpose Buffer<uint8_t> type data to a c++ array so that compare the time consumption between halide and c++. The code is like :

Halide::Buffer<uint8_t> input = load_image("images/rgb.png");
float *img = input.copy_to_device(halide_opencl_device_interface());

And the code got error:cannot convert ‘Halide::Buffer’ to ‘float*’ in initialization.It seems that input is Halide::Buffer type, how could I fix that?

0

There are 0 best solutions below