Skip to content

Commit

Permalink
remove dependence of ggml-opt.cpp on ggml-cpu.h
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesGaessler committed Nov 16, 2024
1 parent 25b21f6 commit 4685431
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/ggml-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "ggml.h"
#include "ggml-alloc.h"
#include "ggml-backend.h"
#include "ggml-cpu.h"
#include "ggml-impl.h"

#include <algorithm>
Expand Down Expand Up @@ -105,9 +104,7 @@ ggml_opt_dataset_t ggml_opt_dataset_init(int64_t ne_datapoint, int64_t ne_label,
result->nbs_labels = 0;
}

result->backend = ggml_backend_cpu_init();
GGML_ASSERT(result->backend);
result->buf = ggml_backend_alloc_ctx_tensors(result->ctx, result->backend);
result->buf = ggml_backend_alloc_ctx_tensors_from_buft(result->ctx, ggml_backend_cpu_buffer_type());

const int64_t nshards = ndata/ndata_shard;
result->permutation.resize(nshards);
Expand Down

0 comments on commit 4685431

Please sign in to comment.