selectively xor-ing elements of a list with AVX2 instructions

后端 未结 2 634
被撕碎了的回忆
被撕碎了的回忆 2021-01-21 04:20

I want to speed up the following operation with AVX2 instructions, but I was not able to find a way to do so.

I am given a large array uint64_t data[100000]

2条回答
  •  梦谈多话
    2021-01-21 04:33

    You can sort the data according to indices[i]... This should take O(N*log2(N)), but that can be parallelized.

    Then taking the cumulative xor of the sorted data -- which can be also parallelized.

    Then it's the matter of calculating Out[i] = CumXor(j) ^ Out[i-1];

提交回复
热议问题