diff --git a/ggml.c b/ggml.c index 534b68939..f1e25f09b 100644 --- a/ggml.c +++ b/ggml.c @@ -2548,6 +2548,7 @@ static struct ggml_tensor * ggml_new_tensor_impl( /*.nb =*/ { 0, 0, 0, 0 }, /*.op =*/ GGML_OP_NONE, /*.op_params =*/ { 0 }, + /*.flags =*/ 0, /*.is_param =*/ false, /*.grad =*/ NULL, /*.src =*/ { NULL }, diff --git a/ggml.h b/ggml.h index de8162b81..0025beddc 100644 --- a/ggml.h +++ b/ggml.h @@ -501,11 +501,17 @@ extern "C" { enum ggml_log_level { GGML_LOG_LEVEL_ERROR = 2, - GGML_LOG_LEVEL_WARN = 3, - GGML_LOG_LEVEL_INFO = 4, + GGML_LOG_LEVEL_WARN = 3, + GGML_LOG_LEVEL_INFO = 4, GGML_LOG_LEVEL_DEBUG = 5 }; + enum ggml_tensor_flags { + GGML_TENSOR_INPUT = 1, + GGML_TENSOR_OUTPUT = 2, + GGML_TENSOR_PARAM = 4, + }; + // ggml object struct ggml_object { size_t offs; @@ -539,7 +545,9 @@ extern "C" { // op params - allocated as int32_t for alignment int32_t op_params[GGML_MAX_OP_PARAMS / sizeof(int32_t)]; - bool is_param; + int32_t flags; + + bool is_param; // TODO: move to flags struct ggml_tensor * grad; struct ggml_tensor * src[GGML_MAX_SRC]; @@ -558,7 +566,7 @@ extern "C" { void * extra; // extra things e.g. for ggml-cuda.cu - char padding[8]; + char padding[12]; }; static const size_t GGML_TENSOR_SIZE = sizeof(struct ggml_tensor);