xref: /aosp_15_r20/external/tensorflow/third_party/mkl_dnn/build_defs.bzl (revision b6fb3261f9314811a0f4371741dbb8839866f948)
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_openmp(if_true, if_false = []):
18    """Returns `if_true` if OpenMP is used with oneDNN.
19
20    Shorthand for select()'ing on whether we're building with
21    oneDNN open source library only with openmp
22
23    Returns a select statement which evaluates to if_true if we're building
24    with oneDNN open source library only with OpenMP. Otherwise, the
25    select statement evaluates to if_false.
26
27    """
28    return select({
29        "@org_tensorflow//third_party/mkl_dnn:build_with_mkldnn_openmp": if_true,
30        "//conditions:default": if_false,
31    })
32
33def if_mkldnn_aarch64_acl(if_true, if_false = []):
34    return select({
35        "@org_tensorflow//third_party/mkl:build_with_mkl_aarch64": if_true,
36        "//conditions:default": if_false,
37    })
38
39def if_mkldnn_aarch64_acl_openmp(if_true, if_false = []):
40    return select({
41        "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_aarch64_openmp": if_true,
42        "//conditions:default": if_false,
43    })
44