Results 1 to 3 of 3

Thread: Buffer Strategy

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    6

    Buffer Strategy

    I'm starting my second project using openCL and am curious about others opinions and experience with buffer size. Here is my question. For kernels that use small amounts of input data and as a result might require many kernel calls from the host, is it worth it to set up a "managed buffer" system that packs the data into larger buffers and handles fragmentation, etc..? This might allow me to process a large number of items without alot of buffer changes. Or in general is it better to just create alot of smaller buffers as needed? I understand this is a very general question. Thanks.

  2. #2
    Junior Member
    Join Date
    Jan 2011
    Posts
    29

    Re: Buffer Strategy

    The trade-off is that if the composite buffers are too large, the implementation might have trouble placing them in device memory, leading to stalls while other data is shuffled to the host. On the other hand, if there is a large number of small buffers, the overhead of managing them might be higher than necessary.

  3. #3
    Junior Member
    Join Date
    Apr 2012
    Posts
    6

    Re: Buffer Strategy

    Thanks for the reply. Am I correct in assuming it's roughly the equivalent of VBO's in openGL? My understanding(and I'm no expert) of buffers in openGL is that there is always some overhead associated with switching them, and it is almost always faster to execute calls with a few large VBO's as opposed to a bunch of small ones. I guess the thing to do would be run some test cases with various buffer sizes vs. number of buffers. I was thinking someone might have done this already and might share their results. Thanks again.

Similar Threads

  1. opencl buffer from premade opengl buffer
    By MohamedSakr in forum OpenCL
    Replies: 0
    Last Post: 11-21-2012, 03:42 PM
  2. How does a color buffer and a vertex buffer fit together?
    By xkrja in forum Developers Coding:Beginner
    Replies: 1
    Last Post: 02-25-2011, 06:11 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
  •