STT-tensorflow/third_party/mkl_dnn/build_defs.bzl
A. Unique TensorFlower 460e000de3 Internal change
PiperOrigin-RevId: 361090132
Change-Id: Ia8e3efb6e794d83c4ef506fccf830370ec6780d0
2021-03-05 00:36:27 -08:00

32 lines
1.1 KiB
Python

def if_mkl_open_source_only(if_true, if_false = []):
"""Returns `if_true` if MKL-DNN v0.x is used.
Shorthand for select()'ing on whether we're building with
MKL-DNN v0.x open source library only, without depending on MKL binary form.
Returns a select statement which evaluates to if_true if we're building
with MKL-DNN v0.x open source library only. Otherwise, the select statement
evaluates to if_false.
"""
return select({
"@org_tensorflow//third_party/mkl_dnn:build_with_mkl_opensource": if_true,
"//conditions:default": if_false,
})
def if_mkldnn_openmp(if_true, if_false = []):
"""Returns `if_true` if OpenMP is used with oneDNN.
Shorthand for select()'ing on whether we're building with
oneDNN open source library only with openmp
Returns a select statement which evaluates to if_true if we're building
with oneDNN open source library only with OpenMP. Otherwise, the
select statement evaluates to if_false.
"""
return select({
"@org_tensorflow//third_party/mkl_dnn:build_with_mkldnn_openmp": if_true,
"//conditions:default": if_false,
})