__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; }