Skip to content

Commit 9f04e10

Browse files
committed
use of ggml_op enum values instead of strcmp
1 parent b186919 commit 9f04e10

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/test-backend-ops.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6807,17 +6807,17 @@ static void list_all_ops() {
68076807
static void show_test_coverage() {
68086808
std::set<std::string> all_ops;
68096809
for (int i = 1; i < GGML_OP_COUNT; i++) {
6810-
auto op_name = ggml_op_name((enum ggml_op)i);
6811-
if (strcmp(op_name, "VIEW") == 0 ||
6812-
strcmp(op_name, "RESHAPE") == 0 ||
6813-
strcmp(op_name, "PERMUTE") == 0 ||
6814-
strcmp(op_name, "TRANSPOSE") == 0 ||
6815-
strcmp(op_name, "CONT") == 0 ||
6816-
strcmp(op_name, "GLU") == 0 ||
6817-
strcmp(op_name, "UNARY") == 0 ) {
6810+
auto op = (enum ggml_op)i;
6811+
if (op == GGML_OP_VIEW ||
6812+
op == GGML_OP_RESHAPE ||
6813+
op == GGML_OP_PERMUTE ||
6814+
op == GGML_OP_TRANSPOSE ||
6815+
op == GGML_OP_CONT ||
6816+
op == GGML_OP_GLU ||
6817+
op == GGML_OP_UNARY) {
68186818
continue;
68196819
}
6820-
all_ops.insert(op_name);
6820+
all_ops.insert(ggml_op_name(op));
68216821
}
68226822
for (int i = 0; i < GGML_UNARY_OP_COUNT; i++) {
68236823
all_ops.insert(ggml_unary_op_name((enum ggml_unary_op)i));

0 commit comments

Comments
 (0)