Wrap the CpuExecutor as a device during execution step.

Create a common interface for abstraction of NNAPI CPU preparedModel
as well as the actual driver preparedModels. Modify the execution
builder to use Device and PreparedModel.

Prior to this CL, the driver and cpu execution path have non-trivial
difference related to data copying:

* In the driver execution path, since HIDL cannot take raw pointers,
  we allocate separate memory pools for inputs and outputs specified
  by pointers.

* In the cpu execution path, we take the raw points directly with no
  additional data copying.

This behavior is not changed in this CL: the execute interface of
PreparedModel uses ModelArgumentInfo as Request and MemoryTracker as
memory pool directly, so that the driver path can append new memory
pools and update data location info.

Fix: 123178652
Bug: 70692640
Bug: 72506261
Test: NNT_static
Change-Id: Ifa58bfe1b6e4a9d7e4c1752bb1109f7f5878718c
9 files changed
tree: 0ac31717c540552504b5e81d01f5db67bfc96ac2
  1. nn/
  2. .clang-format
  3. CleanSpec.mk
  4. CPPLINT.cfg
  5. OWNERS
  6. PREUPLOAD.cfg