 // Perhaps it's not very cache friendly, but it is
 // very simple to perform work-distribution for this variant
 
+#define __SET_MAP                               \
+  const int                                     \
+      x = blockIdx.x * blockDim.x + threadIdx.x \
+    , y = blockIdx.y * blockDim.y + threadIdx.y \
+    , xl = max_half_support - x                 \
+    , xr = max_half_support + x                 \
+    , yl = max_half_support - y                 \
+    , yr = max_half_support + y                 \
+    ;
+
+
 template <int max_half_support>
 __device__
 void ucs_common(
     cuDoubleComplex mesh[max_half_support * 2 + 1][max_half_support * 2 + 1]
   , double t2
   ){
-  const int
-      x = blockIdx.x * blockDim.x + threadIdx.x
-    , y = blockIdx.y * blockDim.y + threadIdx.y
-    ;
+  __SET_MAP
   double
       sc = double(max_half_support)
     , xs = double(x) / sc * t2

void cut_out(
    int supp
  , cuDoubleComplex * dst
  , const cuDoubleComplex src[max_half_support * oversample * 2 + 1][max_half_support * oversample * 2 + 1]
  ) {
  const int
      x = blockIdx.x * blockDim.x + threadIdx.x

  , const cuDoubleComplex src[max_half_support * 2 + 1][max_half_support * 2 + 1]
  , double w
  ){
  __SET_MAP
  double ph = w * (1.0 - sqrt(1.0 - src[xl][yl].x));
  double s, c;
  sincos(2.0 * CUDART_PI * ph, &s, &c);

  cuDoubleComplex res = make_cuDoubleComplex(c, -s); // to get rid of conj later

  dst[xl][yl] = res;
  dst[xl][yr] = res;
  dst[xr][yl] = res;
  dst[xr][yr] = res;
}

// test instantiation
