POSIX: fork a subprocess for crash isolation
| 300 | #ifndef _WIN32 |
| 301 | // POSIX: fork a subprocess for crash isolation |
| 302 | static 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 | |
| 318 | static BenchResult run_benchmark_isolated(const ModelEntry & entry, |
no test coverage detected