When copying data from global to local memory, you often see code like below (1D data): [raw] if (get_group_id(0)==0) { for (int i=0; i < N; i++) { data_local[i] = data_global[offset+i] } } mem_fence(CLK_LOCAL_MEM_FENCE); [/raw] This can be replaced this with…