Skip to content

Commit

Permalink
ggml: comment out tensor setting on backend (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
danbev committed Oct 7, 2024
1 parent 584627e commit 8e4da32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fundamentals/ggml/src/galloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ int main(int argc, char **argv) {

ggml_backend_t backend = ggml_backend_cpu_init();

ggml_backend_buffer_t buffer = ggml_backend_alloc_ctx_tensors(ctx, backend);
ggml_backend_tensor_set(a, a_data, 0, ggml_nbytes(a));
ggml_backend_tensor_set(b, b_data, 0, ggml_nbytes(b));
//ggml_backend_buffer_t buffer = ggml_backend_alloc_ctx_tensors(ctx, backend);
//ggml_backend_tensor_set(a, a_data, 0, ggml_nbytes(a));
//ggml_backend_tensor_set(b, b_data, 0, ggml_nbytes(b));
// For the CPU backend this is pretty much just a memcpy:
memcpy((char *)b->data + 0, b_data, ggml_nbytes(b));
//memcpy((char *)b->data + 0, b_data, ggml_nbytes(b));

ggml_gallocr_t galloc = ggml_gallocr_new(ggml_backend_get_default_buffer_type(backend));
ggml_gallocr_alloc_graph(galloc, c_graph);
Expand All @@ -61,7 +61,7 @@ int main(int argc, char **argv) {

ggml_gallocr_free(galloc);
ggml_free(ctx);
ggml_backend_buffer_free(buffer);
//ggml_backend_buffer_free(buffer);
ggml_backend_free(backend);
return 0;
}

0 comments on commit 8e4da32

Please sign in to comment.