MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / validate_backend_graph_supported

Function validate_backend_graph_supported

src/framework/core/backend.cpp:220–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220void validate_backend_graph_supported(ggml_backend_t backend, ggml_cgraph * graph, const char * label) {
221 if (backend == nullptr || graph == nullptr) {
222 throw std::runtime_error("Cannot validate backend graph support for null backend or graph");
223 }
224 const int nodes = ggml_graph_n_nodes(graph);
225 for (int i = 0; i < nodes; ++i) {
226 ggml_tensor * node = ggml_graph_node(graph, i);
227 if (node != nullptr && !ggml_backend_supports_op(backend, node)) {
228 const char * graph_label = label != nullptr ? label : "graph";
229 std::string op_name = ggml_op_name(node->op);
230 if (node->op == GGML_OP_UNARY) {
231 op_name += "/";
232 op_name += ggml_unary_op_name(ggml_get_unary_op(node));
233 }
234 throw std::runtime_error(
235 std::string(graph_label) +
236 " contains unsupported backend op '" +
237 op_name +
238 "' at node " +
239 std::to_string(i) +
240 " tensor '" +
241 (node->name[0] != '\0' ? node->name : "<unnamed>") +
242 "'");
243 }
244 }
245}
246
247BackendMemorySnapshot query_backend_memory(ggml_backend_t backend, int device_hint) {
248 BackendMemorySnapshot snapshot;

Callers 1

compute_backend_graphFunction · 0.85

Calls 8

ggml_graph_n_nodesFunction · 0.85
ggml_graph_nodeFunction · 0.85
ggml_backend_supports_opFunction · 0.85
ggml_op_nameFunction · 0.85
ggml_unary_op_nameFunction · 0.85
ggml_get_unary_opFunction · 0.85
stringFunction · 0.50
to_stringFunction · 0.50

Tested by

no test coverage detected