MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / eval

Method eval

tests/test-backend-ops.cpp:1280–1453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

test_backendFunction · 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