Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
Alcantara 等人展示了一种用于在图形处理器。我相信该实现是作为 CUDPP 的一部分提供的。
也就是说,您可能需要重新考虑最初选择的哈希表。按键对数据进行排序,然后集体执行大量查询应该会在大规模并行设置中产生更好的性能。您想解决什么问题?
Alcantara et al have demonstrated a data-parallel algorithm for building hash tables on the GPU. I believe the implementation was made available as part of CUDPP.
That said, you may want to reconsider your original choice of a hash table. Sorting your data by key and then performing lots of queries en masse should yield much better performance in a massively parallel setting. What problem are you trying to solve?
当我编写 OpenCL 内核来为字符串创建简单的哈希表时,我使用了 Java 的 String.hashCode(),然后将其修改为表中的行数以获得行索引。
哈希函数
索引
当然,我手动处理了冲突,当我提前知道字符串的数量时,这种方法效果很好。
When I wrote an OpenCL kernel to create a simple hash table for strings, I used the hash algorithm from Java's String.hashCode(), and then just modded that over the number of rows in the table to get a row index.
Hashing function
Indexing
I handled collisions manually of course, and this approach worked well when I knew the number of strings ahead of time.