Open dmarcuse opened 5 years ago
Yeah I think you might be right. I'd like to spend some time on this but I might not be able to for a while. I've been waiting for Pin
for about two years for some other async related stuff and I might try to do that first (add it to the todo list...).
If you end up playing around with it, let me know what you find.
Rust 1.33 was just released, and one of the new features is the
Pin<T>
type, which prevents a value from being moved in memory. This could be useful when using buffers with theCL_USE_HOST_PTR
flag. I think it could even be made 100% safe (on the Rust side of things at least) by also adding a lifetime restriction to theBuffer
itself so that the reference is forced to live at least as long as the underlying OpenCL buffer.