It seems to me that this has has a race condition between function return (failed going out of scope) and cudaMemcpyAsync completing. Is this the case? If not, what is causing synchronization of the memcpy before function return?
There are several other similar examples to this in Synchronizer.
Thanks for any comment on this "maybe not an issue but just a question about code" issue :)
I'm considering adding TensorFlow bindings to persistent-rnn, and I've been reading the codebase for my own understanding.
In https://github.com/baidu-research/persistent-rnn/blob/master/include/prnn/detail/rnn/synchronizer.h#L86
It seems to me that this has has a race condition between function return (
failed
going out of scope) andcudaMemcpyAsync
completing. Is this the case? If not, what is causing synchronization of the memcpy before function return? There are several other similar examples to this inSynchronizer
.Thanks for any comment on this "maybe not an issue but just a question about code" issue :)