A question about access modifier (ro, wo) for image object

I’ve learned that image object can be readonly or writeonly, but not read-write.
But is it allowed for programmer to change this access modifier between different kernels?
For example: there is 2 kernels A and B. B starts after A is finished. Is it correct for image object to be writeonly in A and readonly in B?

Yes, it is possible.
It is often the case when the image contains an intermediate result produced by kernel A and to be consumed by kernel B.

Thank you, utnapishtim!

There are the flags you use when you create the image object, and there are the qualifiers you give when you pass it to a kernel. Allocate it using read/write, and then pass it as write for kernel A, and pass it as read for kernel B.

Dithermaster, thanks for your reply.

Everything works fine.
Thank for information, guys.