- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code fails to compile with the 2013 beta on Linux:
void bar(__local int baz[5]) {}
__kernel void foo() {}
with the message
arrayqual.cl:1:22: error: parameter may not be qualified with an address space
According to C99: "A declaration of a parameter as ‘‘array of type’’ shall be adjusted to ‘‘qualified pointer to type’’, where the type qualifiers (if any) are those specified within the [ and ] of the array type derivation." Thus, the parameter to bar ought to be treated as __local int *, which is legal. The same error occurs if no size is provided.
For comparison, the NVIDIA and AMD OpenCL implementations both allow this.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The OpenCL spec says "Pointers to the __local address space are allowed as arguments to functions (including kernel functions)." and as you already pointed out, according to C99 spec says that the adjustment should be made. I did verify that this kernel fails on the CPU (windows) but compiles on the gpu.
I will file a bug and keep you updated. Thanks for bringing this up.
Raghu

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page