| 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; |
no test coverage detected