STT-tensorflow/tensorflow/lite/tflite_with_xnnpack_optional.h
Chao Mei e480d8f7ff Add a compile flag (i.e. adding "--define tflite_with_xnnpack=true" when using bazel to build, which corresponds to defining macro TFLITE_BUILD_WITH_XNNPACK_DELEGATE) to apply XNNPACK delegate in TFLite runtime.
This is mainly to support Windows where weak symbols are not supported.

PiperOrigin-RevId: 312011534
Change-Id: I27c6b206b8aa8ded2d2671c2fca843574f75752b
2020-05-17 21:10:25 -07:00

27 lines
1.0 KiB
C++

/* 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_TFLITE_WITH_XNNPACK_OPTIONAL_H_
#define TENSORFLOW_LITE_TFLITE_WITH_XNNPACK_OPTIONAL_H_
#include <memory>
#include "tensorflow/lite/c/common.h"
namespace tflite {
std::unique_ptr<TfLiteDelegate, void (*)(TfLiteDelegate*)>
MaybeCreateXNNPACKDelegate(int num_threads);
} // namespace tflite
#endif // TENSORFLOW_LITE_TFLITE_WITH_XNNPACK_OPTIONAL_H_