tflite: Extract core computation from sample delegate kernel

This CL extracts the core computation part from the sample delegate
kernel. This common core would be used by both sync and async kernels.

A new method SetExternalTensorMemory() is added to allow providing
cpu-accessible memory for external tensors, either allocated by TFLite
runtime or registered by application via async kernel API.

BUG=b:305999697
TEST=Pass DTS locally with sample delegate.

Change-Id: I4ae8d42af92ebe1ce41c6a8e39fee587a28a2704
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tflite/+/5367488
Commit-Queue: Shik Chen <shik@chromium.org>
Reviewed-by: Tommy Chiang <ototot@google.com>
Tested-by: Shik Chen <shik@chromium.org>
5 files changed