cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

dezirus
Journeyman III

OpenCL access qualifiers

Why aren't there access qualifiers like read_only, write_only for OpenCL buffers like there are for images? On the other hand, if CL_MEM flags can specify whether a memory object is read-only or write-only, why do we use access qualifiers for images? Can access qualifiers overwrite CL_MEM flags?

0 Likes
2 Replies

An image can be read only or write only and not both. A buffer however is both by default and is only marked as read-only with a 'const' qualifier.

However, the spec does not mention that it is illegal to use read_only / write_only with buffers. Is it illegal? Should the compiler report an error if I declare a _global read_only buffer inside a kernel?

0 Likes