You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't know if this feature already exists but do unordered_maps support structures other than <int,int> like <int,stdgpu::unordered_set>. Similarly can unordered_set support <pair<int,int>> using a hashing function from boost::hash<pair<int, int>> or vectors using your own hashing function for vectors.
This library is excellent btw! Solves so many issues with support for STL like containers for GPU :)
The text was updated successfully, but these errors were encountered:
Yes, in principle arbitrary types for the Key and T types of stdgpu::unordered_map container (stdgpu::unordered_setlikewise) are supported. int, int is just one very simple choice in the examples. You can use any type with the corresponding hash function. The only requirement is that the hash function is callable both on the host and the device, i.e. it should have the __host__ __device__ attribute for CUDA code or the portable STDGPU_HOST_DEVICE version.
Nesting containers, i.e. stdgpu::unordered_map<int, stdgpu::unordered_map<int, float>, is not prohibited, but not fully supported as in the C++ standard library due to the more complicated memory handling for GPU code. stdgpu::unordered_map<thrust::pair<int, int>, float> might be better in such cases.
Don't know if this feature already exists but do unordered_maps support structures other than <int,int> like <int,stdgpu::unordered_set>. Similarly can unordered_set support <pair<int,int>> using a hashing function from boost::hash<pair<int, int>> or vectors using your own hashing function for vectors.
This library is excellent btw! Solves so many issues with support for STL like containers for GPU :)
The text was updated successfully, but these errors were encountered: