Reorganize model slicing data structures: Replace IModelSlicer with MetaModel
The previous data structure organization employed an interface class
IModelSlicer that was passed around along with a Model; a
concretization of that class would manufacture and cache slices.
The new data structure organization employs a concrete class
MetaModel that that is passed around in place of a Model;
this class exposes the original Model, and manufactures and caches slices.
Previously, ANeuralNetworksModel_getSupportedOperationsForDevices() did
not perform slicing; now it does.
Also replace uses of std::ostrstream with std::ostringstream.
Bug: 132378048
Test: NeuralNetworksTest_static (with debug.nn.strict-slicing 1)
Test: NeuralNetworksTest_static_fuzzing --gtest_filter=TestRandomGraph/RandomGraphTest.* (with debug.nn.strict-slicing 1)
Change-Id: Iff694b9c8391f601592729a248bff2adeba2332f
Merged-In: Iff694b9c8391f601592729a248bff2adeba2332f
(cherry picked from commit 12f2caf58b7c2928375ab84c8f742e49c37fe9ed)
diff --git a/common/Android.bp b/common/Android.bp
index e16a2a5..4ad2348 100644
--- a/common/Android.bp
+++ b/common/Android.bp
@@ -124,6 +124,7 @@
"GraphDump.cpp",
"IndexedShapeWrapper.cpp",
"MemoryUtils.cpp",
+ "MetaModel.cpp",
"OperationsUtils.cpp",
"TokenHasher.cpp",
"Utils.cpp",