diff options
author | Mahmoud Abuzaina <mahmoud.abuzaina@intel.com> | 2018-07-05 13:56:22 -0700 |
---|---|---|
committer | Mahmoud Abuzaina <mahmoud.abuzaina@intel.com> | 2018-07-05 13:56:22 -0700 |
commit | 64117da0c36f0697467ce6d56a7be6837da24d2f (patch) | |
tree | a0fcf1f18c058c10a5f7828209f1fdb6ce07c58c /third_party/mkl_dnn | |
parent | b2fe2a874bade4782aaca5c44bf29e7ff6c39200 (diff) |
Fixing AVX performance issue
Diffstat (limited to 'third_party/mkl_dnn')
-rw-r--r-- | third_party/mkl_dnn/BUILD | 8 | ||||
-rw-r--r-- | third_party/mkl_dnn/mkldnn.BUILD | 29 |
2 files changed, 36 insertions, 1 deletions
diff --git a/third_party/mkl_dnn/BUILD b/third_party/mkl_dnn/BUILD index 5b01f6e3e4..17a0074abe 100644 --- a/third_party/mkl_dnn/BUILD +++ b/third_party/mkl_dnn/BUILD @@ -1 +1,9 @@ licenses(["notice"]) + +config_setting( + name = "using_mkl_dnn_only", + values = { + "define": "using_mkl_dnn_only=true", + }, + visibility = ["//visibility:public"], +) diff --git a/third_party/mkl_dnn/mkldnn.BUILD b/third_party/mkl_dnn/mkldnn.BUILD index 68f24aabae..57d2e1292b 100644 --- a/third_party/mkl_dnn/mkldnn.BUILD +++ b/third_party/mkl_dnn/mkldnn.BUILD @@ -1,5 +1,10 @@ exports_files(["LICENSE"]) +load( + "@org_tensorflow//third_party/mkl_dnn:build_defs.bzl", + "if_mkl_open_source_only", +) + config_setting( name = "clang_linux_x86_64", values = { @@ -15,7 +20,14 @@ cc_library( "src/cpu/*.cpp", ]), hdrs = glob(["include/*"]), - copts = ["-fexceptions"] + select({ + copts = [ + "-fexceptions", + "-DUSE_MKL", + "-DUSE_CBLAS", + ] + if_mkl_open_source_only([ + "-UUSE_MKL", + "-UUSE_CBLAS", + ]) + select({ "@org_tensorflow//tensorflow:linux_x86_64": [ "-fopenmp", # only works with gcc ], @@ -33,4 +45,19 @@ cc_library( ], nocopts = "-fno-exceptions", visibility = ["//visibility:public"], + deps = select({ + "@org_tensorflow//tensorflow:linux_x86_64": [ + "@mkl_linux//:mkl_headers", + "@mkl_linux//:mkl_libs_linux", + ], + "@org_tensorflow//tensorflow:darwin": [ + "@mkl_darwin//:mkl_headers", + "@mkl_darwin//:mkl_libs_darwin", + ], + "@org_tensorflow//tensorflow:windows": [ + "@mkl_windows//:mkl_headers", + "@mkl_windows//:mkl_libs_windows", + ], + "//conditions:default": [], + }), ) |