Internal change.

Change: 147051664
This commit is contained in:
A. Unique TensorFlower 2017-02-09 10:37:42 -08:00 committed by TensorFlower Gardener
parent 1d337e43fa
commit 9683b095fc
9 changed files with 98 additions and 54 deletions

View File

@ -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.

View File

@ -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")
@ -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
@ -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",

View File

@ -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):
@ -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):

9
tensorflow/third_party/mkl/BUILD vendored Normal file
View File

@ -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"],
)

View File

@ -0,0 +1,2 @@
def if_mkl(if_true, if_false = []):
return if_false

View File

@ -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.,
@ -131,5 +132,5 @@ sh_binary(
"//tensorflow/python/tools:all_files",
"//tensorflow/tensorboard",
],
}),
}) + if_mkl(["//third_party/mkl:intel_binary_blob"]),
)

View File

@ -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"]) + [
@ -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",

19
third_party/mkl/BUILD vendored Normal file
View File

@ -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
third_party/mkl/build_defs.bzl vendored Normal file
View File

@ -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
})