1def if_mkl_open_source_only(if_true, if_false = []):
2    """Returns `if_true` if MKL-DNN v0.x is used.
3
4    Shorthand for select()'ing on whether we're building with
5    MKL-DNN v0.x open source library only, without depending on MKL binary form.
6
7    Returns a select statement which evaluates to if_true if we're building
8    with MKL-DNN v0.x open source library only. Otherwise, the select statement
9    evaluates to if_false.
10
11    """
12    return select({
13        "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_opensource": if_true,
14        "//conditions:default": if_false,
15    })
16
17def if_mkldnn_threadpool(if_true, if_false = []):
18    """Returns `if_true` if MKL-DNN v1.x is used.
19
20    Shorthand for select()'ing on whether we're building with
21    MKL-DNN v1.x open source library only with user specified threadpool, without depending on MKL binary form.
22
23    Returns a select statement which evaluates to if_true if we're building
24    with MKL-DNN v1.x open source library only with user specified threadpool. Otherwise, the
25    select statement evaluates to if_false.
26
27    """
28    return select({
29        "@org_tensorflow//third_party/mkl_dnn:build_with_mkldnn_threadpool": if_true,
30        "//conditions:default": if_false,
31    })
32