Argument of type __local int[5] rejected

Argument of type __local int[5] rejected

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.

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

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

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya