Add halide dependency
I'm using this to make some pieces of vision processing faster.
Change-Id: Ib20f28433e9783a644c19a1ff6d8082c93a91bf7
diff --git a/WORKSPACE b/WORKSPACE
index 5bbffe9..4a1b88f 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -610,3 +610,23 @@
sha256 = "4b438c5bb123b2ed95db959fcfdefc833e8e5eee5778c0fbecbb62a94df0079e",
url = "http://www.frc971.org/Build-Dependencies/opencv_amd64.tar.gz",
)
+
+# Downloaded from:
+# https://github.com/halide/Halide/releases/download/release_2019_08_27/halide-linux-64-gcc53-800-65c26cba6a3eca2d08a0bccf113ca28746012cc3.tgz
+# which is "Halide 2019/08/27" at https://github.com/halide/Halide/releases.
+http_archive(
+ name = "halide_k8",
+ build_file = "@//debian:halide.BUILD",
+ strip_prefix = "halide/",
+ url = "http://www.frc971.org/Build-Dependencies/halide-linux-64-gcc53-800-65c26cba6a3eca2d08a0bccf113ca28746012cc3.tgz",
+)
+
+# Downloaded from:
+# https://github.com/halide/Halide/releases/download/release_2019_08_27/halide-arm32-linux-32-trunk-65c26cba6a3eca2d08a0bccf113ca28746012cc3.tgz
+# which is "Halide 2019/08/27" at https://github.com/halide/Halide/releases.
+http_archive(
+ name = "halide_armhf",
+ build_file = "@//debian:halide.BUILD",
+ strip_prefix = "halide/",
+ url = "http://www.frc971.org/Build-Dependencies/halide-arm32-linux-32-trunk-65c26cba6a3eca2d08a0bccf113ca28746012cc3.tgz",
+)
diff --git a/debian/halide.BUILD b/debian/halide.BUILD
new file mode 100644
index 0000000..fc43fd0
--- /dev/null
+++ b/debian/halide.BUILD
@@ -0,0 +1,26 @@
+cc_library(
+ name = "halide",
+ srcs = ["lib/libHalide.a"],
+ hdrs = glob(["include/*.h"]),
+ includes = ["include"],
+ visibility = ["//visibility:public"],
+)
+
+cc_library(
+ name = "gengen",
+ srcs = ["tools/GenGen.cpp"],
+ visibility = ["//visibility:public"],
+ deps = [
+ ":halide",
+ ],
+)
+
+cc_library(
+ name = "runtime",
+ hdrs = [
+ "include/HalideBuffer.h",
+ "include/HalideRuntime.h",
+ ],
+ includes = ["include"],
+ visibility = ["//visibility:public"],
+)
diff --git a/third_party/BUILD b/third_party/BUILD
index 06890d0..a4e236f 100644
--- a/third_party/BUILD
+++ b/third_party/BUILD
@@ -40,3 +40,49 @@
"//conditions:default": [],
}),
)
+
+cc_library(
+ name = "halide",
+ restricted_to = [
+ "//tools:k8",
+ "//tools:armhf-debian",
+ ],
+ visibility = ["//visibility:public"],
+ deps = select({
+ "//tools:cpu_k8": ["@halide_k8//:halide"],
+ "//tools:cpu_armhf": ["@halide_armhf//:halide"],
+ "//conditions:default": [],
+ }),
+)
+
+cc_library(
+ name = "halide_gengen",
+ restricted_to = [
+ "//tools:k8",
+ "//tools:armhf-debian",
+ ],
+ visibility = ["//visibility:public"],
+ # It's the same file in either version, but we'll pick the native version
+ # to minimize the chances of needing to download the other version unnecessarily.
+ deps = select({
+ "//tools:cpu_k8": ["@halide_k8//:gengen"],
+ "//tools:cpu_armhf": ["@halide_armhf//:gengen"],
+ "//conditions:default": [],
+ }),
+)
+
+cc_library(
+ name = "halide_runtime",
+ restricted_to = [
+ "//tools:k8",
+ "//tools:armhf-debian",
+ ],
+ visibility = ["//visibility:public"],
+ # It's the same file in either version, but we'll pick the native version
+ # to minimize the chances of needing to download the other version unnecessarily.
+ deps = select({
+ "//tools:cpu_k8": ["@halide_k8//:runtime"],
+ "//tools:cpu_armhf": ["@halide_armhf//:runtime"],
+ "//conditions:default": [],
+ }),
+)