admin管理员组文章数量:1336079
I am trying to move away from OpenCL and CUDA into ArrayFire. One of my functions uses the GPU's popcount() to make pre-processing data easier. But I can't find it anywhere in the list of functions in ArrayFire.
OpenCL has popcount, CUDA has popc, and there is the builtin_popcount for CPU work. Where the heck is the function in ArrayFire? I see count() and count_all() but those are for the element count of the array not the bits in an element (as far as I can tell).
Am I missing something or is this just a feature not implemented in the library? I feel like it is a pretty important function and expected it to be with the bitwise manipulation functions.
I was expecting some function with the ability to tell me the count of 1s in an integer. I honestly would like to leverage the optimization features of the library, but without this it is impossible.
Yes, I can write my own. No I don't want to do it. I want to use the architecture optimized implementations provided by the hardware vendor on the CPUs/GPUs.
I am trying to move away from OpenCL and CUDA into ArrayFire. One of my functions uses the GPU's popcount() to make pre-processing data easier. But I can't find it anywhere in the list of functions in ArrayFire.
OpenCL has popcount, CUDA has popc, and there is the builtin_popcount for CPU work. Where the heck is the function in ArrayFire? I see count() and count_all() but those are for the element count of the array not the bits in an element (as far as I can tell).
Am I missing something or is this just a feature not implemented in the library? I feel like it is a pretty important function and expected it to be with the bitwise manipulation functions.
I was expecting some function with the ability to tell me the count of 1s in an integer. I honestly would like to leverage the optimization features of the library, but without this it is impossible.
Yes, I can write my own. No I don't want to do it. I want to use the architecture optimized implementations provided by the hardware vendor on the CPUs/GPUs.
Share Improve this question asked Nov 21, 2024 at 3:50 Ben HBen H 393 bronze badges1 Answer
Reset to default 1Well I will answer my own question.
There is not one.
I looked through the repo, yes they use popc and popcount (CUDA and OpenCl) for the nearest_neighbour. But it is not used anywhere else. So it is not implemented.
Now I have a few choices; use the custom kernel, fork their code and make my own, or abandon this folly and move on.
I will probably try the custom kernel. If it fails I will switch back to OpenCL and CUDA.
本文标签: cDoes ArrayFire have a popcount or bitcount functionStack Overflow
版权声明:本文标题:c++ - Does ArrayFire have a popcount or bitcount function? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742315067a2451650.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论