Skip to content

Commit 6372624

Browse files
committed
fix: hoisting.
1 parent 03c1238 commit 6372624

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/nn/vulkan/matmul-forward-q80-q40-f32.comp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ void main() {
5151
const uint workGroupIndex = gl_WorkGroupID.x;
5252
const uint batchIndex = gl_WorkGroupID.y;
5353
const uint zIndex = gl_WorkGroupID.z;
54-
const BatchInfo info = infos[zIndex * N_BATCHES + batchIndex];
54+
55+
const uint b = zIndex * N_BATCHES + batchIndex;
56+
const BatchInfo info = infos[b];
5557

5658
const uint expertIndex = nExperts == 0
5759
? 0
@@ -60,7 +62,6 @@ void main() {
6062

6163
const uint inputOffset = info.inputOffset;
6264
const uint inputSizeX = info.inputSizeX;
63-
const uint outputOffset = info.outputOffset;
6465
const uint d = TILE_SIZE_D * workGroupIndex;
6566

6667
vec4 xTemp[Q80_Q40_BLOCK_SIZE / 4];
@@ -102,6 +103,8 @@ void main() {
102103

103104
barrier();
104105

106+
const uint outputOffset = infos[b].outputOffset; // Hoisting fix for Raspberry PI
107+
105108
uint i = N_THREADS;
106109
while (i % 2 == 0) {
107110
i >>= 1;

0 commit comments

Comments
 (0)