aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-08-07 14:24:42 +0300
committerGeorgi Gerganov <ggerganov@gmail.com>2023-08-07 14:24:42 +0300
commit60baff7c8584ec369e53469cad5f92e102b1efe4 (patch)
tree3c36dd2162876c370534f5bb7d56e039df0e1b7e
parent9082b5dfbfae01243a0b822dcd2812877e63bf1b (diff)
ggml : pad result of ggml_nbytes()
-rw-r--r--ggml.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ggml.c b/ggml.c
index 9c4b49d..c97c2b6 100644
--- a/ggml.c
+++ b/ggml.c
@@ -4110,7 +4110,7 @@ size_t ggml_nbytes(const struct ggml_tensor * tensor) {
//
// is enough, but just in case, adding the second part
- return MAX(tensor->ne[3]*tensor->nb[3], (ggml_nelements(tensor)*GGML_TYPE_SIZE[tensor->type])/GGML_BLCK_SIZE[tensor->type]);
+ return GGML_PAD(MAX(tensor->ne[3]*tensor->nb[3], (ggml_nelements(tensor)*GGML_TYPE_SIZE[tensor->type])/GGML_BLCK_SIZE[tensor->type]), GGML_MEM_ALIGN);
}
size_t ggml_nbytes_split(const struct ggml_tensor * tensor, int nrows_split) {