Skip to content

Commit

Permalink
Add option to redirect stdout and stdcerr to a file for xcrun compati…
Browse files Browse the repository at this point in the history
…bility

Summary:
XCRun doesn't provide a convenient way to gather logs or know when a program has completed execution. (This is recognized by the dev community: see ios-control/ios-deploy#588 )

We'll solve this by redirecting `stdout` and `stderr` to a file called `/tmp/BENCH_LOG`. Once the benchmark is complete, we'll create an empty file called `/tmp/BENCH_DONE` that we can poll for (let's say, every 5 seconds) to check whether the benchmark has completed.

Reviewed By: Jack-Khuu

Differential Revision: D53255873
  • Loading branch information
Varun Puri authored and facebook-github-bot committed Feb 13, 2024
1 parent f95d88f commit da6e888
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backends/xnnpack/runtime/profiling/XNNProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ void XNNProfiler::log_operator_timings() {
Info, ">>, %s, %" PRId64 " (%f)", op_name, op_timings_[i], avg_op_time);
}
ET_LOG(Info, ">>, Total Time, %f", total_time);
#else
run_count_++;
#endif
}

Expand Down

0 comments on commit da6e888

Please sign in to comment.