Skip to content

Commit 1516f7b

Browse files
committed
fix: convert TENSOR_ALIGNMENT to a macro
1 parent cb22464 commit 1516f7b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ggml/src/ggml-backend.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,6 @@ ggml_backend_t ggml_backend_init_best(void) {
682682

683683
// backend CPU
684684

685-
static const size_t TENSOR_ALIGNMENT = 32; // required for mmap as gguf only guarantees 32-byte alignment
686-
687685
static const char * ggml_backend_cpu_buffer_get_name(ggml_backend_buffer_t buffer) {
688686
return "CPU";
689687

ggml/src/ggml-impl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ extern "C" {
1919
#define MIN(a, b) ((a) < (b) ? (a) : (b))
2020
#define MAX(a, b) ((a) > (b) ? (a) : (b))
2121

22+
// required for mmap as gguf only guarantees 32-byte alignment
23+
#define TENSOR_ALIGNMENT 32
24+
2225
// static_assert should be a #define, but if it's not,
2326
// fall back to the _Static_assert C11 keyword.
2427
// if C99 - static_assert is noop

0 commit comments

Comments
 (0)