diff options
author | David Gross <dgross@google.com> | 2017-09-13 19:24:00 -0700 |
---|---|---|
committer | David Gross <dgross@google.com> | 2017-09-13 19:24:00 -0700 |
commit | 65aa556323f4a054f80a75b6c4c721b2a7ed3298 (patch) | |
tree | 45df3b3eea95f3e87edb11dd34029ba4378b6eb0 /nn/runtime/test/TestGenerated.cpp | |
parent | 7612f29b31f97f3b15769264131566b36dea9a25 (diff) | |
download | ml-65aa556323f4a054f80a75b6c4c721b2a7ed3298.tar.gz |
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
Diffstat (limited to 'nn/runtime/test/TestGenerated.cpp')
-rw-r--r-- | nn/runtime/test/TestGenerated.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nn/runtime/test/TestGenerated.cpp b/nn/runtime/test/TestGenerated.cpp index 47183e91c..cbe5b4bb4 100644 --- a/nn/runtime/test/TestGenerated.cpp +++ b/nn/runtime/test/TestGenerated.cpp @@ -48,7 +48,7 @@ class Example { bool error = false; for (auto& example : examples) { Compilation compilation(&model); - compilation.compile(); + compilation.finish(); Execution execution(&compilation); // Go through all inputs @@ -109,7 +109,7 @@ class Example { MixedTyped& golden = example.second; Compilation compilation(&model); - compilation.compile(); + compilation.finish(); Execution execution(&compilation); // Go through all ty-typed inputs |