Skip to content

Commit

Permalink
examples : add null threadpool args where needed (#0)
Browse files Browse the repository at this point in the history
ggml-ci
  • Loading branch information
ggerganov committed Sep 8, 2024
1 parent a251ca3 commit fbac47b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/gpt-2/main-alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ bool gpt2_eval(
}

// run the computation
struct ggml_cplan plan = ggml_graph_plan(gf, n_threads);
struct ggml_cplan plan = ggml_graph_plan(gf, n_threads, nullptr);
static std::vector<uint8_t> work_buffer;
work_buffer.resize(plan.work_size);
plan.work_data = work_buffer.data();
Expand Down
2 changes: 1 addition & 1 deletion examples/sam/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static void ggml_disconnect_node_from_graph(ggml_tensor * t) {
}

static void ggml_graph_compute_helper(std::vector<uint8_t> & buf, ggml_cgraph * graph, int n_threads) {
struct ggml_cplan plan = ggml_graph_plan(graph, n_threads);
struct ggml_cplan plan = ggml_graph_plan(graph, n_threads, nullptr);

if (plan.work_size > 0) {
buf.resize(plan.work_size);
Expand Down
4 changes: 2 additions & 2 deletions src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -19710,8 +19710,8 @@ void ggml_threadpool_resume(struct ggml_threadpool * threadpool) {

struct ggml_cplan ggml_graph_plan(
const struct ggml_cgraph * cgraph,
int n_threads,
struct ggml_threadpool * threadpool) {
int n_threads,
struct ggml_threadpool * threadpool) {

if (threadpool == NULL) {
GGML_PRINT_DEBUG("Threadpool is not specified. Will create a disposable threadpool : n_threads %d\n", n_threads);
Expand Down

0 comments on commit fbac47b

Please sign in to comment.