From 5e641c88033a4670c9235d63d4463f2dc4113db6 Mon Sep 17 00:00:00 2001 From: Robert Ogden Date: Fri, 14 Jul 2023 14:42:11 -0700 Subject: [PATCH] remove xnnpack from cpu delegate --- .../tensor/inference_calculator_cpu.cc | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/third_party/mediapipe/src/mediapipe/calculators/tensor/inference_calculator_cpu.cc b/third_party/mediapipe/src/mediapipe/calculators/tensor/inference_calculator_cpu.cc index 4c8ba21ad6a6f..3374566c55536 100644 --- a/third_party/mediapipe/src/mediapipe/calculators/tensor/inference_calculator_cpu.cc +++ b/third_party/mediapipe/src/mediapipe/calculators/tensor/inference_calculator_cpu.cc @@ -33,7 +33,6 @@ #if defined(MEDIAPIPE_ANDROID) #include "tensorflow/lite/delegates/nnapi/nnapi_delegate.h" #endif // ANDROID -#include "tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h" namespace mediapipe { namespace api2 { @@ -109,7 +108,6 @@ InferenceCalculatorCpuImpl::MaybeCreateDelegate(CalculatorContext* cc) { input_side_packet_delegate = kDelegate(cc).Get(); RET_CHECK( input_side_packet_delegate.has_tflite() || - input_side_packet_delegate.has_xnnpack() || input_side_packet_delegate.has_nnapi() || input_side_packet_delegate.delegate_case() == mediapipe::InferenceCalculatorOptions::Delegate::DELEGATE_NOT_SET) @@ -146,20 +144,6 @@ InferenceCalculatorCpuImpl::MaybeCreateDelegate(CalculatorContext* cc) { } #endif // MEDIAPIPE_ANDROID -#if defined(__EMSCRIPTEN__) || MEDIAPIPE_FORCE_CPU_INFERENCE - const bool use_xnnpack = true; -#else - const bool use_xnnpack = opts_has_delegate && opts_delegate.has_xnnpack(); -#endif // defined(__EMSCRIPTEN__) - - if (use_xnnpack) { - auto xnnpack_opts = TfLiteXNNPackDelegateOptionsDefault(); - xnnpack_opts.num_threads = - GetXnnpackNumThreads(opts_has_delegate, opts_delegate); - return TfLiteDelegatePtr(TfLiteXNNPackDelegateCreate(&xnnpack_opts), - &TfLiteXNNPackDelegateDelete); - } - return nullptr; } -- 2.48.0.rc2.279.g1de40edade-goog