__global__ void dynamicReverse(int *d_D, int n) { extern __shared__ int s[]; ... } dynamicReverse<<<1,n,n*sizeof(int)>>>(d_D, n);