| 261 | static const size_t TENSOR_ALIGNMENT = 64; // should be enough for AVX 512 |
| 262 | |
| 263 | static ggml_backend_buffer_t ggml_backend_cpu_alloc_buffer(ggml_backend_t backend, size_t size) { |
| 264 | size += TENSOR_ALIGNMENT; // malloc may return an address that is not aligned |
| 265 | void * data = malloc(size); // TODO: maybe use GGML_ALIGNED_MALLOC? |
| 266 | |
| 267 | GGML_ASSERT(data != NULL && "failed to allocate buffer"); |
| 268 | |
| 269 | return ggml_backend_buffer_init(backend, cpu_backend_buffer_i, data, size); |
| 270 | } |
| 271 | |
| 272 | static size_t ggml_backend_cpu_get_alignment(ggml_backend_t backend) { |
| 273 | return TENSOR_ALIGNMENT; |
nothing calls this directly
no test coverage detected