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

Method eval_support

external/ggml/tests/test-backend-ops.cpp:1602–1635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1600 }
1601
1602 bool eval_support(ggml_backend_t backend, const char * op_names_filter, printer * output_printer) {
1603 mode = MODE_SUPPORT;
1604
1605 static const size_t graph_nodes = 8192;
1606
1607 ggml_init_params params = {
1608 /* .mem_size = */ ggml_tensor_overhead()*128 + ggml_graph_overhead_custom(graph_nodes, false),
1609 /* .mem_base = */ NULL,
1610 /* .no_alloc = */ true,
1611 };
1612 ggml_context_ptr ctx(ggml_init(params)); // smart ptr
1613 GGML_ASSERT(ctx);
1614
1615 gf = ggml_new_graph_custom(ctx.get(), graph_nodes, false);
1616
1617 ggml_tensor * out = build_graph(ctx.get());
1618 current_op_name = op_desc(out);
1619
1620 if (!matches_filter(out, op_names_filter)) {
1621 return true;
1622 }
1623
1624 bool supported = ggml_backend_supports_op(backend, out);
1625
1626 std::string device_desc = ggml_backend_dev_description(ggml_backend_get_device(backend));
1627 std::string backend_reg_name = ggml_backend_reg_name(ggml_backend_dev_backend_reg(ggml_backend_get_device(backend)));
1628
1629 test_result result(ggml_backend_name(backend), current_op_name, vars(), "support", supported, supported,
1630 supported ? "yes" : "no", 0.0, 0.0, 0.0, 0, 0, device_desc, backend_reg_name);
1631
1632 output_printer->print_test_result(result);
1633
1634 return true;
1635 }
1636
1637 bool eval_grad(ggml_backend_t backend, const char * op_names_filter, printer * output_printer) {
1638 mode = MODE_GRAD;

Callers 1

test_backendFunction · 0.80

Calls 14

ggml_tensor_overheadFunction · 0.85
ggml_initFunction · 0.85
ggml_new_graph_customFunction · 0.85
op_descClass · 0.85
ggml_backend_supports_opFunction · 0.85
ggml_backend_get_deviceFunction · 0.85
ggml_backend_reg_nameFunction · 0.85
ggml_backend_nameFunction · 0.85
build_graphFunction · 0.70

Tested by

no test coverage detected