I’ve just cut and pasted that snippet into the top of my kernel, and compiled it fine for the CPU and GPU. I think that means the syntax is OK, but then I’m not actually accessing it so it’s probably optimised out.
I’ve also had that error from the SL compiler for the 8xxx series.
For me it seemed to be related to accessing arrays which were memory objects.
e.g. (heavily simplified):
kernel void particle(float * positions) {
float4 position = vload4(0, positions + i * 3);
I’m not sure if it’s the possible mis-aligned load that’s causing the problem, but I’d be interested to see if you have something similar.
This was in a context with shared OpenGL objects, on 10.6.1. Compiling for the CPU gives no problems. It may also be working in a non-shared context on the GPU, but I’m having other problem with that that may be clouding the issue.