     int m, n, k, kk;
     
     #pragma unroll
-    for (n = 0; n < THR_N; n++)
-        #pragma unroll
-        for (m = 0 ; m < THR_M; m++)
+    for (n = 0; n < THR_N; n++) {
+        #pragma unroll
+        for (m = 0 ; m < THR_M; m++) {
             rC[n][m] = 0;
+        }
+    }
 
     // blockwise transpose to transpose load
     #pragma unroll
-    for (n = 0; n < BLK_K; n += DIM_YA)
-        #pragma unroll
-        for (m = 0; m < BLK_M; m += DIM_XA)
+    for (n = 0; n < BLK_K; n += DIM_YA) {
+        #pragma unroll
+        for (m = 0; m < BLK_M; m += DIM_XA) {
             sA[n + idyA][m + idxA] = offs_dA[n * M + m];
+        }
+    }
     // blockwise transpose to transpose load
     #pragma unroll
-    for (n = 0; n < BLK_N; n += DIM_YB)
-        #pragma unroll
-        for (m = 0; m < BLK_K; m += DIM_XB)
+    for (n = 0; n < BLK_N; n += DIM_YB) {
+        #pragma unroll
+        for (m = 0; m < BLK_K; m += DIM_XB) {
             sB[n + idyB][m + idxB] = offs_dB[n * K + m];
+        }
+    }
     __syncthreads();
 
     for (kk = 0; kk < K - BLK_K; kk += BLK_K)

        // store A regs->smem
        #pragma unroll
        for (n = 0; n < BLK_K / DIM_YA; n++)
            #pragma unroll
            for (m = 0; m < BLK_M / DIM_XA; m++)
                sA[n * DIM_YA + idyA][m * DIM_XA + idxA] = ra[n][m];

        #pragma unroll
        for (n = 0; n < BLK_N / DIM_YB; n++)
            #pragma unroll
            for (m = 0; m < BLK_K / DIM_XB; m++)
                sB[n * DIM_YB + idyB][m * DIM_XB + idxB] = rb[n][m];
        __syncthreads();
    }


    for (k = 0; k < kk; k++)
    {
        #pragma unroll
        for (m = 0; m < THR_M; m++) {
            rA[m] = sA[k][m * DIM_X + idx];
        }

        #pragma unroll
        for (n = 0; n < THR_N; n++) {
            rB[n] = sB[n * DIM_Y + idy][k];
        }
        
        #pragma unroll
        for (n = 0; n < THR_N; n++) {
            #pragma unroll
            for (m = 0; m < THR_M; m++) {
                rC[n][m] += rA[m] * rB[n];
            }
        }
