kenba/opencl3

One question related to provided example

Closed this issue · 2 comments

Hello,

I was going through example provided here and noticed buffer x, y are created with flag CL_MEM_WRITE_ONLY while z created with flag CL_MEM_READ_ONLY, although in kernel z is the one buffer which is being modified. I also checked how arguments to kernel are set here. Finally I noticed one copy back to host which just reads from buffer z.

I was hoping to see it as below

x, y -> CL_MEM_READ_ONLY
z -> CL_MEM_WRITE_ONLY

following OpenCL specification's first three rows of Table 12.

Am I missing something @kenba ?

kenba commented

Well spotted Anjan!

I have indeed got the CL_MEM_WRITE_ONLY and CL_MEM_READ_ONLY flags the wrong way round. I'm surprised that it worked!
I shall fix them in basic.rs and in integration_test.rs.

Thanks
Ken

I'm surprised that it worked!

Yes, I also wrote one similar kind of example and it worked fine for me.

I shall fix them in basic.rs and in integration_test.rs.

Thanks @kenba

I'm closing this issue.