I am trying to use local shared type memory in opencl. I found an example here: http://www.ibm.com/developerworks/forums/t…sageID=14385403
I tried using this code, but I am stuck on a build error. “no matching overload found for arguments of type 'float attribute((address_space(3)))*, float attribute((address_space(1)))const , int attribute((address_space(1))), event_t”
Let me know if there are any ways to correct this problem and if anything is not clear. Here is my kernel below:
const char* OpenCLSource[] =
{
"__kernel void ConvolutionGPU(__global float* outputSignalArray, __global float* inputSignalArray, __global float* responseSignalArray, __global int* length)",
"{",
" unsigned int n = get_global_id(0);",
"event_t event = (event_t)0;",
" __local float* a; __local float* b; __local float* c;",
" event = async_work_group_copy (a, (__global const float*)&(inputSignalArray[n]), length, event);",
" event = async_work_group_copy (b, (__global const float*)&(responseSignalArray[n]), length, event);",
" event = async_work_group_copy (c, (__global const float*)&(outputSignalArray[n]), length, event);",
" wait_group_events (1, &event);",
" if(n < *length)",
" { ",
" float accumulator = 0.0f;",
" for(int j = 0; j < *length; j++)",
" {",
" accumulator += a[j] * b[(j+n) % (*length)];",
" }",
" c[n] = accumulator;",
" }",
"barrier(CLK_LOCAL_MEM_FENCE);",
" event = async_work_group_copy (outputSignalArray[n], (__local const float*)c, length, event);",
" wait_group_events (1, &event);",
"}"
};