Merge pull request #45619 from advaitjain:xtensa-p6-build

PiperOrigin-RevId: 347839017
Change-Id: I44c9085788f1e257ba4379f81e3abce72ac7f807
This commit is contained in:
TensorFlower Gardener 2020-12-16 09:49:14 -08:00
commit 93cbb1451a
8 changed files with 58 additions and 13 deletions

View File

@ -34,7 +34,9 @@ cc_library(
],
}),
copts = micro_copts(),
deps = select({
deps = [
":xtensa",
] + select({
"//conditions:default": [],
":xtensa_hifimini": [
#"//third_party/xtensa/cstub64s:hifi_mini",
@ -62,6 +64,7 @@ cc_library(
deps = [
":fixedpoint_utils",
":kernel_util",
":xtensa",
"//tensorflow/lite/c:common",
"//tensorflow/lite/kernels:kernel_util",
"//tensorflow/lite/kernels/internal:common",
@ -162,6 +165,7 @@ cc_library(
":kernel_util",
":fixedpoint_utils",
":micro_utils",
":xtensa",
"//tensorflow/lite/c:common",
"//tensorflow/lite/kernels:kernel_util",
"//tensorflow/lite/kernels:op_macros",
@ -183,6 +187,24 @@ cc_library(
}),
)
cc_library(
name = "xtensa",
hdrs = select({
"//conditions:default": [
],
":xtensa_hifimini": [
"xtensa/xtensa.h",
],
}),
copts = micro_copts(),
deps = select({
"//conditions:default": [],
":xtensa_hifimini": [
#"//third_party/xtensa/cstub64s:hifi_mini",
],
}),
)
test_suite(
name = "all_tests",
)

View File

@ -15,8 +15,6 @@ limitations under the License.
#include "tensorflow/lite/kernels/internal/reference/conv.h"
#include <xtensa/tie/xt_hifi2.h>
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/common.h"
@ -27,6 +25,7 @@ limitations under the License.
#include "tensorflow/lite/kernels/padding.h"
#include "tensorflow/lite/micro/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/xtensa/fixedpoint_utils.h"
#include "tensorflow/lite/micro/kernels/xtensa/xtensa.h"
namespace tflite {
namespace {

View File

@ -15,8 +15,6 @@ limitations under the License.
#include "tensorflow/lite/kernels/internal/reference/integer_ops/depthwise_conv.h"
#include <xtensa/tie/xt_hifi2.h>
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/common.h"
@ -28,6 +26,7 @@ limitations under the License.
#include "tensorflow/lite/kernels/padding.h"
#include "tensorflow/lite/micro/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/xtensa/fixedpoint_utils.h"
#include "tensorflow/lite/micro/kernels/xtensa/xtensa.h"
namespace tflite {
namespace {

View File

@ -16,16 +16,17 @@ limitations under the License.
#ifndef TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_HIFIMINI_FIXEDPOINT_UTILS_H_
#define TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_HIFIMINI_FIXEDPOINT_UTILS_H_
#include <xtensa/tie/xt_hifi2.h>
#include <algorithm>
#include <cmath>
#include <cstdint>
#include "tensorflow/lite/kernels/internal/compatibility.h"
#include "tensorflow/lite/micro/kernels/xtensa/xtensa.h"
namespace tflite {
#if defined(HIFIMINI)
// INT24 MIN/MAX
#define INT24_MIN -8388608
#define INT24_MAX 8388607
@ -132,6 +133,8 @@ inline int CreateQConstantForInt24(int integer_bits, float f) {
return static_cast<int>(raw);
}
#endif // defined(HIFIMINI)
} // namespace tflite
#endif // TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_HIFIMINI_FIXEDPOINT_UTILS_H_

View File

@ -15,8 +15,6 @@ limitations under the License.
#include "tensorflow/lite/kernels/internal/reference/fully_connected.h"
#include <xtensa/tie/xt_hifi2.h>
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/common.h"
@ -26,6 +24,7 @@ limitations under the License.
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/xtensa/fixedpoint_utils.h"
#include "tensorflow/lite/micro/kernels/xtensa/xtensa.h"
namespace tflite {
namespace {

View File

@ -15,16 +15,16 @@ limitations under the License.
#include "tensorflow/lite/kernels/internal/reference/quantize.h"
#include <xtensa/tie/xt_hifi2.h>
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/quantization_util.h"
#include "tensorflow/lite/kernels/internal/reference/quantize.h"
#include "tensorflow/lite/kernels/internal/reference/requantize.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/quantize.h"
#include "tensorflow/lite/micro/kernels/xtensa/fixedpoint_utils.h"
#include "tensorflow/lite/micro/kernels/xtensa/xtensa.h"
#include "tensorflow/lite/micro/micro_utils.h"
namespace tflite {

View File

@ -15,8 +15,7 @@ limitations under the License.
#include "tensorflow/lite/micro/kernels/svdf.h"
#include <math.h>
#include <xtensa/tie/xt_hifi2.h>
#include <cmath>
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
@ -28,6 +27,7 @@ limitations under the License.
#include "tensorflow/lite/micro/kernels/activation_utils.h"
#include "tensorflow/lite/micro/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/xtensa/fixedpoint_utils.h"
#include "tensorflow/lite/micro/kernels/xtensa/xtensa.h"
namespace tflite {
namespace {

View File

@ -0,0 +1,23 @@
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_XTENSA_H_
#define TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_XTENSA_H_
#if defined(HIFIMINI)
#include <xtensa/tie/xt_hifi2.h>
#endif
#endif // TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_XTENSA_H_