We're trying to compare two equally sized native arrays of signed int
values using inequality operations, <, <=, > and >=, in a high performance way. As many values are compared, the true/false
results would be sotred in a char
array of the same size of the input, where 0x00
means false
and 0xff
means true
.
To accomplish this, we're using the Intel IPP library. The problem is that the function we found that does this operation, named ippiCompare_*
, from the images and video processing lib, supports only the types unsigned char
(Ipp8u
), signed/unsigned short
(Ipp16s/Ipp16u
) and float
(Ipp32f
). It does not directly support signed int
(Ipp32s
)
I (only) envision two possible ways of solving this:
Casting the array to one of the directly supported types and executing the comparison in more steps (it would became a short array of twice the size or a char array of four times the size) and merging intermediate results.
Using another function directly supporting
signed int
arrays from IPP or from another library that could do something equivalent in terms of performance.
But there may be other creative ways... So I ask you're help with that! :)
PS: The advantage of using Intel IPP is the performance gain for large arrays: it uses multi-value processor functions and many cores simultaneously (and maybe more tricks). So simple looped solutions wouldn't do it as fast AFAIK.
PS2: link for the ippiCompare_* doc