| 1583 | } |
| 1584 | |
| 1585 | bool eval_support(ggml_backend_t backend, const char * op_names_filter, printer * output_printer) { |
| 1586 | mode = MODE_SUPPORT; |
| 1587 | |
| 1588 | static const size_t graph_nodes = 8192; |
| 1589 | |
| 1590 | ggml_init_params params = { |
| 1591 | /* .mem_size = */ ggml_tensor_overhead()*128 + ggml_graph_overhead_custom(graph_nodes, false), |
| 1592 | /* .mem_base = */ NULL, |
| 1593 | /* .no_alloc = */ true, |
| 1594 | }; |
| 1595 | ggml_context_ptr ctx(ggml_init(params)); // smart ptr |
| 1596 | GGML_ASSERT(ctx); |
| 1597 | |
| 1598 | gf = ggml_new_graph_custom(ctx.get(), graph_nodes, false); |
| 1599 | |
| 1600 | ggml_tensor * out = build_graph(ctx.get()); |
| 1601 | current_op_name = op_desc(out); |
| 1602 | |
| 1603 | if (!matches_filter(out, op_names_filter)) { |
| 1604 | return true; |
| 1605 | } |
| 1606 | |
| 1607 | bool supported = ggml_backend_supports_op(backend, out); |
| 1608 | |
| 1609 | std::string device_desc = ggml_backend_dev_description(ggml_backend_get_device(backend)); |
| 1610 | std::string backend_reg_name = ggml_backend_reg_name(ggml_backend_dev_backend_reg(ggml_backend_get_device(backend))); |
| 1611 | |
| 1612 | test_result result(ggml_backend_name(backend), current_op_name, vars(), "support", supported, supported, |
| 1613 | supported ? "yes" : "no", 0.0, 0.0, 0.0, 0, 0, device_desc, backend_reg_name); |
| 1614 | |
| 1615 | output_printer->print_test_result(result); |
| 1616 | |
| 1617 | return true; |
| 1618 | } |
| 1619 | |
| 1620 | bool eval_grad(ggml_backend_t backend, const char * op_names_filter, printer * output_printer) { |
| 1621 | mode = MODE_GRAD; |
no test coverage detected