QPL filter for varied input (> 1 byte, string, float, etc)
raunaks13 opened this issue · 2 comments
Hi,
I had a question regarding filtering in QPL. The example code for scan shows how to filter single-byte data (i.e., each element in the source vector is uint8_t).
qpl_job *job = reinterpret_cast<qpl_job *>(job_buffer.get());
job->next_in_ptr = source.data();
job->available_in = static_cast<uint32_t>(source.size());
job->next_out_ptr = destination.data();
job->available_out = static_cast<uint32_t>(destination.size());
job->op = qpl_op_scan_range;
job->src1_bit_width = input_vector_width;
job->num_input_elements = static_cast<uint32_t>(source.size());
job->out_bit_width = qpl_ow_32; // set output bit width
job->param_low = lower_boundary;
job->param_high = upper_boundary;
For instance, job->next_in_ptr expects a pointer to a vector of type uint8_t (range 0 to 255 in decimal), so using a vector of type uint32_t for source gives a compilation error.
On setting the input vector width to 32 bits and casting the input/output pointers to type uint8_t, the code compiles but the filter qpl operation returns an error with status code 232.
Is it possible to run filtering on multibyte data (e.g. uint32_t) and on data like date/time, strings, floats, etc? It would be great if you could share a simple example.
On setting the input vector width to 32 bits and casting the input/output pointers to type uint8_t, the code compiles but the filter qpl operation returns an error with status code 232.
Hi @raunaks13 , this seems like a correct approach to me.
The input/output buffers are simply raw buffers of data of type uint8_t *
. But you could use different bit width to specify the element size.
Could you make sure you also updated the number of input elements appropriately when you changed the input bit width?
If this still doesn't work, please provide a reproducer for us to work with.
Closing as no response from the user, please feel free to re-open if needed.