I have 2 functions that operates on an image,
the first transfers work-groups to local memory then does the compute and writes result back to global memory, the second takes the global result and computes it, this works just fine.
Now, when I pass the local buffer of the first function to the second,(instead of global buffers), it doesn’t work. below the pseudo code for the algorithm
inline void func1(__global unsigned int *datain,
int width, int height, ,
__local unsigned int *LocalData)
{
LocalData[get_local_id(1)get_local_size(0)+ get_local_id(0)] = datain[get_global_id(1)(width) + get_global_id(0)] * A;
}
inline void func2( int width, int height,
__global unsigned int *dataout,
__local unsigned int *LocalData)
{
dataout[get_global_id(1)*(width) + get_global_id(0)] = LocalData[get_local_id(1)*get_local_size(0)+ get_local_id(0)] * B;
}
__kernel void Main(__global unsigned int *datain, int width, int height,
__global unsigned int *dataout,
__local unsigned int *LocalData)
{
func1(datain, width, height, LocalData);
func2(width, height, dataout, LocalData);
}
Hope it’s clear enough