diff options
author | Xusong Wang <xusongw@google.com> | 2019-01-14 16:31:15 -0800 |
---|---|---|
committer | Miao Wang <miaowang@google.com> | 2019-01-24 18:08:07 -0800 |
commit | f5d41baffcf51fa91880d6ab792accf0e5b2c9ed (patch) | |
tree | a6130a6ed55d89c6ab586aaeca9d57c9f41e7b44 /nn/runtime/test/TestNeuralNetworksWrapper.h | |
parent | 388c0ef3dd596fc4aa5e554ef4860125e05ce6c7 (diff) | |
download | ml-f5d41baffcf51fa91880d6ab792accf0e5b2c9ed.tar.gz |
Implement NDK interface for NNAPI compilation caching.
Add a new NDK API ANeuralNetworksCompilation_setCaching to set caching
information for the compilation object.
Create validation tests for the new API.
Bug: 119616526
Test: NeuralNetworksTest_static
Change-Id: I96638073ba39b26a982588e9868e35a49809014b
Merged-In: I96638073ba39b26a982588e9868e35a49809014b
(cherry picked from commit 7481a7afa7a55cf790f239f947468b389bf7db22)
Diffstat (limited to 'nn/runtime/test/TestNeuralNetworksWrapper.h')
-rw-r--r-- | nn/runtime/test/TestNeuralNetworksWrapper.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nn/runtime/test/TestNeuralNetworksWrapper.h b/nn/runtime/test/TestNeuralNetworksWrapper.h index 6a0551b8b..73c8dbe10 100644 --- a/nn/runtime/test/TestNeuralNetworksWrapper.h +++ b/nn/runtime/test/TestNeuralNetworksWrapper.h @@ -24,6 +24,7 @@ #include <math.h> #include <optional> +#include <string> #include <vector> namespace android { @@ -329,6 +330,11 @@ class Compilation { mCompilation, static_cast<int32_t>(preference))); } + Result setCaching(const std::string& cacheDir, const std::vector<uint8_t>& token) { + return static_cast<Result>(ANeuralNetworksCompilation_setCaching( + mCompilation, cacheDir.c_str(), token.data())); + } + Result finish() { return static_cast<Result>(ANeuralNetworksCompilation_finish(mCompilation)); } ANeuralNetworksCompilation* getHandle() const { return mCompilation; } |