From 864867d341a62dabde8b3a0e9780d9ef8c57bdd9 Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Wed, 17 Feb 2021 16:05:56 -0800 Subject: [PATCH] Fix the Xtensa Vision P6 build. https://github.com/tensorflow/tensorflow/pull/47199 broke the Vision P6 build with the following error message: ``` tensorflow/lite/micro/kernels/xtensa/quantize.cc:144:5: error: static_assert failed "Unsupported xtensa architecture." static_assert(false, "Unsupported xtensa architecture."); ``` Manually confirmed that with this change, the following command passes: ``` make -f tensorflow/lite/micro/tools/make/Makefile TARGET=xtensa OPTIMIZED_KERNEL_DIR=xtensa TARGET_ARCH=vision_p6 XTENSA_CORE=P6_200528 test -j8 ``` --- tensorflow/lite/micro/kernels/xtensa/quantize.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tensorflow/lite/micro/kernels/xtensa/quantize.cc b/tensorflow/lite/micro/kernels/xtensa/quantize.cc index 5418c69d18e..e5b5a07a35d 100644 --- a/tensorflow/lite/micro/kernels/xtensa/quantize.cc +++ b/tensorflow/lite/micro/kernels/xtensa/quantize.cc @@ -111,6 +111,7 @@ void AffineQuantize(int scale_multiplier, const int32_t zero_point, #endif // defined(HIFIMINI) +#if defined(HIFIMINI) || defined(FUSION_F1) TfLiteStatus EvalXtensa(TfLiteContext* context, TfLiteNode* node) { TFLITE_DCHECK(node->user_data != nullptr); #if defined(HIFIMINI) @@ -167,6 +168,7 @@ TfLiteStatus EvalXtensa(TfLiteContext* context, TfLiteNode* node) { } return kTfLiteOk; } +#endif // defined(HIFIMINI) || defined(FUSION_F1) void* Init(TfLiteContext* context, const char* buffer, size_t length) { TFLITE_DCHECK(context->AllocatePersistentBuffer != nullptr);