我正在尝试使用 AVX 编写硬件加速哈希表,其中每个存储桶都有固定大小(AVX 向量大小)。问题是如何实现向量的快速搜索。
不完整的可能解决方案:
example target hash: 2
<1 7 8 9 2 6 3 5> // vector of hashes
<2 2 2 2 2 2 2 2> // mask vector of target hash
------------------------ // equality comparison
<0 0 0 0 -1 0 0 0> // result of comparison
<0 1 2 3 4 5 6 7> // vector of indexes
------------------------ // and operation
<0 0 0 0 4 0 0 0> // index of target hash …Run Code Online (Sandbox Code Playgroud)