Use "-O3" for optimized TFLite build

This gives about 2x improvement with benchmark_model tool for Linux targets.
On Windows, the option is ignored since it isn't supported.

PiperOrigin-RevId: 278278192
Change-Id: I32433455db34b2dfe77266f9a9f705b54a66e96b
This commit is contained in:
Terry Heo 2019-11-03 18:31:26 -08:00 committed by TensorFlower Gardener
parent 0275b50071
commit e6f23d3e45

View File

@ -13,12 +13,8 @@ def tflite_copts():
copts = [
"-DFARMHASH_NO_CXX_STRING",
] + select({
clean_dep("//tensorflow:android_arm64"): [
"-O3",
],
clean_dep("//tensorflow:android_arm"): [
"-mfpu=neon",
"-O3",
],
clean_dep("//tensorflow:ios_x86_64"): [
"-msse4.1",
@ -30,6 +26,9 @@ def tflite_copts():
"//conditions:default": [
"-Wno-sign-compare",
],
}) + select({
clean_dep("//tensorflow:optimized"): ["-O3"],
"//conditions:default": [],
})
return copts