Skip to content

Commit

Permalink
gpu: jit: gemm: workaround for MTL read suppression HW bug
Browse files Browse the repository at this point in the history
  • Loading branch information
petercad committed Nov 20, 2023
1 parent 8829c24 commit 6edab9f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/gpu/jit/gemm/gen_gemm_kernel_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1476,18 +1476,17 @@ void gemm_kernel_generator_t<hw>::doReadSuppressionWA(

if (!strategy.readSuppressionWA) return;

if (state.r0_info.isValid() && !state.r0_info.isARF())
temp = GRF(state.r0_info.getBase());
else {
temp = state.ra.try_alloc();
if (temp.isValid())
freeTemp = true;
else
temp = r0;
}
temp = state.ra.try_alloc();
if (temp.isValid())
freeTemp = true;
else
temp = GRF(strategy.GRFs - 1);

auto rI = temp.uw(0)(1);
auto rF = temp.f(4)(1);

csel<int16_t>(8, temp, temp, temp, temp);
csel<float>(8, temp, temp, temp, temp);
csel(4, rI, rI, rI, rI); // Clear read suppression data in int pipe.
csel(4, rF, rF, rF, rF); // Clear read suppression data in float pipe.

if (freeTemp) state.ra.safeRelease(temp);
}
Expand Down

0 comments on commit 6edab9f

Please sign in to comment.