 
     name += trans;
 
+    int sizeA, sizeB, threads;
+
+    std::tie(sizeA, sizeB, threads) = get_grid_dimensions(grid, m, n, sm_count, trans);
+
+    int k_vec = (sizeA == 32 || sizeB == 32) ? 4 : 16;
+
     if ( (trans == "tn" && m % 4 == 0  && n % 4 == 0) ||
-         (trans == "nn" && k % 16 == 0 && n % 4 == 0) ||
-         (trans == "nt" && k % 16 == 0)) {
+         (trans == "nn" && k % k_vec == 0 && n % 4 == 0) ||
+         (trans == "nt" && k % k_vec == 0)) {
          name += "_vec";
     }
-
-    int sizeA, sizeB, threads;
-
-    std::tie(sizeA, sizeB, threads) = get_grid_dimensions(grid, m, n, sm_count, trans);
 
     int gridA = m / sizeA + (m % sizeA != 0);
     int gridB = n / sizeB + (n % sizeB != 0);

            size = 128;
        }

        if (n >= m) {
            if (trans == "nt") {
                size = 128;
            }


    name += trans;

    int sizeA, sizeB, threads;

    std::tie(sizeA, sizeB, threads) = get_grid_dimensions(grid, m, n, sm_count, trans);

    int k_vec = (sizeA == 32 || sizeB == 32) ? 4 : 16;

    if ( (trans == "tn" && m % 8 == 0 && n % 8 == 0) ||
         (trans == "nn" && k % k_vec == 0 && n % 8 == 0) ||
         (trans == "nt" && k % k_vec == 0)) {
         name += "_vec";
    }

    int gridA = m / sizeA + (m % sizeA != 0);
    int gridB = n / sizeB + (n % sizeB != 0);
