| 1902 | } |
| 1903 | |
| 1904 | void ggml_backend_sched_synchronize(ggml_backend_sched_t sched) { |
| 1905 | GGML_ASSERT(sched); |
| 1906 | for (int i = 0; i < sched->n_backends; i++) { |
| 1907 | ggml_backend_synchronize(sched->backends[i]); |
| 1908 | } |
| 1909 | if (!sched->is_alloc) { |
| 1910 | // if the graph is not already allocated, always use copy 0 after a synchronization |
| 1911 | // this ensures that during generation the same copy is used every time, |
| 1912 | // which avoids changes in the graph that could cause CUDA or other graphs to be disabled |
| 1913 | sched->next_copy = 0; |
| 1914 | } |
| 1915 | } |
| 1916 | |
| 1917 | void ggml_backend_sched_set_eval_callback(ggml_backend_sched_t sched, ggml_backend_sched_eval_callback callback, void * user_data) { |
| 1918 | GGML_ASSERT(sched); |
no test coverage detected