   float bb[WLEN + SHIFT];
   float prods[WLEN][window];
   int word[WLEN + SHIFT];
-  __shared__ float CC[WLEN*BYDIM][window];
-  int i, j, k, icol, jcol, ic, ir;
+  __shared__ float CC[WLEN*BYDIM*window];
+  int i, j, k, icol, jcol;
   int tid = threadIdx.x + blockDim.x * threadIdx.y;
   int dxy = blockDim.x * blockDim.y;
 

#pragma unroll
        for (k = 0; k <= SHIFT; k++) {
          prods[j][SHIFT+k] += aa[j] * bb[j+k];
          prods[j][SHIFT-k] += aa[j+k] * bb[j];
        }
      }

      for (j = 0; j < WLEN; j++) {
#pragma unroll
        for (k = 0; k < window; k++) {
          CC[k + window * (j + WLEN * threadIdx.y)] = prods[j][k];
        }
      }
    }
    __syncthreads();
    for (j = 0; j < WLEN * window; j += dxy) {
      for (k = 1; k < blockDim.y; k++) {
        if (j + tid < WLEN * window) {
          CC[j + tid] += CC[j + tid + k * WLEN * window];
        }
        __syncthreads();
      } 
      if (j + tid < WLEN * window && j + tid + jcol * window < ncols * window) {
        C[j + tid + jcol * window] = CC[j + tid];
      }
    }
  }
}

