void kernel generation(global const int *previous, global int *new, global const int *size) { int ID, Nthreads, n, ratio, start, stop;" ID = get_global_id(0); Nthreads = get_global_size(0); n = size[0] * size[1]; ratio = (n / Nthreads); // number of elements for each thread start = ratio * ID; stop = ratio * (ID + 1); for (int i=start; i