The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: CL code failed when access twice in a function

Have you checked whether any function calls return an error code? Have you passed a notify function to clCreateContext()?

This looks like a page fault due to an invalid memory access. Do what I suggested above and also double-check that the values from fList[nIndex].vIndexX are in range. You could, for example, do something like this:

... Im not sure that I've covered all of the cases for testing, but the above tests made me pretty sure that there're nothing wrong with the indices. Moreover, I have checking results for each step in the C++ code:

Re: CL code failed when access twice in a function

I still think it would be a good idea to try passing a notify function pointer to clCreateContext() instead of NULL.

That said, from your investigation it looks like you've found a compiler bug. If you can reduce the kernel code to less lines of code and send it to the OpenCL vendor you are using, I'm sure they would appreciate it and try to fix the problem.

Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.