MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / child_benchmark

Function child_benchmark

examples/benchmark.cpp:302–315  ·  view source on GitHub ↗

POSIX: fork a subprocess for crash isolation

Source from the content-addressed store, hash-verified

300#ifndef _WIN32
301// POSIX: fork a subprocess for crash isolation
302static void child_benchmark(const std::string & model_path,
303 bool use_gpu,
304 const std::string & video_path,
305 int n_frames,
306 float px, float py,
307 int n_threads,
308 int encode_img_size,
309 int write_fd) {
310 BenchWire wire = run_single_benchmark(model_path, use_gpu, video_path,
311 n_frames, px, py, n_threads, encode_img_size);
312 (void)write(write_fd, &wire, sizeof(wire));
313 close(write_fd);
314 _exit(wire.ok ? 0 : 1);
315}
316#endif
317
318static BenchResult run_benchmark_isolated(const ModelEntry & entry,

Callers 1

run_benchmark_isolatedFunction · 0.85

Calls 1

run_single_benchmarkFunction · 0.85

Tested by

no test coverage detected