Skip to content

Commit fbac47b

Browse files
committed
examples : add null threadpool args where needed (#0)
ggml-ci
1 parent a251ca3 commit fbac47b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

examples/gpt-2/main-alloc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ bool gpt2_eval(
698698
}
699699

700700
// run the computation
701-
struct ggml_cplan plan = ggml_graph_plan(gf, n_threads);
701+
struct ggml_cplan plan = ggml_graph_plan(gf, n_threads, nullptr);
702702
static std::vector<uint8_t> work_buffer;
703703
work_buffer.resize(plan.work_size);
704704
plan.work_data = work_buffer.data();

examples/sam/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static void ggml_disconnect_node_from_graph(ggml_tensor * t) {
345345
}
346346

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

350350
if (plan.work_size > 0) {
351351
buf.resize(plan.work_size);

src/ggml.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19710,8 +19710,8 @@ void ggml_threadpool_resume(struct ggml_threadpool * threadpool) {
1971019710

1971119711
struct ggml_cplan ggml_graph_plan(
1971219712
const struct ggml_cgraph * cgraph,
19713-
int n_threads,
19714-
struct ggml_threadpool * threadpool) {
19713+
int n_threads,
19714+
struct ggml_threadpool * threadpool) {
1971519715

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

0 commit comments

Comments
 (0)