Delete every x element from a 1D array

Hi guys,

I will delete ever x elements from a 1D array.

This is my idea:

I have a 1D array with 512x1024 point. So I will delete the element 512 for 1024 times. My orginal array have the sizeof 512x1024 element.

  1. Step
    Then I create a new empty array with 511x1024 elements.

2.Step
In the next step I will copy the original array in the new array, but I dont know how I skip the 512. elemet.

Can somebody help me with the copy process pls

In c I think this is the function that I need.

delete_last_column(unsigned int *idata, unsigned int *odata)
{
for(i=0; i<=rows; i++)
{
for(j=0; j<columns; j++) // → here deleting the last column
{
odata[i][j] = idata
}
}
}

Just make the kernel to do the same

int i=threadIdx.x+blockSize.xblockIdx.x;
int j=threadIdx.y+blockSize.y
blockIdx.y;

if(i<=rows && j<columns)
{
odata[j+i*columns]=idata;
}