Fix Makefile build

Since XNNPACK isn't buildable with Makefile, it should be disabled for Makefile build.

PiperOrigin-RevId: 301790434
Change-Id: Ieff4304f26abb0ec9c7dc90e0be9803aa58e8e98
This commit is contained in:
Terry Heo 2020-03-19 05:03:41 -07:00 committed by TensorFlower Gardener
parent 2decf5694a
commit b9b739285e
3 changed files with 16 additions and 5 deletions

View File

@ -163,7 +163,11 @@ TfLiteDelegatePtr CreateHexagonDelegate(
}
// TODO(b/149248802): include XNNPACK delegate when the issue is resolved.
#if !defined(__Fuchsia__)
#if defined(__Fuchsia__) || defined(TFLITE_WITHOUT_XNNPACK)
TfLiteDelegatePtr CreateXNNPACKDelegate(int num_threads) {
return CreateNullDelegate();
}
#else
TfLiteDelegatePtr CreateXNNPACKDelegate() {
TfLiteXNNPackDelegateOptions xnnpack_options =
TfLiteXNNPackDelegateOptionsDefault();

View File

@ -28,7 +28,7 @@ limitations under the License.
#endif
// TODO(b/149248802): include XNNPACK delegate when the issue is resolved.
#if !defined(__Fuchsia__)
#if !defined(__Fuchsia__) || defined(TFLITE_WITHOUT_XNNPACK)
#include "tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h"
#endif
@ -73,12 +73,12 @@ TfLiteDelegatePtr CreateHexagonDelegate(
const std::string& library_directory_path, bool profiling);
// TODO(b/149248802): include XNNPACK delegate when the issue is resolved.
#if !defined(__Fuchsia__)
#if !defined(__Fuchsia__) || defined(TFLITE_WITHOUT_XNNPACK)
TfLiteDelegatePtr CreateXNNPACKDelegate();
TfLiteDelegatePtr CreateXNNPACKDelegate(
const TfLiteXNNPackDelegateOptions* options);
TfLiteDelegatePtr CreateXNNPACKDelegate(int num_threads);
#endif
TfLiteDelegatePtr CreateXNNPACKDelegate(int num_threads);
} // namespace evaluation
} // namespace tflite

View File

@ -172,6 +172,9 @@ ifeq ($(BUILD_WITH_RUY),true)
CXXFLAGS += -DTFLITE_WITH_RUY
endif
# Not to include XNNPACK.
CXXFLAGS += -DTFLITE_WITHOUT_XNNPACK
BUILD_WITH_NNAPI ?= false
ifeq ($(BUILD_WITH_NNAPI),true)
CORE_CC_ALL_SRCS += tensorflow/lite/delegates/nnapi/nnapi_delegate.cc
@ -212,7 +215,11 @@ BENCHMARK_LIB_SRCS := $(filter-out \
$(wildcard $(BENCHMARK_SRCS_DIR)/*_test.cc) \
$(BENCHMARK_MAIN_SRC) \
$(BENCHMARK_PERF_OPTIONS_SRC) \
$(BENCHMARK_SRCS_DIR)/benchmark_plus_flex_main.cc, \
$(BENCHMARK_SRCS_DIR)/benchmark_plus_flex_main.cc \
$(BENCHMARK_SRCS_DIR)/gpu_delegate_provider.cc \
$(BENCHMARK_SRCS_DIR)/hexagon_delegate_provider.cc \
$(BENCHMARK_SRCS_DIR)/nnapi_delegate_provider.cc \
$(BENCHMARK_SRCS_DIR)/xnnpack_delegate_provider.cc, \
$(BENCHMARK_ALL_SRCS))
# These target-specific makefiles should modify or replace options like