Results 1 to 2 of 2

Thread: Keep data on device / fetch interim results from device

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    29

    Keep data on device / fetch interim results from device

    Hello folks!

    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?

    Thank you!

  2. #2
    Senior Member
    Join Date
    Aug 2011
    Posts
    271

    Re: Keep data on device / fetch interim results from device

    The only synchronisation points possible is at kernel invocation boundaries.

    i.e. you have to call the kernel multiple times and read out in between.

    If you're only reading data back to monitor it you only need to read what you're after, you don't need to copy the whole data buffer back; and it all stays on the device anyway.

    You can use event callbacks or threads to avoid having to make this synchronous.

Similar Threads

  1. Transferring Data from Host to Device
    By abhishekray07 in forum OpenCL
    Replies: 1
    Last Post: 02-02-2012, 02:48 AM
  2. Data not copied from host to device
    By krit in forum OpenCL
    Replies: 5
    Last Post: 10-13-2011, 02:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •