I'm compiling a Func to a static library, and using it in a C program. I'm getting a message saying: Output buffer f20 has type int32 but elem_size of the buffer passed in is 1 instead of 4. I can't figure out what I'm doing wrong in this case. Here's the Func:
Var x, y, c;
Func out;
out(c, x, y) = cast<uint8_t>(255);
If I understand correctly, the resolved output type should be uint8_t. Here's how I'm creating my buffer in the C program:
buffer_t buffer;
buffer.extent[0] = 4;
buffer.extent[1] = width;
buffer.extent[2] = height;
buffer.elem_size = 1;
buffer.host = data;
buffer.stride[0] = 1;
buffer.stride[1] = 4;
buffer.stride[2] = stride;
fill_buffer(&buffer);
The buffer truly contains uint8_t values and I'm setting the elem_size to 1 so I don't understand how to make halide use it as 8 bit values..