NNAPI systrace for timing statistics This adds systrace tracing to NNAPI. The tracing will be helpful for: - getting numbers on where time is spent currently - diagnosing and improving performance - benchmarking TODOs: - Write analysis tools for traces Change-Id: I9026f1043428cb715b577901bec3a2e1e39a82e3 Merged-In: I9026f1043428cb715b577901bec3a2e1e39a82e3 Bug: 78137932 Test: manually run systrace.py against unit tests Test: manually run systrace.py against benchmarking app (cherry picked from commit e9e637ab73b68b5982281a3f7c621f6a75d51743)
diff --git a/common/operations/LSTM.cpp b/common/operations/LSTM.cpp index 80b0eb9..7667c66 100644 --- a/common/operations/LSTM.cpp +++ b/common/operations/LSTM.cpp
@@ -19,6 +19,8 @@ #include "CpuExecutor.h" #include "HalInterfaces.h" +#include "Tracing.h" + namespace android { namespace nn { @@ -300,6 +302,8 @@ } bool LSTMCell::Eval() { + NNTRACE_COMP("LSTMCell::Eval"); + const uint32_t n_batch = input_->shape().dimensions[0]; const uint32_t n_input = input_->shape().dimensions[1]; // n_cell and n_output will be the same size when there is no projection.