A kernel calculates numerical solutions for differential equations. Now I need to store the results only for certain timesteps. What I want to do is to fetch interim results while the kernel does the calculations. To do so, I'm thinking of a kernel which can stop after a given amount of timesteps, transfer data to host and then fetch new data from host (each time only a few constants) and proceed where it stopped, until another given amount of timesteps elapsed.
Of course I could move ALL data from kernel to host, save interesting data, add a few constants and move ALL data from host to device and run the kernel and so on. But this would cost a lot of unnecessary time, as the interesting data is less than one percent of the data which has to be moved between host and devide.
I hope you understand my concern. I guess this should be possible in opencl, isn't it? How to do it?