Skip to content

Commit 7e2006b

Browse files
committed
metal : add/mul/div use general kernel when src1 not cont
1 parent 06dfde3 commit 7e2006b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ggml-metal.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,14 +1003,13 @@ void ggml_metal_graph_compute(
10031003
case GGML_OP_MUL:
10041004
case GGML_OP_DIV:
10051005
{
1006-
GGML_ASSERT(ggml_is_contiguous(src0));
1007-
GGML_ASSERT(ggml_is_contiguous(src1));
1008-
10091006
bool bcast_row = false;
10101007

10111008
int64_t nb = ne00;
10121009

1013-
if (ggml_nelements(src1) == ne10 && ne00 % 4 == 0) {
1010+
if (ggml_nelements(src1) == ne10 && ggml_is_contiguous(src1) && ne00 % 4 == 0) {
1011+
GGML_ASSERT(ggml_is_contiguous(src0));
1012+
10141013
// src1 is a row
10151014
GGML_ASSERT(ne11 == 1);
10161015

0 commit comments

Comments
 (0)