1 2 3 4 5 6 7 8
__kernel void global_id2d(__global int * out) { unsigned x = get_global_id(0); unsigned y = get_global_id(1); unsigned id = (y * get_global_size(1)) + x; out[id] = id; }