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: LLVM compilation failure -- why?

The error I can see here is the declaration one of your parameters: const uint *filter.
Pointer argument always must point to address space global, local, or constant. So try with: constant uint *filter.

Re: LLVM compilation failure -- why?

This looks like a known bug in 10.6.0/10.6.1 with indexing into constant arrays with a variable index. I'm afraid there's no work-around except to move your data out of the constant space until Apple fixes it.

Re: LLVM compilation failure -- why?

Replaced const uint *filter with global uint *filter, same error. I think there's something more fundamental and buggy going on here. Otherwise, why would the code compile the second section -- uint val accessing an element in global space (img) and multiplying by an element in global space (filter), when the code in the first section fails-- uint buggy accessing an element in private space (imgCache) and multiplying by an element in global space (filter).

I did want to rely on the global memory in img being cached by the card, but the GeForce 8600M GT has no global cache. So I figured that I would be clever and copy the part of img that I needed into private space, but noooooooo....

Re: LLVM compilation failure -- why?

Or, and I'm just guessing here, maybe there's a problem with variable arrays on the stack. When the line is in, the array is accessed, which causes the compiler to blow up. When the line is out, the compiler can optimize the array access out, which causes the compiler to not allocate the array on the stack, so it compiles OK....?

Re: LLVM compilation failure -- why?

Indeed, that was the case. I replaced the variable array with a fixed-size array, and that worked. And, I didn't know that until I did a search for "arrays" in the standard and discovered in section 6.8 (Restrictions):

Re: LLVM compilation failure -- why?

Re: LLVM compilation failure -- why?

That may or may not be a failure in Apple's compiler, actually. LLVM is usually really good about telling you what failed and where. If you get less descriptive errors it may be because LLVM generated code and passed it on to the GPU vendor's compiler which choked on it. That tends to get reported back in a less-than-helpful manner as some generic failure.