Skip to content

Commit 7bc4d22

Browse files
committed
metal : fix soft_max kernel src1 argument (#1602)
1 parent afce6fa commit 7bc4d22

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ggml-metal.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,9 @@ void ggml_metal_graph_compute(
11931193
const float scale = ((float *) dst->op_params)[0];
11941194

11951195
[encoder setBuffer:id_src0 offset:offs_src0 atIndex:0];
1196-
[encoder setBuffer:id_src1 offset:offs_src1 atIndex:1];
1196+
if (id_src1) {
1197+
[encoder setBuffer:id_src1 offset:offs_src1 atIndex:1];
1198+
}
11971199
[encoder setBuffer:id_dst offset:offs_dst atIndex:2];
11981200
[encoder setBytes:&ne00 length:sizeof(ne00) atIndex:3];
11991201
[encoder setBytes:&ne01 length:sizeof(ne01) atIndex:4];

0 commit comments

Comments
 (0)