cogciprocate / ocl

OpenCL for Rust
Other
731 stars 75 forks source link

Hash impl for OpenCL objects #136

Closed dmarcuse closed 5 years ago

dmarcuse commented 5 years ago

It would be convenient if OpenCL objects had an implementation for Hash, to support uses like HashSet<Device>. It should be pretty trivial to implement, just writing the pointer of the object to the Hasher.

c0gent commented 5 years ago

Sounds good to me.

dmarcuse commented 5 years ago

Should I implement this in a PR?

c0gent commented 5 years ago

Sure if you'd like.

I'd probably just start by implementing it for DeviceId (and PlatformId, etc. if you want). Then you can just derive it on the higher level types.