diff options
author | Anton Matosov <anton.matosov@gmail.com> | 2018-03-23 10:29:48 -0700 |
---|---|---|
committer | Gunhan Gulsoy <gunan@google.com> | 2018-03-23 10:29:48 -0700 |
commit | 116b9f34c3b3562192c69bbd045886c541cfffbc (patch) | |
tree | 49759dd299cac59e022a926a0cadf4feb1465e4b /third_party/mkl/build_defs.bzl | |
parent | 319f20ad87da6c058f6d84edcc41478519d8e15e (diff) |
[WIP] MKL repos download for mac and windows + update to MKL(-DNN) 0.12 (#17396)
* Fix MKL build on MacOS
* Fix invalid return type, user_memory_->set_data_handle(buf) returns void.
* Fix type mismatch
* Implement downloading and linking of MKL repo on mac and windows
* Rework the way MKL libs are binded to avoid warnings and simplify code
* Switch to matching version of MKL-DNN
* Add mirror links
* Add renamed license file
* Add -fopenmp flag for linux mkl build as Slice op kernel is optimized using OpenMP
* Use clean_dep in the entire file for consistency
* Fix build. Constants are declrared as static in header outside the class scope now
* Reworked fix for `-openmp` flag using the suggestion from @gunan
Original version here https://github.com/gunan/tensorflow/commit/b4d39c5226e8bbafe084b1dfc35f4644f2d906c2
Diffstat (limited to 'third_party/mkl/build_defs.bzl')
-rw-r--r-- | third_party/mkl/build_defs.bzl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/mkl/build_defs.bzl b/third_party/mkl/build_defs.bzl index 8b73ddabdd..53e02769da 100644 --- a/third_party/mkl/build_defs.bzl +++ b/third_party/mkl/build_defs.bzl @@ -24,6 +24,18 @@ def if_mkl(if_true, if_false = []): "//conditions:default": if_false }) +def if_mkl_lnx_x64(if_true, if_false = []): + """Shorthand for select()'ing on whether we're building with MKL. + + Returns a select statement which evaluates to if_true if we're building + with MKL enabled. Otherwise, the select statement evaluates to if_false. + + """ + return select({ + str(Label("//third_party/mkl:using_mkl_lnx_x64")): if_true, + "//conditions:default": if_false + }) + def _enable_local_mkl(repository_ctx): return _TF_MKL_ROOT in repository_ctx.os.environ |