Thanks for an excellent answer!
My only attempt was without synchronization as I forgot about the async nature of cuda and I ended up moving on.
NaN values should not be an issue in this case.
Thanks as well for the explanation, super helpful.
Once I have more time I will try to test the difference in runtime on the project and give an update in this thread.