Skip to content

Commit 4d4f797

Browse files
committed
small cleanup
1 parent 0867742 commit 4d4f797

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

ggml-backend.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -786,14 +786,14 @@ GGML_CALL bool ggml_backend_is_cpu(ggml_backend_t backend) {
786786
return backend && backend->iface.get_name == ggml_backend_cpu_name;
787787
}
788788

789-
GGML_CALL void ggml_backend_cpu_set_n_threads(ggml_backend_t backend_cpu, int n_threads) {
789+
void ggml_backend_cpu_set_n_threads(ggml_backend_t backend_cpu, int n_threads) {
790790
GGML_ASSERT(ggml_backend_is_cpu(backend_cpu));
791791

792792
struct ggml_backend_cpu_context * ctx = (struct ggml_backend_cpu_context *)backend_cpu->context;
793793
ctx->n_threads = n_threads;
794794
}
795795

796-
GGML_CALL void ggml_backend_cpu_set_abort_callback(ggml_backend_t backend_cpu, ggml_abort_callback abort_callback, void * abort_callback_data) {
796+
void ggml_backend_cpu_set_abort_callback(ggml_backend_t backend_cpu, ggml_abort_callback abort_callback, void * abort_callback_data) {
797797
GGML_ASSERT(ggml_backend_is_cpu(backend_cpu));
798798

799799
struct ggml_backend_cpu_context * ctx = (struct ggml_backend_cpu_context *)backend_cpu->context;

ggml.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16649,7 +16649,7 @@ struct ggml_compute_state_shared {
1664916649
atomic_int node_n; // active graph node
1665016650
atomic_int node_task; // active graph node task phase
1665116651

16652-
bool (*abort_callback)(void * data); // abort ggml_graph_compute when true
16652+
ggml_abort_callback abort_callback; // abort ggml_graph_compute when true
1665316653
void * abort_callback_data;
1665416654
};
1665516655

ggml.h

+3
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ extern "C" {
567567

568568
static const size_t GGML_TENSOR_SIZE = sizeof(struct ggml_tensor);
569569

570+
// Abort callback
571+
// If not NULL, called before ggml computation
572+
// If it returns true, the computation is aborted
570573
typedef bool (*ggml_abort_callback)(void * data);
571574

572575
// the compute plan that needs to be prepared for ggml_graph_compute()

0 commit comments

Comments
 (0)