ID3/SumReduction.cl
2020-01-18 22:11:47 +05:30

13 lines
391 B
Common Lisp
Executable File

__kernel void sumReduction(__global int *A, __global int* C, int offset)
{
int global_id = get_global_id(0);
//if(get_global_size(0) < 5)
// printf("Thread id = %d", global_id);
int start = global_id * offset;
int end = start + offset;
int i;
for(i=start; i<end; i++)
{
C[global_id] += A[i];
}
}