-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resources can not be compared or used in containers #55
Comments
I’ll be happy to make this work. The two wrinkles to figure out:
1. Hashing of differently typed resources, presumably we want resources with the same initial number but different types to hash to different values.
2. Comparing resources: Do we want the “logical” result or the actual result. Meaning, if you put 10 in for one, 1000 in for another, but they happen to map to the same stream on the current scheme, should they compare the same? I’m not sure how I feel about it, in cuda I think they kinda should because it’s more representative of the cuda behavior. On OpenMP though the reverse is true. Thoughts?
…Sent from my iPhone
On Apr 27, 2021, at 9:45 PM, Jason Burmark ***@***.***> wrote:
Currently resources are not comparable of hashable so they can't be used as keys in unordered containers. It would also generally be useful if they were comparable so it would be possible to know if two represented the same resource, for example the same cuda stream.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://urldefense.us/v3/__https://github.com/LLNL/camp/issues/55__;!!G2kpM7uM-TzIFchu!k3w0eg3i2Auzjhn8BjsDlfoElHECbTW3AO8-dTDAK20Ng0nrtASdHeiG34pVRAe8cw$>, or unsubscribe<https://urldefense.us/v3/__https://github.com/notifications/unsubscribe-auth/AAFBFNPNBYUV7Z4V5UM7FB3TK6HETANCNFSM43WI7DCQ__;!!G2kpM7uM-TzIFchu!k3w0eg3i2Auzjhn8BjsDlfoElHECbTW3AO8-dTDAK20Ng0nrtASdHeiG34roup2MHw$>.
|
|
That seems like a good compromise to me. The hash we can probably hack together by just taking the number that goes in and ORing it with the shifted platform ID or something, since they have essentially unique numbers to begin with that would be a nearly-perfect hash essentially for free. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently resources are not comparable of hashable so they can't be used as keys in unordered containers. It would also generally be useful if they were comparable so it would be possible to know if two represented the same resource, for example the same cuda stream.
The text was updated successfully, but these errors were encountered: