I’d like to pass a kernel progress bar (as an integer) to the host so that the host can print a progress bar while the kernel is still running.
I used the pinned memory, as suggested by others. It works really well on Linux, but fails every time on Windows.
Here is my source code:the host memory variable is *progress; it is mapped to the GPU memory gprogress, both declared as “volatile int”.
then, the kernel updates the gprogress pointer,
I could then use the “*progress” value on the host-side to create a progress bar
on a Windows 10 machine (cuda 8, 1050Ti+730GT), the “*progress” stays at 0, making my above loop never-ending. It was updated fine on Ubuntu Linux.
I even added “__threadfence system()” inside the kernel, but it did not help.
can some one take a quick look and let me know if there is anything wrong? thanks