diff options
author | 2016-08-18 10:56:03 -0800 | |
---|---|---|
committer | 2016-08-18 12:02:51 -0700 | |
commit | 34b4c9bd78cfb838489f1bdbd292bb3914bf86e4 (patch) | |
tree | 5456e68f8f7f19ea186162fa5e4d8f99b09bdc77 /tensorflow/contrib/quantization | |
parent | ad0346f6a825078b18bd8bb64d12b4b3602ab375 (diff) |
Add a makefile for tests in contrib/quantization
Change: 130665817
Diffstat (limited to 'tensorflow/contrib/quantization')
-rw-r--r-- | tensorflow/contrib/quantization/Makefile.in | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/tensorflow/contrib/quantization/Makefile.in b/tensorflow/contrib/quantization/Makefile.in new file mode 100644 index 0000000000..656f1d00ea --- /dev/null +++ b/tensorflow/contrib/quantization/Makefile.in @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +# Copyright 2016 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. +# ============================================================================== +# This sub Makefile compiles libraries under this directory. This is designed to +# be used as a sub Makefile with tensorflow/contrib/makefile/Makefile. +# You can build targets in this file by including this sub makefile like: +# $ make -f tensorflow/contrib/makefile/Makefile TARGET=<target> \ +# SUB_MAKEFILES=$(pwd)/tensorflow/contrib/quantization/Makefile.in \ +# (optional: NDK_ROOT=<ndk_root>) contrib_quantization_tests +# TODO(satok): Support more targets + +GTEST_DIR := \ +$(MAKEFILE_DIR)/downloads/googletest/googletest + +GTEST_HEADERS = \ +$(wildcard $(GTEST_DIR)/include/gtest/*.h) \ +$(wildcard $(GTEST_DIR)/include/gtest/internal/*.h) + +GTEST_SRCS := \ +$(wildcard $(GTEST_DIR)/src/*.cc) \ +$(wildcard $(GTEST_DIR)/src/*.h) \ +$(GTEST_HEADERS) + +QUANTIZATION_TEST_SRCS := \ +tensorflow/contrib/quantization/ops/math_ops.cc \ +tensorflow/contrib/quantization/kernels/quantize_op.cc \ +tensorflow/contrib/quantization/kernels/quantized_conv_ops.cc \ +tensorflow/contrib/quantization/kernels/quantized_matmul_op.cc \ +tensorflow/contrib/quantization/kernels/quantized_matmul_op_test.cc \ +tensorflow/contrib/makefile/test/test_main.cc + +QUANTIZATION_TEST_OBJS := $(addprefix $(OBJDIR), $(QUANTIZATION_TEST_SRCS:.cc=.o)) + +QUANTIZATION_TEST_NAME := contrib_quantization_tests +QUANTIZATION_TEST_BIN_PATH := $(BINDIR)$(QUANTIZATION_TEST_NAME) + +INCLUDES += \ +-I$(MAKEFILE_DIR)/downloads/gemmlowp \ +-I$(MAKEFILE_DIR)/downloads/googletest/googletest/include + +QUANTIZATION_TEST_INCLUDES := $(INCLUDES) + +$(OBJDIR)gtest-all.o : $(GTEST_SRCS) + $(CXX) $(CXXFLAGS) $(QUANTIZATION_TEST_INCLUDES) -I $(GTEST_DIR) -c \ + $(GTEST_DIR)/src/gtest-all.cc -o $@ + +$(LIBDIR)gtest.a : $(OBJDIR)gtest-all.o + $(AR) $(ARFLAGS) $@ $^ + +$(QUANTIZATION_TEST_BIN_PATH): $(LIB_PATH) $(LIBDIR)gtest.a $(QUANTIZATION_TEST_OBJS) + @mkdir -p $(dir $@) + $(CXX) $(CXXFLAGS) $(QUANTIZATION_TEST_INCLUDES) \ + -o $(QUANTIZATION_TEST_BIN_PATH) $(QUANTIZATION_TEST_OBJS) \ + $(LIBFLAGS) $(LIB_PATH) $(LIBDIR)gtest.a $(LDFLAGS) $(LIBS) + +$(QUANTIZATION_TEST_NAME): $(QUANTIZATION_TEST_BIN_PATH) |