MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / aligned_offset

Function aligned_offset

ggml-alloc.c:21–25  ·  view source on GitHub ↗

TODO: GGML_PAD ?

Source from the content-addressed store, hash-verified

19
20// TODO: GGML_PAD ?
21static size_t aligned_offset(const void * buffer, size_t offset, size_t alignment) {
22 assert(alignment && !(alignment & (alignment - 1))); // power of 2
23 size_t align = (alignment - (((uintptr_t)buffer + offset) % alignment)) % alignment;
24 return offset + align;
25}
26
27struct free_block {
28 void * addr;

Callers 3

ggml_tallocr_allocFunction · 0.70
ggml_tallocr_free_tensorFunction · 0.70
ggml_tallocr_resetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected