MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / memory_overlap

Function memory_overlap

subprojects/llama.cpp/tests/test-alloc.cpp:227–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227static bool memory_overlap(ggml_tensor * a, ggml_tensor * b) {
228 if (a->buffer != b->buffer) {
229 return false;
230 }
231 int64_t a0 = (int64_t) a->data;
232 int64_t a1 = a0 + ggml_nbytes(a);
233 int64_t b0 = (int64_t) b->data;
234 int64_t b1 = b0 + ggml_nbytes(b);
235 return a1 > b0 && b1 > a0;
236}
237
238static ggml_tensor * get_view_source(ggml_tensor * t) {
239 while (t->view_src) {

Callers 1

check_no_overlapFunction · 0.85

Calls 1

ggml_nbytesFunction · 0.85

Tested by

no test coverage detected