* ggml : add ggml_op_is_empty
* ggml : move to ggml-impl.h
return (n + m - 1) & ~(m - 1);
}
-// TODO: move to ggml.h?
+// TODO: move to ggml.h? (won't be able to inline)
static bool ggml_are_same_layout(const struct ggml_tensor * a, const struct ggml_tensor * b) {
if (a->type != b->type) {
return false;
return true;
}
+static bool ggml_op_is_empty(enum ggml_op op) {
+ switch (op) {
+ case GGML_OP_NONE:
+ case GGML_OP_RESHAPE:
+ case GGML_OP_TRANSPOSE:
+ case GGML_OP_VIEW:
+ case GGML_OP_PERMUTE:
+ return true;
+ default:
+ return false;
+ }
+}
+
//
// logging
//
return ggml_mem_ranges_check_dst(mrs, tensor);
}
-// TODO: move to ggml.h?
-static bool is_empty(ggml_op op) {
- switch (op) {
- case GGML_OP_NONE:
- case GGML_OP_RESHAPE:
- case GGML_OP_TRANSPOSE:
- case GGML_OP_VIEW:
- case GGML_OP_PERMUTE:
- return true;
- default:
- return false;
- }
-}
-
struct node_info {
ggml_tensor * node;
}
bool is_empty() const {
- return ::is_empty(node->op);
+ return ggml_op_is_empty(node->op);
}
void add_fused(ggml_tensor * t) {
case GGML_OP_GET_ROWS:
return true;
default:
- return is_empty(op);
+ return ggml_op_is_empty(op);
}
};