[TF:JIT] Make :xla_device visible to public, which is necessary for 3rd party
authorKay Zhu <kayzhu@google.com>
Thu, 18 Jan 2018 19:30:02 +0000 (11:30 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 18 Jan 2018 19:33:13 +0000 (11:33 -0800)
to use XLA. Also add a build target to tf/compiler/plugin/BUILD that depends on
:xla_device to help ensure it stays visible to public.

PiperOrigin-RevId: 182410844

tensorflow/compiler/jit/BUILD
tensorflow/compiler/plugin/BUILD

index 13343967c4f86b610ecacf421166dadd1aa79da0..a711319607f4ff2b83aa0ebe50e215b3d0e2258e 100644 (file)
@@ -110,19 +110,6 @@ cc_library(
     alwayslink = True,
 )
 
-# Internal targets below this point.
-
-cc_library(
-    name = "common",
-    srcs = [
-        "defs.cc",
-    ],
-    hdrs = [
-        "defs.h",
-    ],
-    visibility = [":friends"],
-)
-
 cc_library(
     name = "xla_device",
     srcs = [
@@ -135,6 +122,8 @@ cc_library(
         "xla_device_context.h",
         "xla_device_ops.h",
     ],
+    # Public visibility is needed for external TF/XLA backends.
+    visibility = ["//visibility:public"],
     deps = [
         ":common",
         ":jit_compilation_passes",
@@ -164,6 +153,19 @@ cc_library(
     ],
 )
 
+# Internal targets below this point.
+
+cc_library(
+    name = "common",
+    srcs = [
+        "defs.cc",
+    ],
+    hdrs = [
+        "defs.h",
+    ],
+    visibility = [":friends"],
+)
+
 cc_library(
     name = "xla_compilation_cache",
     srcs = ["xla_compilation_cache.cc"],
index c1edf2448c54ffddd7b70dcdfb1609080ca81b65..da4bc44c7a75c9f8faf16c537a17a1f2d16d5d61 100644 (file)
@@ -41,6 +41,15 @@ cc_library(
     ],
 )
 
+# This target is added purely for the purpose of ensuring that `:xla_device` is
+# always publicly visible to external XLA backend/plugin developers.
+cc_library(
+    name = "plugin_device",
+    deps = [
+        "//tensorflow/compiler/jit:xla_device",
+    ],
+)
+
 #-----------------------------------------------------------------------------
 
 filegroup(