diff --git a/tensorflow/lite/delegates/gpu/BUILD b/tensorflow/lite/delegates/gpu/BUILD index 431fcab2b46..7fe31477a27 100644 --- a/tensorflow/lite/delegates/gpu/BUILD +++ b/tensorflow/lite/delegates/gpu/BUILD @@ -148,9 +148,9 @@ cc_library( "//tensorflow/lite/delegates/gpu/common:status", "//tensorflow/lite/delegates/gpu/common:util", "//tensorflow/lite/delegates/gpu/gl:portable", - "//third_party/opencl_headers", "@com_google_absl//absl/types:span", "@com_google_absl//absl/types:variant", + "@opencl_headers", ], ) diff --git a/tensorflow/lite/delegates/gpu/api.h b/tensorflow/lite/delegates/gpu/api.h index 00e80956c43..8388c9176b0 100644 --- a/tensorflow/lite/delegates/gpu/api.h +++ b/tensorflow/lite/delegates/gpu/api.h @@ -39,7 +39,7 @@ limitations under the License. #include "absl/types/span.h" #include "absl/types/variant.h" -#include "third_party/opencl_headers/CL/cl.h" +#include #include "tensorflow/lite/delegates/gpu/common/data_type.h" #include "tensorflow/lite/delegates/gpu/common/status.h" #include "tensorflow/lite/delegates/gpu/common/util.h" diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl index e5d2dd84330..62e831ee9a4 100755 --- a/tensorflow/workspace.bzl +++ b/tensorflow/workspace.bzl @@ -28,6 +28,7 @@ load("//third_party/hwloc:workspace.bzl", hwloc = "repo") load("//third_party/icu:workspace.bzl", icu = "repo") load("//third_party/jpeg:workspace.bzl", jpeg = "repo") load("//third_party/nasm:workspace.bzl", nasm = "repo") +load("//third_party/opencl_headers:workspace.bzl", opencl_headers = "repo") load("//third_party/kissfft:workspace.bzl", kissfft = "repo") load("//third_party/keras_applications_archive:workspace.bzl", keras_applications = "repo") load("//third_party/pasta:workspace.bzl", pasta = "repo") @@ -44,6 +45,7 @@ def initialize_third_party(): kissfft() jpeg() nasm() + opencl_headers() pasta() # Sanitize a dependency so that it works correctly from code that includes diff --git a/third_party/opencl_headers/BUILD b/third_party/opencl_headers/BUILD new file mode 100644 index 00000000000..e69de29bb2d diff --git a/third_party/opencl_headers/BUILD.bazel b/third_party/opencl_headers/BUILD.bazel new file mode 100644 index 00000000000..1a0b1dac2f2 --- /dev/null +++ b/third_party/opencl_headers/BUILD.bazel @@ -0,0 +1,28 @@ +# Description: +# OpenCL(TM) API Headers + +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +exports_files(["LICENSE"]) + +cc_library( + name = "opencl_headers", + hdrs = [ + "CL/cl.h", + "CL/cl_d3d10.h", + "CL/cl_d3d11.h", + "CL/cl_dx9_media_sharing.h", + "CL/cl_egl.h", + "CL/cl_ext.h", + "CL/cl_ext_intel.h", + "CL/cl_gl.h", + "CL/cl_gl_ext.h", + "CL/cl_platform.h", + "CL/cl_va_api_media_sharing_intel.h", + "CL/cl_version.h", + "CL/opencl.h", + ], + includes = ["."], +) diff --git a/third_party/opencl_headers/workspace.bzl b/third_party/opencl_headers/workspace.bzl new file mode 100644 index 00000000000..1d1d8b48a58 --- /dev/null +++ b/third_party/opencl_headers/workspace.bzl @@ -0,0 +1,15 @@ +"""Loads OpenCL-Headers, used by TF Lite.""" + +load("//third_party:repo.bzl", "third_party_http_archive") + +def repo(): + third_party_http_archive( + name = "opencl_headers", + strip_prefix = "OpenCL-Headers-0d5f18c6e7196863bc1557a693f1509adfcee056", + sha256 = "03cbc1fd449399be0422cdb021400f63958ef2c5a7c099a0d8f36a705b312f53", + urls = [ + "https://mirror.bazel.build/github.com/KhronosGroup/OpenCL-Headers/archive/0d5f18c6e7196863bc1557a693f1509adfcee056.tar.gz", + "https://github.com/KhronosGroup/OpenCL-Headers/archive/0d5f18c6e7196863bc1557a693f1509adfcee056.tar.gz", + ], + build_file = "//third_party/opencl_headers:BUILD.bazel", + )