You need to use atomic operations.
__kernel void cl_test(__global int* Number)
{
int id = get_global_id(0);
if (id%5==0)
{
atomic_inc(Number);
}
if (id%10==0)
{
atomic_inc(&Number[1]);
}
}
You should avoid using those as much as possible as atomic operations tend to be rather slow precisely because they make sure that it works correctly across threads.