File tree 3 files changed +6
-3
lines changed
3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -786,14 +786,14 @@ GGML_CALL bool ggml_backend_is_cpu(ggml_backend_t backend) {
786
786
return backend && backend -> iface .get_name == ggml_backend_cpu_name ;
787
787
}
788
788
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 ) {
790
790
GGML_ASSERT (ggml_backend_is_cpu (backend_cpu ));
791
791
792
792
struct ggml_backend_cpu_context * ctx = (struct ggml_backend_cpu_context * )backend_cpu -> context ;
793
793
ctx -> n_threads = n_threads ;
794
794
}
795
795
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 ) {
797
797
GGML_ASSERT (ggml_backend_is_cpu (backend_cpu ));
798
798
799
799
struct ggml_backend_cpu_context * ctx = (struct ggml_backend_cpu_context * )backend_cpu -> context ;
Original file line number Diff line number Diff line change @@ -16649,7 +16649,7 @@ struct ggml_compute_state_shared {
16649
16649
atomic_int node_n; // active graph node
16650
16650
atomic_int node_task; // active graph node task phase
16651
16651
16652
- bool (* abort_callback)(void * data) ; // abort ggml_graph_compute when true
16652
+ ggml_abort_callback abort_callback; // abort ggml_graph_compute when true
16653
16653
void * abort_callback_data;
16654
16654
};
16655
16655
Original file line number Diff line number Diff line change @@ -567,6 +567,9 @@ extern "C" {
567
567
568
568
static const size_t GGML_TENSOR_SIZE = sizeof (struct ggml_tensor );
569
569
570
+ // Abort callback
571
+ // If not NULL, called before ggml computation
572
+ // If it returns true, the computation is aborted
570
573
typedef bool (* ggml_abort_callback )(void * data );
571
574
572
575
// the compute plan that needs to be prepared for ggml_graph_compute()
You can’t perform that action at this time.
0 commit comments