Reading the OpenCL documentation, I know that the access qualifiers read_only
and write_only
are intended for image memory.
However, I'm noticing some people use these qualifiers on regular, non-image-memory, parameters, e.g.:
void foo(unsigned n, __global read_only int* data)
Note the lack of const
.
My questions:
read_only
imply, in particular, const
?read_only
imply anything other than const
? Something else that an OpenCL compiler can utilize?... or is it just meaningless for non-image-memory, and ignored?
With recent CUDA versions, OpenCL compilation rejects such uses of read_only
, with the message:
error: access qualifier can only be used for pipe and image type
so - I suppose this means that read_only
isn't really meaningful for non-images. Just use const
and forget about it.