Make Compilation API synchronous.
Per advice from the API council, the Compilation API no longer exposes
asynchronous behavior to the user -- rather than start() and wait()
APIs, we now have a finish() API.
Also:
- Track whether or not Compilation::finish() has been invoked, for
the sake of API usage checking.
- Changed Model::finish() to return Result not int, for consistency.
- Made Model and Compilation documentation more similar to one another.
- Fixed typos in documentation.
NOTE: It's possible to implement compilation asynchronously behind the
synchronous API -- e.g., Compilation_finish() starts compilation
asynchronously, and we implicitly wait for it to complete at the point of
Request_startCompute(). However, this would defeat one of the purposes of
an explicit Compilation API -- giving the application control over when
to spend the time compiling, to keep it off a critical timing path, such
as repeatedly applying a model to a sequence of frames in real time.
Bug: 63905942
Test: nn/runtime/tests
Change-Id: I7194e277aa6211af66794d917dcc5254c7d81af4
16 files changed