Skip to content

Commit 838e89d

Browse files
committed
metal : perform op->type check only once
1 parent 8f0f615 commit 838e89d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ggml/src/ggml-metal/ggml-metal.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,8 +1647,12 @@ static bool ggml_metal_supports_op(const struct ggml_backend_metal_device_contex
16471647
const bool use_bfloat = ctx_dev->use_bfloat;
16481648

16491649
if (!use_bfloat) {
1650+
if (op->type == GGML_TYPE_BF16) {
1651+
return false;
1652+
}
1653+
16501654
for (size_t i = 0, n = 3; i < n; ++i) {
1651-
if (op->src[i] != NULL && (op->src[i]->type == GGML_TYPE_BF16 || op->type == GGML_TYPE_BF16)) {
1655+
if (op->src[i] != NULL && op->src[i]->type == GGML_TYPE_BF16) {
16521656
return false;
16531657
}
16541658
}

0 commit comments

Comments
 (0)