Closed yofufufufu closed 1 year ago
stdgpu::unordered_set
has similar requirements than std::unordered_set
. In particular, this means that stdgpu::hash
must be specialized for the desired type and that stdgpu::equal
must be able to use the type's operator==()
function. For your two examples, this means:
thrust::pair<int, int>
: Here, operator==()
is already defined and, hence, stdgpu::equal
will already work. However, stdgpu::hash
is not specialized which results in the error message you have received. Though, the message is unfortunately not that informative at the moment and could be improved to make this fact clearer.myStruct
: Here, you would have to define both functions to make this work.Thanks for your reply! Now I can use stdgpu::unordered_set<thrust::pair<int, int>>
with custom hash function.
Closing this issue as the issue has been resolved and further improvements to the less informative error message can be done in the future.
Hello, I'm new to this library. I wonder what should I do if I want to use something like
stdgpu::unordered_set<thrust::pair<int, int>>
orstdgpu::unordered_set<myStruct>
? Because when I try to usestdgpu::unordered_set<thrust::pair<int, int>>::createDeviceObject(n)
, the error occurred: