20% data lost on a R9

I lose 20% of data results:

I made following test at GPU:

        int i=get_global_id(0) % xmax;
	int l=get_local_id(0);
	//if ((mv>DELTA_MOVE)||(mv<-DELTA_MOVE))
	{
		if (i<xmed)
		{
			movy1[l]+=mv;
			count1[l]++;
		}
		else
		{
			movy2[l]+=mv;
			count2[l]++;
		}
	}

Then after retrieve all data I add all count1[] and count2[+ I lost 20% of the data

Race condition. Multiple work items are incrementing the same memory locations at the same time. You need to use atomics to solve (or change the algorithm to remove the simultaneous access).