mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-26 23:29:53 +00:00
fix: delete 2 unused functions, fixing linking against shared libggml-1.0.0 (#2363)
This commit is contained in:
parent
9860a9281c
commit
f0816c9ade
4 changed files with 0 additions and 66 deletions
|
|
@ -151,17 +151,6 @@ bool ggml_graph_cpy_use_counts(const ggml_cgraph* src, ggml_cgraph* dst) {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
ggml_status ggml_backend_graph_compute_async_range(ggml_backend_t backend, ggml_cgraph* graph, int first, int last) {
|
||||
if (!backend || !graph || first < 0 || last < first || last > graph->n_nodes) {
|
||||
return GGML_STATUS_FAILED;
|
||||
}
|
||||
if (first == last) {
|
||||
return GGML_STATUS_SUCCESS;
|
||||
}
|
||||
auto view = ggml_graph_view(graph, first, last);
|
||||
return ggml_backend_graph_compute_async(backend, &view);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SD_USE_UPSTREAM_GGML
|
||||
|
|
|
|||
|
|
@ -29,13 +29,6 @@ bool ggml_graph_cpy_mapped(const struct ggml_cgraph* src, struct ggml_cgraph* ds
|
|||
// This preserves external consumers when constructing an inference graph segment.
|
||||
bool ggml_graph_cpy_use_counts(const struct ggml_cgraph* src, struct ggml_cgraph* dst);
|
||||
|
||||
// Executes nodes [first, last) with the original graph's use counts. No graph ownership
|
||||
// is transferred. Tensor storage must already be allocated; invalid bounds fail.
|
||||
enum ggml_status ggml_backend_graph_compute_async_range(ggml_backend_t backend,
|
||||
struct ggml_cgraph* graph,
|
||||
int first,
|
||||
int last);
|
||||
|
||||
#else
|
||||
#error "Patched ggml requires ggml-graph.h; select SD_USE_UPSTREAM_GGML for upstream compatibility"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -638,50 +638,6 @@ void sd_backend_clear_buffer_cache(ggml_backend_t backend) {
|
|||
}
|
||||
}
|
||||
|
||||
ggml_status sd_backend_graph_compute_with_eval_callback(ggml_backend_t backend,
|
||||
ggml_cgraph* gf,
|
||||
sd_graph_eval_callback_t callback_eval,
|
||||
void* callback_eval_user_data) {
|
||||
if (callback_eval == nullptr) {
|
||||
return ggml_backend_graph_compute(backend, gf);
|
||||
}
|
||||
|
||||
ggml_status status = GGML_STATUS_SUCCESS;
|
||||
const int n_nodes = ggml_graph_n_nodes(gf);
|
||||
bool stopped = false;
|
||||
|
||||
for (int j0 = 0; j0 < n_nodes; ++j0) {
|
||||
ggml_tensor* t = ggml_graph_node(gf, j0);
|
||||
bool need = callback_eval(t, true, callback_eval_user_data);
|
||||
int j1 = j0;
|
||||
|
||||
while (!need && j1 < n_nodes - 1) {
|
||||
t = ggml_graph_node(gf, ++j1);
|
||||
need = callback_eval(t, true, callback_eval_user_data);
|
||||
}
|
||||
|
||||
status = ggml_backend_graph_compute_async_range(backend, gf, j0, j1 + 1);
|
||||
if (status != GGML_STATUS_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
|
||||
ggml_backend_synchronize(backend);
|
||||
|
||||
if (need && !callback_eval(t, false, callback_eval_user_data)) {
|
||||
stopped = true;
|
||||
break;
|
||||
}
|
||||
|
||||
j0 = j1;
|
||||
}
|
||||
|
||||
ggml_backend_synchronize(backend);
|
||||
if (stopped && status == GGML_STATUS_SUCCESS) {
|
||||
status = GGML_STATUS_ABORTED;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
const char* sd_get_system_info() {
|
||||
static std::string cache_info = []() -> std::string {
|
||||
ggml_backend_load_all_once();
|
||||
|
|
|
|||
|
|
@ -99,10 +99,6 @@ bool sd_backend_cpu_set_n_threads(ggml_backend_t backend_cpu, int n_threads);
|
|||
void sd_backend_set_buffer_cache_enabled(ggml_backend_t backend, bool enabled);
|
||||
void sd_backend_clear_buffer_cache(ggml_backend_t backend);
|
||||
|
||||
ggml_status sd_backend_graph_compute_with_eval_callback(ggml_backend_t backend,
|
||||
ggml_cgraph* gf,
|
||||
sd_graph_eval_callback_t callback_eval,
|
||||
void* callback_eval_user_data);
|
||||
std::string sd_backend_resolve_name(const std::string& name);
|
||||
bool sd_parse_backend_assignment(const std::string& spec, SDBackendAssignment* assignment, std::string* error);
|
||||
bool sd_parse_flash_attention_assignment(const std::string& spec, SDBackendAssignment* assignment, std::string* error);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue