Results 1 to 4 of 4

Thread: 2D Subbuffer

  1. #1
    Newbie
    Join Date
    May 2013
    Posts
    3

    2D Subbuffer

    Hi,

    I need to use OpenCL subbuffers but it seems that OpenCL does not allows to do 2D subbuffers?
    It only allows to do subbuffers with consecutive memory. Am I wrong?

    For instance,

    We can do 4 subbuffers: WWWWXXXXYYYYZZZZ

    But we cannot do 4 2D subbuffers:

    WWWW X X X X
    WWWW X X X X
    WWWW X X X X
    WWWW X X X X
    Y Y Y Y Z Z Z Z
    Y Y Y Y Z Z Z Z
    Y Y Y Y Z Z Z Z
    Y Y Y Y Z Z Z Z

    Thank you in advance

  2. #2
    Senior Member
    Join Date
    Oct 2012
    Posts
    165
    It is possible with clEnqueueReadBufferRect. To read 'w' only, origin should be (0,0,0), region should be (4*sizeof(w), 4,1) and buffer_row_pitch should be 8*sizeof(w). You can also map and/or copy a subbuffer the same way.

    For any further questions read 5.2.x of the spec

  3. #3
    Newbie
    Join Date
    May 2013
    Posts
    3
    Yes clint3112, you can update 2D regions of data with *Rect methods. But if you need to launch a kernel only onto a subregion, I suspect that you cannot create a 2D subbuffer

  4. #4
    Senior Member
    Join Date
    Oct 2012
    Posts
    165
    clCreateSubBuffer should do that, doesn't it?

Posting Permissions

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