Skip to content

Commit 554b2c8

Browse files
committed
ggml : move to ggml-impl.h
1 parent fe3089c commit 554b2c8

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

ggml/include/ggml.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,10 +702,9 @@ extern "C" {
702702
GGML_API double ggml_type_sizef(enum ggml_type type), // ggml_type_size()/ggml_blck_size() as float
703703
"use ggml_row_size() instead");
704704

705-
GGML_API const char * ggml_type_name (enum ggml_type type);
706-
GGML_API const char * ggml_op_name (enum ggml_op op);
707-
GGML_API const char * ggml_op_symbol (enum ggml_op op);
708-
GGML_API bool ggml_op_is_empty(enum ggml_op op);
705+
GGML_API const char * ggml_type_name(enum ggml_type type);
706+
GGML_API const char * ggml_op_name (enum ggml_op op);
707+
GGML_API const char * ggml_op_symbol(enum ggml_op op);
709708

710709
GGML_API const char * ggml_unary_op_name(enum ggml_unary_op op);
711710
GGML_API const char * ggml_glu_op_name(enum ggml_glu_op op);

ggml/src/ggml-impl.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static inline int ggml_up(int n, int m) {
7373
return (n + m - 1) & ~(m - 1);
7474
}
7575

76-
// TODO: move to ggml.h?
76+
// TODO: move to ggml.h? (won't be able to inline)
7777
static bool ggml_are_same_layout(const struct ggml_tensor * a, const struct ggml_tensor * b) {
7878
if (a->type != b->type) {
7979
return false;
@@ -89,6 +89,19 @@ static bool ggml_are_same_layout(const struct ggml_tensor * a, const struct ggml
8989
return true;
9090
}
9191

92+
static bool ggml_op_is_empty(enum ggml_op op) {
93+
switch (op) {
94+
case GGML_OP_NONE:
95+
case GGML_OP_RESHAPE:
96+
case GGML_OP_TRANSPOSE:
97+
case GGML_OP_VIEW:
98+
case GGML_OP_PERMUTE:
99+
return true;
100+
default:
101+
return false;
102+
}
103+
}
104+
92105
//
93106
// logging
94107
//

ggml/src/ggml.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,19 +1258,6 @@ const char * ggml_op_symbol(enum ggml_op op) {
12581258
return GGML_OP_SYMBOL[op];
12591259
}
12601260

1261-
bool ggml_op_is_empty(enum ggml_op op) {
1262-
switch (op) {
1263-
case GGML_OP_NONE:
1264-
case GGML_OP_RESHAPE:
1265-
case GGML_OP_TRANSPOSE:
1266-
case GGML_OP_VIEW:
1267-
case GGML_OP_PERMUTE:
1268-
return true;
1269-
default:
1270-
return false;
1271-
}
1272-
}
1273-
12741261
const char * ggml_unary_op_name(enum ggml_unary_op op) {
12751262
return GGML_UNARY_OP_NAME[op];
12761263
}

0 commit comments

Comments
 (0)