Skip to content

Commit a876861

Browse files
committed
metal : update support condition for im2col + fix warning (#0)
1 parent 385decb commit a876861

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ggml/src/ggml-metal.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,9 @@ static bool ggml_metal_supports_op(const struct ggml_backend_metal_context * ctx
799799
return ctx->support_simdgroup_reduction;
800800
case GGML_OP_NORM:
801801
case GGML_OP_ROPE:
802-
case GGML_OP_IM2COL:
803802
return true;
803+
case GGML_OP_IM2COL:
804+
return op->src[0]->type == GGML_TYPE_F16;
804805
case GGML_OP_POOL_1D:
805806
case GGML_OP_POOL_2D:
806807
return false;

tests/test-backend-ops.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <cfloat>
2525
#include <cstdint>
2626
#include <cstring>
27+
#include <cinttypes>
2728
#include <functional>
2829
#include <memory>
2930
#include <random>
@@ -33,7 +34,6 @@
3334
#include <thread>
3435
#include <vector>
3536

36-
3737
static void init_tensor_uniform(ggml_tensor * tensor, float min = -1.0f, float max = 1.0f) {
3838
// static RNG initialization (revisit if n_threads stops being constant)
3939
static const size_t n_threads = std::thread::hardware_concurrency();
@@ -869,7 +869,7 @@ struct test_case {
869869
for (int64_t i = 0; i < ne; ++i) { // gradient algebraic
870870
// check for nans
871871
if (!std::isfinite(ga[i])) {
872-
printf("[%s] nonfinite gradient at index %zu (%s=%f) ", ggml_op_desc(t), i, bn, ga[i]);
872+
printf("[%s] nonfinite gradient at index %" PRId64 " (%s=%f) ", ggml_op_desc(t), i, bn, ga[i]);
873873
ok = false;
874874
break;
875875
}

0 commit comments

Comments
 (0)