3

The align requirement seems to render at least the region part of this functionality almost completely useless. Could anyone give me an example of when to create a sub-buffer from a region of a buffer?

And am I right that I can create a readonly or writeonly sub-buffer from a read-write buffer? If I can, will I benefit from this read/writeonly reference to a actually read-write buffer?

1 Answer 1

4

The purpose is to allow different parts of a buffer to be independently updated. One example would be if you want different devices to update different parts of your data structure. Rather than copying regions into new buffers, passing to devices, getting data back and remerging you can create sub-buffers and pass those to the devices.

You can create a read-write sub-buffer though. clCreateSubBuffer allows CL_MEM_READ_WRITE.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.