Results 1 to 3 of 3

Thread: Displaying data from OpenCL with OpenGL

  1. #1
    Junior Member
    Join Date
    Dec 2010

    Displaying data from OpenCL with OpenGL


    I have some computing project written in OpenCL, kernel calculates solution of the system (2D) until stabilized.
    Now, I want to show those steps in a window.
    My advisor told me to allocate texture in GPU memory, than copy data from vector to texture in a kernel and before next kernel execution display this texture.
    Is this the simplest way to do this or you have any other ideas ?
    (I don't want to rewrite whole project, just add this upgrade. I know that this probably isn't most optimal solution, but it will serve only demonstration purpose).

    Does Nvidia SDK or ATI SDK, have some code which can help me with it?
    Or maybe you know any tutorial which may be helpful?
    I will probably learn OpenGL in the future but know I want to just use it in the simplest way.


  2. #2

    Re: Displaying data from OpenCL with OpenGL

    simplest way might be to use an available printf implementation and just print numbers/characters to a console.

    Otherwise, depends on the data. if you have 2 dimensions of values, you could write the buffer to an image (write_imagef(...) or similar) and save each frame to disk (read it in and export a bmp with frame number, not too involved). If you want to see it interactively, you might as well go the OpenGL interop route however.

  3. #3
    Senior Member
    Join Date
    May 2010
    Toronto, Canada

    Re: Displaying data from OpenCL with OpenGL

    I would not advise using the printf functionality to transfer data. printf is a feature for debugging only.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. Iphone: displaying text using OpenGL ES
    By papillon68 in forum OpenGL ES
    Replies: 0
    Last Post: 12-21-2008, 01:43 AM
  2. displaying a billboard in opengl es
    By chandru in forum OpenGL ES
    Replies: 1
    Last Post: 10-16-2005, 02:22 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
Proudly hosted by Digital Ocean