Skip to content

Commit 584a5c7

Browse files
committed
fix: vulkan shaders f32.
1 parent 8c007cc commit 584a5c7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/nn/vulkan/cast-forward-f32-q80.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void main() {
6767
}
6868

6969
const float d = amax / 127.0f;
70-
const float id = d != 0.0 ? 1.0 / d : 0.0;
70+
const float id = d != 0.0f ? 1.0f / d : 0.0f;
7171

7272
y[yiOffset].d = float16_t(d);
7373

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void main() {
9797
const uint wi = (d + dt) * inputSizeX + (i + it);
9898
const BlockQ40 wBlock = weight[wi];
9999

100-
float16_t s = float16_t(0);
100+
float16_t s = float16_t(0.0f);
101101
[[unroll]] for (uint j = 0; j < Q80_Q40_BLOCK_SIZE / 4; j++) {
102102
uint w0 = wBlock.qs[j * 2];
103103
uint w1 = wBlock.qs[j * 2 + 1];

src/nn/vulkan/multi-head-att-forward-f32-f32.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void main() {
116116
const float yScale = 1.0f / temp[0];
117117

118118
for (uint i = threadIndex; i < headDim; i += N_THREADS) {
119-
float sum = 0.0;
119+
float sum = 0.0f;
120120
const uint vOffset = kvOffset + i;
121121
for (uint p = 0; p <= position; p += 1) {
122122
const float a = att[attOffset + p];

0 commit comments

Comments
 (0)