1 #include "collem_structures.h"
4 global CollemWorld *world,
5 global int *populations,
6 global int *patchesOwners,
7 global int *plotsPopulations)
9 const int i = get_global_id(0);
10 const int j = get_global_id(1);
12 // Retrieve the owner parcel
13 const int plotId = CELL(world, patchesOwners, i, j);
14 if (plotId == -1) return;
16 // Add cell population to the owner parcel population
17 atomic_add(plotsPopulations + plotId, CELL(world, populations, i, j));