aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow')
-rw-r--r--tensorflow/BUILD11
-rw-r--r--tensorflow/core/BUILD3
-rw-r--r--tensorflow/python/BUILD4
-rw-r--r--tensorflow/tensorflow.bzl7
-rw-r--r--tensorflow/workspace.bzl33
5 files changed, 56 insertions, 2 deletions
diff --git a/tensorflow/BUILD b/tensorflow/BUILD
index f1000c1bff..e5654a5141 100644
--- a/tensorflow/BUILD
+++ b/tensorflow/BUILD
@@ -23,6 +23,7 @@ load(
"//tensorflow/python/tools/api/generator:api_gen.bzl",
"gen_api_init_files", # @unused
)
+load("//third_party/ngraph:build_defs.bzl", "if_ngraph")
# Config setting used when building for products
# which requires restricted licenses to be avoided.
@@ -411,6 +412,14 @@ config_setting(
visibility = ["//visibility:public"],
)
+# This flag is set from the configure step when the user selects with nGraph option.
+# By default it should be false
+config_setting(
+ name = "with_ngraph_support",
+ values = {"define": "with_ngraph_support=true"},
+ visibility = ["//visibility:public"],
+)
+
package_group(
name = "internal",
packages = [
@@ -563,7 +572,7 @@ tf_cc_shared_object(
"//tensorflow/cc:scope",
"//tensorflow/cc/profiler",
"//tensorflow/core:tensorflow",
- ],
+ ] + if_ngraph(["@ngraph_tf//:ngraph_tf"])
)
exports_files(
diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD
index aef652e185..9a8c20b1fd 100644
--- a/tensorflow/core/BUILD
+++ b/tensorflow/core/BUILD
@@ -2342,6 +2342,7 @@ tf_generate_proto_text_sources(
":lib_internal",
":protos_all_proto_cc",
],
+ visibility = ["//visibility:public"],
)
cc_library(
@@ -2452,6 +2453,7 @@ cc_header_only_library(
deps = [
":core_cpu_lib",
],
+ visibility = ["//visibility:public"],
)
tf_cuda_library(
@@ -2573,6 +2575,7 @@ tf_cuda_library(
cc_library(
name = "protos_cc",
deps = ["//tensorflow/core/platform/default/build_config:protos_cc"],
+ visibility = ["//visibility:public"],
)
# Library containing all of the graph construction code that is
diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
index 7c2e8b003b..5f985654f0 100644
--- a/tensorflow/python/BUILD
+++ b/tensorflow/python/BUILD
@@ -44,6 +44,7 @@ load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_additional_
load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_additional_mpi_deps")
load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_additional_gdr_deps")
load("//tensorflow/core:platform/default/build_config_root.bzl", "if_static")
+load("//third_party/ngraph:build_defs.bzl","if_ngraph")
py_library(
name = "python",
@@ -3812,7 +3813,8 @@ tf_py_wrap_cc(
tf_additional_plugin_deps() +
tf_additional_verbs_deps() +
tf_additional_mpi_deps() +
- tf_additional_gdr_deps()),
+ tf_additional_gdr_deps()) +
+ if_ngraph(["@ngraph_tf//:ngraph_tf"])
)
# ** Targets for Windows build (start) **
diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl
index 1e028e3350..2f19147dbb 100644
--- a/tensorflow/tensorflow.bzl
+++ b/tensorflow/tensorflow.bzl
@@ -31,6 +31,12 @@ load(
"//third_party/mkl_dnn:build_defs.bzl",
"if_mkl_open_source_only",
)
+
+load(
+ "//third_party/ngraph:build_defs.bzl",
+ "if_ngraph",
+)
+
def register_extension_info(**kwargs):
pass
@@ -233,6 +239,7 @@ def tf_copts(android_optimization_level_override = "-O2", is_external = False):
if_tensorrt(["-DGOOGLE_TENSORRT=1"]) +
if_mkl(["-DINTEL_MKL=1", "-DEIGEN_USE_VML"]) +
if_mkl_open_source_only(["-DINTEL_MKL_DNN_ONLY"]) +
+ if_ngraph(["-DINTEL_NGRAPH=1"]) +
if_mkl_lnx_x64(["-fopenmp"]) +
if_android_arm(["-mfpu=neon"]) +
if_linux_x86_64(["-msse3"]) +
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index bbfe6238c9..10bfe7e0f6 100644
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -825,6 +825,39 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
strip_prefix = "rules_android-0.1.1",
)
+ tf_http_archive(
+ name = "ngraph",
+ urls = [
+ "https://mirror.bazel.build/github.com/NervanaSystems/ngraph/archive/v0.5.0.tar.gz",
+ "https://github.com/NervanaSystems/ngraph/archive/v0.5.0.tar.gz",
+ ],
+ sha256 = "cb35d3d98836f615408afd18371fb13e3400711247e0d822ba7f306c45e9bb2c",
+ strip_prefix = "ngraph-0.5.0",
+ build_file = clean_dep("//third_party/ngraph:ngraph.BUILD"),
+ )
+
+ tf_http_archive(
+ name = "nlohmann_json_lib",
+ urls = [
+ "https://mirror.bazel.build/github.com/nlohmann/json/archive/v3.1.1.tar.gz",
+ "https://github.com/nlohmann/json/archive/v3.1.1.tar.gz",
+ ],
+ sha256 = "9f3549824af3ca7e9707a2503959886362801fb4926b869789d6929098a79e47",
+ strip_prefix = "json-3.1.1",
+ build_file = clean_dep("//third_party/ngraph:nlohmann_json.BUILD"),
+ )
+
+ tf_http_archive(
+ name = "ngraph_tf",
+ urls = [
+ "https://mirror.bazel.build/github.com/NervanaSystems/ngraph-tf/archive/v0.3.0-rc1.tar.gz",
+ "https://github.com/NervanaSystems/ngraph-tf/archive/v0.3.0-rc1.tar.gz",
+ ],
+ sha256 = "7919332cb15120101c3e05c1b969a5e029a6411581312583c8f80b6aaaa83072",
+ strip_prefix = "ngraph-tf-0.3.0-rc1",
+ build_file = clean_dep("//third_party/ngraph:ngraph_tf.BUILD"),
+ )
+
##############################################################################
# BIND DEFINITIONS
#