From cbf6d1d1cb8ec1b65d51c14e77bc959a19f769f1 Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Thu, 29 Oct 2020 13:40:27 -0700 Subject: [PATCH] Remove leading cmsis from the include paths. This was not needed and was an artifact from how the original Arduino integration was done. In fact, having the leading cmsis/ was getting in the way of using a version of CMSIS that was not downloaded via the TFLM Makefiles. This is progress towards addressing #44261 --- tensorflow/lite/micro/kernels/cmsis-nn/add.cc | 2 +- tensorflow/lite/micro/kernels/cmsis-nn/conv.cc | 4 ++-- .../lite/micro/kernels/cmsis-nn/depthwise_conv.cc | 2 +- .../lite/micro/kernels/cmsis-nn/fully_connected.cc | 2 +- tensorflow/lite/micro/kernels/cmsis-nn/mul.cc | 2 +- tensorflow/lite/micro/kernels/cmsis-nn/pooling.cc | 2 +- tensorflow/lite/micro/kernels/cmsis-nn/softmax.cc | 2 +- tensorflow/lite/micro/kernels/cmsis-nn/svdf.cc | 4 ++-- tensorflow/lite/micro/tools/make/Makefile | 1 - .../lite/micro/tools/make/ext_libs/cmsis_nn.inc | 12 ++++++++---- 10 files changed, 18 insertions(+), 15 deletions(-) diff --git a/tensorflow/lite/micro/kernels/cmsis-nn/add.cc b/tensorflow/lite/micro/kernels/cmsis-nn/add.cc index 6db88839073..2816e118271 100644 --- a/tensorflow/lite/micro/kernels/cmsis-nn/add.cc +++ b/tensorflow/lite/micro/kernels/cmsis-nn/add.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/kernels/internal/reference/add.h" -#include "cmsis/CMSIS/NN/Include/arm_nnfunctions.h" +#include "CMSIS/NN/Include/arm_nnfunctions.h" #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/kernels/internal/quantization_util.h" #include "tensorflow/lite/kernels/internal/reference/integer_ops/add.h" diff --git a/tensorflow/lite/micro/kernels/cmsis-nn/conv.cc b/tensorflow/lite/micro/kernels/cmsis-nn/conv.cc index 80a0a2ae748..65e94fcec05 100644 --- a/tensorflow/lite/micro/kernels/cmsis-nn/conv.cc +++ b/tensorflow/lite/micro/kernels/cmsis-nn/conv.cc @@ -15,8 +15,8 @@ limitations under the License. #include "tensorflow/lite/kernels/internal/reference/conv.h" -#include "cmsis/CMSIS/NN/Include/arm_nn_types.h" -#include "cmsis/CMSIS/NN/Include/arm_nnfunctions.h" +#include "CMSIS/NN/Include/arm_nn_types.h" +#include "CMSIS/NN/Include/arm_nnfunctions.h" #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/common.h" diff --git a/tensorflow/lite/micro/kernels/cmsis-nn/depthwise_conv.cc b/tensorflow/lite/micro/kernels/cmsis-nn/depthwise_conv.cc index 3a59b71c985..7715dbe465d 100644 --- a/tensorflow/lite/micro/kernels/cmsis-nn/depthwise_conv.cc +++ b/tensorflow/lite/micro/kernels/cmsis-nn/depthwise_conv.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/kernels/internal/reference/integer_ops/depthwise_conv.h" -#include "cmsis/CMSIS/NN/Include/arm_nnfunctions.h" +#include "CMSIS/NN/Include/arm_nnfunctions.h" #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/common.h" diff --git a/tensorflow/lite/micro/kernels/cmsis-nn/fully_connected.cc b/tensorflow/lite/micro/kernels/cmsis-nn/fully_connected.cc index 9f901d436a1..11a0f0bdc23 100644 --- a/tensorflow/lite/micro/kernels/cmsis-nn/fully_connected.cc +++ b/tensorflow/lite/micro/kernels/cmsis-nn/fully_connected.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/kernels/internal/reference/fully_connected.h" -#include "cmsis/CMSIS/NN/Include/arm_nnfunctions.h" +#include "CMSIS/NN/Include/arm_nnfunctions.h" #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/common.h" diff --git a/tensorflow/lite/micro/kernels/cmsis-nn/mul.cc b/tensorflow/lite/micro/kernels/cmsis-nn/mul.cc index e7e23818f5e..20686500ac8 100644 --- a/tensorflow/lite/micro/kernels/cmsis-nn/mul.cc +++ b/tensorflow/lite/micro/kernels/cmsis-nn/mul.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/kernels/internal/reference/mul.h" -#include "cmsis/CMSIS/NN/Include/arm_nnfunctions.h" +#include "CMSIS/NN/Include/arm_nnfunctions.h" #include "tensorflow/lite/kernels/internal/quantization_util.h" #include "tensorflow/lite/kernels/internal/reference/integer_ops/mul.h" #include "tensorflow/lite/kernels/internal/reference/process_broadcast_shapes.h" diff --git a/tensorflow/lite/micro/kernels/cmsis-nn/pooling.cc b/tensorflow/lite/micro/kernels/cmsis-nn/pooling.cc index cd2d799e734..e1ac2b595a3 100644 --- a/tensorflow/lite/micro/kernels/cmsis-nn/pooling.cc +++ b/tensorflow/lite/micro/kernels/cmsis-nn/pooling.cc @@ -14,7 +14,7 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/kernels/internal/reference/pooling.h" -#include "cmsis/CMSIS/NN/Include/arm_nnfunctions.h" +#include "CMSIS/NN/Include/arm_nnfunctions.h" #include "flatbuffers/base.h" // from @flatbuffers #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/kernels/internal/reference/integer_ops/pooling.h" diff --git a/tensorflow/lite/micro/kernels/cmsis-nn/softmax.cc b/tensorflow/lite/micro/kernels/cmsis-nn/softmax.cc index 60e1a9a88b0..9ca08abe862 100644 --- a/tensorflow/lite/micro/kernels/cmsis-nn/softmax.cc +++ b/tensorflow/lite/micro/kernels/cmsis-nn/softmax.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/kernels/internal/reference/softmax.h" -#include "cmsis/CMSIS/NN/Include/arm_nnfunctions.h" +#include "CMSIS/NN/Include/arm_nnfunctions.h" #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" #include "tensorflow/lite/kernels/kernel_util.h" #include "tensorflow/lite/micro/kernels/kernel_util.h" diff --git a/tensorflow/lite/micro/kernels/cmsis-nn/svdf.cc b/tensorflow/lite/micro/kernels/cmsis-nn/svdf.cc index 16358e62e10..f4ee0c73ccf 100644 --- a/tensorflow/lite/micro/kernels/cmsis-nn/svdf.cc +++ b/tensorflow/lite/micro/kernels/cmsis-nn/svdf.cc @@ -16,8 +16,8 @@ limitations under the License. #include #include -#include "cmsis/CMSIS/NN/Include/arm_nn_types.h" -#include "cmsis/CMSIS/NN/Include/arm_nnfunctions.h" +#include "CMSIS/NN/Include/arm_nn_types.h" +#include "CMSIS/NN/Include/arm_nnfunctions.h" #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/common.h" diff --git a/tensorflow/lite/micro/tools/make/Makefile b/tensorflow/lite/micro/tools/make/Makefile index b28fd19d15e..e63f6616bed 100644 --- a/tensorflow/lite/micro/tools/make/Makefile +++ b/tensorflow/lite/micro/tools/make/Makefile @@ -51,7 +51,6 @@ ALL_TAGS := $(TAGS) $(TARGET) # include directories from one source. INCLUDES := \ -I. \ --I$(MAKEFILE_DIR)/downloads/ \ -I$(MAKEFILE_DIR)/downloads/gemmlowp \ -I$(MAKEFILE_DIR)/downloads/flatbuffers/include \ -I$(MAKEFILE_DIR)/downloads/ruy diff --git a/tensorflow/lite/micro/tools/make/ext_libs/cmsis_nn.inc b/tensorflow/lite/micro/tools/make/ext_libs/cmsis_nn.inc index 053d4584300..b4caadf9252 100644 --- a/tensorflow/lite/micro/tools/make/ext_libs/cmsis_nn.inc +++ b/tensorflow/lite/micro/tools/make/ext_libs/cmsis_nn.inc @@ -118,11 +118,15 @@ ifneq ($(filter cmsis-nn,$(ALL_TAGS)),) $(CMSIS_PATH)CMSIS/NN/Include/arm_nnfunctions.h \ $(CMSIS_PATH)CMSIS/NN/Include/arm_nnsupportfunctions.h - # Need to add the CMSIS Core includes path. - # All other CMSIS header files are included with their relative path - # in the CMSIS-NN micro kernel source files in - # tensorflow/lite/micro/kernels/cmsis-nn + # We add -I$(CMSIS_PATH) to enable the code in the TFLM repo (mostly in the + # tensorflow/lite/micro/kernels/cmsis-nn) to use include paths relative to + # the CMSIS code-base. + # + # The CMSIS code itself uses includes such as #include "arm_math.h" and so + # we add $(CMSIS_PATH)/CMSIS/Core/Include etc. to be able to build the CMSIS + # code without any modifications. INCLUDES += \ + -I$(CMSIS_PATH) \ -I$(CMSIS_PATH)/CMSIS/Core/Include \ -I$(CMSIS_PATH)/CMSIS/DSP/Include \ -I$(CMSIS_PATH)/CMSIS/NN/Include