         for (n = 0; n < BLK_N / DIM_YB; n++) {
             #pragma unroll
             for (m = 0; m < BLK_K / DIM_XB; m++) {
-                rb[n][m] = offs_dB[n * DIM_YB * K + m * DIM_XB];
+                rb[n][m] = fetch(offs_dB, K, m * DIM_XB, n * DIM_YB, boundB);
             }
         }
 

//#define THR_N  ${THR_N}
//#define THR_M  ${THR_M}


extern "C" __global__
void sgemm(

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