Finish work on collecting execution duration. Add tests and execution state enforcement.

Fix bug: Execution durations reported by HAL were not
reported properly through NDK.

Ensure execution duration is reported as UINT64_MAX on error paths.

Switch SampleDriver from system_clock to steady_clock.

Clarify, enforce, and validate that several ANeuralNetworksExecution_*
methods must not be called once execution has been scheduled.

Enforce and validate that ANeuralNetworksExecution_setMeasureTiming
can only be called in conjunction with
ANeuralNetworksCompilation_createForDevices with numDevices = 1.

Enforce and validate that ANeuralNetworksExecution_getDuration must
not be called until execution has finished.

Test: NeuralNetworksTest_static
Test: --gtest_filter=IntrospectionControlTest.SimpleAddModel with
      setprop debug.nn.vlog driver,execution; by inspection of logcat,
      verify that driver and runtime report the same duration

Bug: 123376542
Bug: 79265318
Change-Id: I8a091f3f8207669114c10e89f3ed6a08ea241fbb
12 files changed
tree: 2e5a44aa40cb63ce2261ae4565ec48be543888e5
  1. nn/
  2. .clang-format
  3. CleanSpec.mk
  4. OWNERS
  5. PREUPLOAD.cfg