aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/allocation.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-06-29 15:23:59 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-29 15:26:40 -0700
commitb933865ed6bb2c04b74df45e3e2ab6a88faf7990 (patch)
treec35984f157fe6cbad47c2f955998b2a5514f25e6 /tensorflow/contrib/lite/allocation.cc
parent234aade2123d7927822dd421cbcd219be25f105e (diff)
Add support for Makefile build for micro-controller platforms
PiperOrigin-RevId: 202716942
Diffstat (limited to 'tensorflow/contrib/lite/allocation.cc')
-rw-r--r--tensorflow/contrib/lite/allocation.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/allocation.cc b/tensorflow/contrib/lite/allocation.cc
index a4772731ec..c42622ff02 100644
--- a/tensorflow/contrib/lite/allocation.cc
+++ b/tensorflow/contrib/lite/allocation.cc
@@ -14,7 +14,9 @@ limitations under the License.
==============================================================================*/
#include <fcntl.h>
+#ifndef TFLITE_MCU
#include <sys/mman.h>
+#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@@ -27,10 +29,13 @@ limitations under the License.
#include "tensorflow/contrib/lite/allocation.h"
#include "tensorflow/contrib/lite/context.h"
#include "tensorflow/contrib/lite/error_reporter.h"
+#ifndef TFLITE_MCU
#include "tensorflow/contrib/lite/nnapi_delegate.h"
+#endif
namespace tflite {
+#ifndef TFLITE_MCU
MMAPAllocation::MMAPAllocation(const char* filename,
ErrorReporter* error_reporter)
: Allocation(error_reporter), mmapped_buffer_(MAP_FAILED) {
@@ -111,6 +116,7 @@ MemoryAllocation::MemoryAllocation(const void* ptr, size_t num_bytes,
buffer_ = ptr;
buffer_size_bytes_ = num_bytes;
}
+#endif
MemoryAllocation::~MemoryAllocation() {}