c++ - Computing size of symmetric difference of two sorted arrays using SIMD AVX -
i looking way optimize algorithm working on. it's repetitive , compute-intensive part comparison of 2 sorted arrays of size, containing unique unsigned integer (uint32_t
) values in order obtain size of symmetric difference of them (number of elements exist in 1 of vectors). target machine on algorithm deployed uses intel processors supporting avx2, therefore looking way perform in-place using simd.
is there way exploit avx2 instructions obtain size of symmetric difference of 2 sorted arrays of unsigned integers?
since both arrays sorted should easy implement algorithm using simd (avx2). need iterate through 2 arrays concurrently, , when mismatch when comparing 2 vectors of 8 ints need resolve mismatch, i.e. count differences, , 2 array indices in phase, , continue until end of 1 of arrays. add no of remaining elements in other array, if any, final count.
Comments
Post a Comment