Skip to content

Commit

Permalink
Internal change.
Browse files Browse the repository at this point in the history
Change: 147051664
  • Loading branch information
tensorflower-gardener committed Feb 9, 2017
1 parent 1d337e4 commit 9683b09
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 54 deletions.
24 changes: 12 additions & 12 deletions tensorflow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,19 @@ filegroup(
visibility = [":__subpackages__"],
)

#load(
# "//third_party/mkl:build_defs.bzl",
# "if_mkl",
#)
load(
"//tensorflow/third_party/mkl:build_defs.bzl",
"if_mkl",
)

#filegroup(
# name = "intel_binary_blob",
# data = if_mkl(
# [
# "//third_party/mkl:intel_binary_blob",
# ],
# ),
#)
filegroup(
name = "intel_binary_blob",
data = if_mkl(
[
"//tensorflow/third_party/mkl:intel_binary_blob",
],
),
)

# -------------------------------------------
# New rules should be added above this target.
Expand Down
67 changes: 33 additions & 34 deletions tensorflow/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ load(
"tf_opts_nortti_if_android",
"cc_header_only_library",
)

#load("//tensorflow:tensorflow.bzl", "tf_cc_test_mkl")
load("//tensorflow:tensorflow.bzl", "tf_cc_test_mkl")
load("//tensorflow:tensorflow.bzl", "tf_cc_test_gpu")
load("//tensorflow:tensorflow.bzl", "tf_cc_tests_gpu")
load("//tensorflow:tensorflow.bzl", "tf_version_info_genrule")
Expand Down Expand Up @@ -113,10 +112,10 @@ load(
"//tensorflow/core:platform/default/build_config_root.bzl",
"tf_cuda_tests_tags",
)
#load(
# "//third_party/mkl:build_defs.bzl",
# "if_mkl",
#)
load(
"//tensorflow/third_party/mkl:build_defs.bzl",
"if_mkl",
)
# -----------------------------------------------------------------------------
# Public targets

Expand Down Expand Up @@ -1877,34 +1876,34 @@ tf_cc_tests(
],
)

#if_mkl(
# tf_cc_test_mkl(
# name = "mkl_related_tests",
# size = "small",
# srcs = ["graph/mkl_optimizer_merge_test.cc"],
# linkstatic = tf_kernel_tests_linkstatic(),
# deps = [
# ":core",
# ":core_cpu",
# ":core_cpu_internal",
# ":direct_session_internal",
# ":framework",
# ":framework_internal",
# ":lib",
# ":lib_internal",
# ":ops",
# ":protos_all_cc",
# ":test",
# ":test_main",
# ":testlib",
# "//third_party/eigen3",
# "//tensorflow/cc:cc_ops",
# "//tensorflow/cc:scope",
# "//tensorflow/cc:sendrecv_ops",
# "//tensorflow/core/kernels:ops_util",
# ],
# ),
#)
if_mkl(
tf_cc_test_mkl(
name = "mkl_related_tests",
size = "small",
srcs = ["graph/mkl_optimizer_merge_test.cc"],
linkstatic = tf_kernel_tests_linkstatic(),
deps = [
":core",
":core_cpu",
":core_cpu_internal",
":direct_session_internal",
":framework",
":framework_internal",
":lib",
":lib_internal",
":ops",
":protos_all_cc", # under if_mkl
":test",
":test_main",
":testlib",
"//tensorflow/cc:cc_ops",
"//tensorflow/cc:scope",
"//tensorflow/cc:sendrecv_ops",
"//tensorflow/core/kernels:ops_util",
"//third_party/eigen3",
],
),
)

tf_cc_tests_gpu(
name = "gpu_related_tests",
Expand Down
14 changes: 7 additions & 7 deletions tensorflow/tensorflow.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ load(
"cuda_default_copts"
)

#load(
# "//third_party/mkl:build_defs.bzl",
# "if_mkl",
#)
load(
"//tensorflow/third_party/mkl:build_defs.bzl",
"if_mkl",
)

# List of proto files for android builds
def tf_android_core_proto_sources(core_proto_sources_relative):
Expand Down Expand Up @@ -382,9 +382,9 @@ def tf_cc_tests(srcs, deps, name='', linkstatic=0, tags=[], size="medium",
args=args,
linkopts=linkopts)

#def tf_cc_test_mkl(srcs, deps, name='', linkstatic=0, tags=[], size="medium",
# args=None):
# tf_cc_tests(srcs, deps, linkstatic, tags=tags, size=size, args=args)
def tf_cc_test_mkl(srcs, deps, name='', linkstatic=0, tags=[], size="medium",
args=None):
tf_cc_tests(srcs, deps, linkstatic, tags=tags, size=size, args=args)

def tf_cc_tests_gpu(srcs, deps, name='', linkstatic=0, tags=[], size="medium",
args=None):
Expand Down
9 changes: 9 additions & 0 deletions tensorflow/third_party/mkl/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file is replaced on github with a real build rule.

licenses(["notice"]) # Apache 2.0

cc_library(
name = "intel_binary_blob",
srcs = [],
visibility = ["//visibility:public"],
)
2 changes: 2 additions & 0 deletions tensorflow/third_party/mkl/build_defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def if_mkl(if_true, if_false = []):
return if_false
3 changes: 2 additions & 1 deletion tensorflow/tools/pip_package/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package(default_visibility = ["//visibility:private"])

load("//tensorflow:tensorflow.bzl", "transitive_hdrs")
load("//third_party/mkl:build_defs.bzl", "if_mkl")
load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_additional_license_deps")

# This returns a list of headers of all public header libraries (e.g.,
Expand Down Expand Up @@ -131,5 +132,5 @@ sh_binary(
"//tensorflow/python/tools:all_files",
"//tensorflow/tensorboard",
],
}),
}) + if_mkl(["//third_party/mkl:intel_binary_blob"]),
)
3 changes: 3 additions & 0 deletions third_party/eigen3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ licenses([

exports_files(["LICENSE"])

load("//tensorflow:tensorflow.bzl", "if_mkl")

cc_library(
name = "eigen3",
hdrs = glob(["unsupported/Eigen/CXX11/src/FixedPoint/*.h"]) + [
Expand All @@ -25,6 +27,7 @@ cc_library(
"unsupported/Eigen/CXX11/Tensor",
"unsupported/Eigen/CXX11/FixedPoint",
],
includes = if_mkl(["./mkl_include"]),
visibility = ["//visibility:public"],
deps = [
"@eigen_archive//:eigen",
Expand Down
19 changes: 19 additions & 0 deletions third_party/mkl/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like TODO

config_setting(
name = "using_mkl",
values = {
"define": "using_mkl=true",
},
visibility = ["//visibility:public"],
)

cc_library(
name = "intel_binary_blob",
srcs = [
"libiomp5.so",
"libmklml_intel.so",
],
includes = ["."],
visibility = ["//visibility:public"],
)
11 changes: 11 additions & 0 deletions third_party/mkl/build_defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Macros for building MKL code.

def if_mkl(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({
"//third_party/mkl:using_mkl": if_true,
"//conditions:default": if_false
})

0 comments on commit 9683b09

Please sign in to comment.