@@ -25,13 +25,12 @@ uint fill_blkcache_its(uint wg_size) {
2525 return 8;
2626}
2727
28- void fill_blkcache(const int num_blocks, const uint ib0, const uint i0, const uint tid, const uint fbi) {
29- uint bc_t = 104 / fbi;
30- if (tid < bc_t) {
28+ void fill_blkcache(const int num_blocks, const uint bct, const uint ib0, const uint i0, const uint tid, const uint fbi) {
29+ if (tid < bct) {
3130 [[unroll]] for (int l = 0; l < num_blocks; ++l) {
3231 [[unroll]] for (int m = 0; m < fbi; ++m)
3332 // cache full superblock into shared memory with coalesced reads
34- blkcache[l].blk[tid + m*bc_t ] = data_a_packed16[ib0 + i0 + l].blk[tid + m*bc_t ];
33+ blkcache[l].blk[tid + m*bct ] = data_a_packed16[ib0 + i0 + l].blk[tid + m*bct ];
3534 }
3635 }
3736}
@@ -48,6 +47,7 @@ void compute_outputs(const uint32_t first_row, const uint32_t num_rows) {
4847 const uint itid = tid%16; // 0...15
4948 const uint ix = tid/16;
5049 const uint fbi = fill_blkcache_its(gl_WorkGroupSize.x);
50+ const uint bct = 104/fbi;
5151
5252 const uint v_im = itid/8; // 0 or 1. 0 computes 0..., 1 computes 128...
5353 const uint v_in = itid - 8*v_im; // 0...15 or 0...7
@@ -81,9 +81,9 @@ void compute_outputs(const uint32_t first_row, const uint32_t num_rows) {
8181
8282 // fill_blkcache is sensitive to unrolling with hardcoded it_size
8383 if (blim == it_size) {
84- fill_blkcache(int(it_size), ib0, i0, tid, fbi);
84+ fill_blkcache(int(it_size), bct, ib0, i0, tid, fbi);
8585 } else {
86- fill_blkcache(blim, ib0, i0, tid, fbi);
86+ fill_blkcache(blim, bct, ib0, i0, tid, fbi);
8787 }
8888
8989 sccache[ix][itid] = FLOAT_TYPE(int8_t(bitfieldExtract(blkcache[ix].blk[96 + itid/2], int(bcs_offset), 8)));
0 commit comments