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

Function ggml_cl_pool_free

ggml-opencl.cpp:1319–1332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1317}
1318
1319static void ggml_cl_pool_free(cl_mem mem, size_t size) {
1320 scoped_spin_lock lock(g_cl_pool_lock);
1321
1322 for (int i = 0; i < MAX_CL_BUFFERS; ++i) {
1323 cl_buffer& b = g_cl_buffer_pool[i];
1324 if (b.size == 0) {
1325 b.mem = mem;
1326 b.size = size;
1327 return;
1328 }
1329 }
1330 fprintf(stderr, "WARNING: cl buffer pool full, increase MAX_CL_BUFFERS\n");
1331 clReleaseMemObject(mem);
1332}
1333
1334void ggml_cl_free_data(const struct ggml_tensor* tensor) {
1335 if (tensor->backend != GGML_BACKEND_GPU) {

Callers 4

ggml_cl_mul_f32Function · 0.85
ggml_cl_mul_mat_f32Function · 0.85
ggml_cl_mul_mat_f16Function · 0.85
ggml_cl_mul_mat_q_f32Function · 0.85

Calls 1

fprintfFunction · 0.85

Tested by

no test coverage detected