bubu

inside-kernel __local defined variables

Discussion created by bubu on Apr 24, 2011
Latest reply on Apr 25, 2011 by nou

Is optimal to declare local memory in this way inside a kernel to avoid passing local memory pointers as kernel args, pls? I have the impression that __local variable arrays are mapped to global memory

 

thx

__kernel void MyKernel ( __global float4 *result ) { __local int a[128], b; __local float c[384]; /* ... do some operations with a, b, c and output result */ } vs __kernel void MyKernel ( __global float4 *result, __local int *a, __local int *b, __local float *c ) { /* ... do some operations with a, b, c and output result */ }

Outcomes