提交 e175a1fc 编写于 作者: L Liangliang He

Fix no return error

上级 1359d640
...@@ -10,7 +10,7 @@ load("//mace:mace.bzl", "if_embed_binary_program") ...@@ -10,7 +10,7 @@ load("//mace:mace.bzl", "if_embed_binary_program")
cc_library( cc_library(
name = "generated_models_lib", name = "generated_models_lib",
srcs = glob(["models/*/*.cc"]), srcs = glob(["models/*/*.cc"]),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
"//mace/core", "//mace/core",
...@@ -25,21 +25,21 @@ cc_library( ...@@ -25,21 +25,21 @@ cc_library(
cc_library( cc_library(
name = "generated_opencl_lib", name = "generated_opencl_lib",
srcs = glob(["opencl/*.cc"]), srcs = glob(["opencl/*.cc"]),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1, linkstatic = 1,
) )
cc_library( cc_library(
name = "generated_tuning_lib", name = "generated_tuning_lib",
srcs = glob(["tuning/*.cc"]), srcs = glob(["tuning/*.cc"]),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1, linkstatic = 1,
) )
cc_library( cc_library(
name = "version_lib", name = "version_lib",
srcs = glob(["version/*.cc"]), srcs = glob(["version/*.cc"]),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
"//mace/core", "//mace/core",
......
...@@ -21,7 +21,7 @@ cc_library( ...@@ -21,7 +21,7 @@ cc_library(
"runtime/opencl/cl2.hpp", "runtime/opencl/cl2.hpp",
"runtime/opencl/*.h", "runtime/opencl/*.h",
]), ]),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"] + copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"] +
if_profiling_enabled(["-DMACE_OPENCL_PROFILING"]) + if_profiling_enabled(["-DMACE_OPENCL_PROFILING"]) +
if_embed_binary_program(["-DMACE_EMBED_BINARY_PROGRAM"]), if_embed_binary_program(["-DMACE_EMBED_BINARY_PROGRAM"]),
linkopts = if_android(["-pie", "-ldl"]), linkopts = if_android(["-pie", "-ldl"]),
...@@ -43,7 +43,7 @@ cc_library( ...@@ -43,7 +43,7 @@ cc_library(
"testing/test_benchmark.cc", "testing/test_benchmark.cc",
"testing/test_benchmark_main.cc", "testing/test_benchmark_main.cc",
], ],
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
alwayslink = 1, alwayslink = 1,
deps = [ deps = [
":core", ":core",
......
...@@ -14,7 +14,10 @@ OperatorBase::OperatorBase(const OperatorDef &operator_def, Workspace *ws) ...@@ -14,7 +14,10 @@ OperatorBase::OperatorBase(const OperatorDef &operator_def, Workspace *ws)
OpKeyBuilder::OpKeyBuilder(const char *op_name) : op_name_(op_name) {} OpKeyBuilder::OpKeyBuilder(const char *op_name) : op_name_(op_name) {}
OpKeyBuilder &OpKeyBuilder::Device(DeviceType device) { device_type_ = device; } OpKeyBuilder &OpKeyBuilder::Device(DeviceType device) {
device_type_ = device;
return *this;
}
OpKeyBuilder &OpKeyBuilder::TypeConstraint(const char *attr_name, OpKeyBuilder &OpKeyBuilder::TypeConstraint(const char *attr_name,
const DataType allowed) { const DataType allowed) {
......
...@@ -6,7 +6,7 @@ cc_binary( ...@@ -6,7 +6,7 @@ cc_binary(
srcs = [ srcs = [
"helloworld.cc", "helloworld.cc",
], ],
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkopts = if_enable_neon(["-fopenmp"]), linkopts = if_enable_neon(["-fopenmp"]),
deps = [ deps = [
"//mace/core", "//mace/core",
...@@ -18,7 +18,7 @@ cc_test( ...@@ -18,7 +18,7 @@ cc_test(
name = "benchmark_example", name = "benchmark_example",
testonly = 1, testonly = 1,
srcs = ["benchmark_example.cc"], srcs = ["benchmark_example.cc"],
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkopts = if_enable_neon(["-fopenmp"]), linkopts = if_enable_neon(["-fopenmp"]),
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
...@@ -30,7 +30,7 @@ cc_test( ...@@ -30,7 +30,7 @@ cc_test(
cc_binary( cc_binary(
name = "mace_run", name = "mace_run",
srcs = ["mace_run.cc"], srcs = ["mace_run.cc"],
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkopts = if_enable_neon(["-fopenmp"]), linkopts = if_enable_neon(["-fopenmp"]),
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
......
...@@ -20,6 +20,7 @@ cc_library( ...@@ -20,6 +20,7 @@ cc_library(
copts = [ copts = [
"-std=c++11", "-std=c++11",
"-D_GLIBCXX_USE_C99_MATH_TR1", "-D_GLIBCXX_USE_C99_MATH_TR1",
"-Werror=return-type",
] + ] +
if_embed_binary_program(["-DMACE_EMBED_BINARY_PROGRAM"]) + if_embed_binary_program(["-DMACE_EMBED_BINARY_PROGRAM"]) +
if_enable_neon(["-fopenmp"]), if_enable_neon(["-fopenmp"]),
...@@ -34,7 +35,7 @@ cc_test( ...@@ -34,7 +35,7 @@ cc_test(
name = "kernel_test", name = "kernel_test",
testonly = 1, testonly = 1,
srcs = glob(["test/*.cc"]), srcs = glob(["test/*.cc"]),
copts = ["-std=c++11"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkopts = if_android(["-pie"]), linkopts = if_android(["-pie"]),
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
...@@ -48,7 +49,7 @@ cc_test( ...@@ -48,7 +49,7 @@ cc_test(
name = "benchmark", name = "benchmark",
testonly = 1, testonly = 1,
srcs = glob(["benchmark/*.cc"]), srcs = glob(["benchmark/*.cc"]),
copts = ["-std=c++11"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
":kernels", ":kernels",
......
...@@ -34,7 +34,7 @@ cc_library( ...@@ -34,7 +34,7 @@ cc_library(
["*.h"], ["*.h"],
exclude = ["ops_test_util.h"], exclude = ["ops_test_util.h"],
), ),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"] + copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"] +
if_enable_neon(["-DMACE_ENABLE_NEON"]), if_enable_neon(["-DMACE_ENABLE_NEON"]),
deps = [ deps = [
"//mace/kernels", "//mace/kernels",
...@@ -48,7 +48,7 @@ cc_test( ...@@ -48,7 +48,7 @@ cc_test(
srcs = glob( srcs = glob(
["*_test.cc"], ["*_test.cc"],
), ),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkopts = ["-fopenmp"], linkopts = ["-fopenmp"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
...@@ -62,7 +62,7 @@ cc_test( ...@@ -62,7 +62,7 @@ cc_test(
name = "ops_benchmark", name = "ops_benchmark",
testonly = 1, testonly = 1,
srcs = glob(["*_benchmark.cc"]), srcs = glob(["*_benchmark.cc"]),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkopts = ["-fopenmp"], linkopts = ["-fopenmp"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
......
...@@ -7,7 +7,7 @@ cc_library( ...@@ -7,7 +7,7 @@ cc_library(
name = "stat_summarizer", name = "stat_summarizer",
srcs = ["stat_summarizer.cc"], srcs = ["stat_summarizer.cc"],
hdrs = ["stat_summarizer.h"], hdrs = ["stat_summarizer.h"],
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
"//mace/core", "//mace/core",
...@@ -19,7 +19,7 @@ cc_binary( ...@@ -19,7 +19,7 @@ cc_binary(
srcs = [ srcs = [
"benchmark_model.cc", "benchmark_model.cc",
], ],
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
":stat_summarizer", ":stat_summarizer",
......
...@@ -17,7 +17,7 @@ cc_library( ...@@ -17,7 +17,7 @@ cc_library(
hdrs = [ hdrs = [
"logging.h", "logging.h",
], ],
copts = ["-std=c++11"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkopts = if_android([ linkopts = if_android([
"-llog", "-llog",
]), ]),
...@@ -31,7 +31,7 @@ cc_library( ...@@ -31,7 +31,7 @@ cc_library(
hdrs = [ hdrs = [
"command_line_flags.h", "command_line_flags.h",
], ],
copts = ["-std=c++11"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
deps = [ deps = [
":logging", ":logging",
], ],
...@@ -43,7 +43,7 @@ cc_library( ...@@ -43,7 +43,7 @@ cc_library(
"tuner.h", "tuner.h",
"timer.h", "timer.h",
], ],
copts = ["-std=c++11"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
deps = [ deps = [
":utils_hdrs", ":utils_hdrs",
":logging", ":logging",
...@@ -56,7 +56,7 @@ cc_test( ...@@ -56,7 +56,7 @@ cc_test(
srcs = [ srcs = [
"tuner_test.cc", "tuner_test.cc",
], ],
copts = ["-std=c++11"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkopts = if_android(["-pie", "-lm"]), linkopts = if_android(["-pie", "-lm"]),
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
...@@ -72,7 +72,7 @@ cc_library( ...@@ -72,7 +72,7 @@ cc_library(
"utils.h", "utils.h",
"env_time.h", "env_time.h",
], ],
copts = ["-std=c++11"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
) )
cc_library( cc_library(
...@@ -83,4 +83,5 @@ cc_library( ...@@ -83,4 +83,5 @@ cc_library(
":command_line_flags", ":command_line_flags",
":logging", ":logging",
], ],
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
) )
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册