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

Method eval

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

Source from the content-addressed store, hash-verified

1294 }
1295
1296 test_status_t eval(ggml_backend_t backend1,
1297 ggml_backend_t backend2,
1298 const char * op_names_filter,
1299 printer * output_printer) {
1300 mode = MODE_TEST;
1301
1302 ggml_init_params params = {
1303 /* .mem_size = */ ggml_tensor_overhead()*128 + ggml_graph_overhead(),
1304 /* .mem_base = */ NULL,
1305 /* .no_alloc = */ true,
1306 };
1307 ggml_context * ctx = ggml_init(params);
1308 GGML_ASSERT(ctx);
1309
1310 gf = ggml_new_graph(ctx);
1311
1312 // pre-graph sentinel
1313 add_sentinel(ctx);
1314
1315 ggml_tensor * out = build_graph(ctx);
1316 current_op_name = op_desc(out);
1317 check_for_f16_tensor(ctx);
1318
1319 if (!matches_filter(out, op_names_filter)) {
1320 //printf(" %s: skipping\n", op_desc(out).c_str());
1321 ggml_free(ctx);
1322 return test_status_t::SKIPPED;
1323 }
1324
1325 // check if the backends support the ops
1326 bool supported = true;
1327 for (ggml_backend_t backend : {backend1, backend2}) {
1328 for (ggml_tensor * t = ggml_get_first_tensor(ctx); t != NULL; t = ggml_get_next_tensor(ctx, t)) {
1329 if (!ggml_backend_supports_op(backend, t)) {
1330 supported = false;
1331 break;
1332 }
1333 }
1334 }
1335
1336 if (!supported) {
1337 // Create test result for unsupported operation
1338 test_result result(ggml_backend_name(backend1), current_op_name, vars(), "test",
1339 false, false, "not supported");
1340
1341 if (output_printer) {
1342 output_printer->print_test_result(result);
1343 }
1344
1345 ggml_free(ctx);
1346 return test_status_t::NOT_SUPPORTED;
1347 }
1348
1349 // post-graph sentinel
1350 add_sentinel(ctx);
1351
1352 // allocate
1353 ggml_backend_buffer_t buf = ggml_backend_alloc_ctx_tensors(ctx, backend1);

Callers 15

prepare_streaming_modelFunction · 0.80
__init__Method · 0.80
mainFunction · 0.80
miocodec_loaderFunction · 0.80
miotts_loaderFunction · 0.80
kokoro_loaderFunction · 0.80
pocket_tts_loaderFunction · 0.80
moss_tts_loaderFunction · 0.80
roformer_loaderFunction · 0.80
sortformer_loaderFunction · 0.80
convert_checkpointFunction · 0.80
load_reference_modelFunction · 0.80

Calls 15

ggml_tensor_overheadFunction · 0.85
ggml_graph_overheadFunction · 0.85
ggml_initFunction · 0.85
ggml_new_graphFunction · 0.85
op_descClass · 0.85
ggml_freeFunction · 0.85
ggml_get_first_tensorFunction · 0.85
ggml_get_next_tensorFunction · 0.85
ggml_backend_supports_opFunction · 0.85
ggml_backend_nameFunction · 0.85

Tested by

no test coverage detected