2023-01-02 14:28:25 +00:00
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
|
|
|
|
|
|
_BUILD = """\
|
|
|
|
|
cc_import(
|
|
|
|
|
name = "libpjrt_cpu",
|
|
|
|
|
shared_library = "libpjrt_cpu.{ext}",
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def _cpu_pjrt_plugin_impl(mctx):
|
|
|
|
|
http_archive(
|
|
|
|
|
name = "libpjrt_cpu_linux_amd64",
|
|
|
|
|
build_file_content = _BUILD.format(ext = "so"),
|
2023-02-01 15:58:30 +00:00
|
|
|
sha256 = "2058c999a4866716f1dae0c42476c09da0f6deff7e77e34c5223b61f5e0027fb",
|
|
|
|
|
url = "https://github.com/zml/pjrt-artifacts/releases/download/v0.2.2/pjrt-cpu_linux-amd64.tar.gz",
|
2023-01-02 14:28:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
|
name = "libpjrt_cpu_darwin_arm64",
|
|
|
|
|
build_file_content = _BUILD.format(ext = "dylib"),
|
2023-02-01 15:58:30 +00:00
|
|
|
sha256 = "727b0380a577b2759468a4e0b3574e1d81e1b4348c3942d23284d590c7ca91a5",
|
|
|
|
|
url = "https://github.com/zml/pjrt-artifacts/releases/download/v0.2.2/pjrt-cpu_darwin-arm64.tar.gz",
|
2023-01-02 14:28:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return mctx.extension_metadata(
|
|
|
|
|
reproducible = True,
|
|
|
|
|
root_module_direct_deps = "all",
|
|
|
|
|
root_module_direct_dev_deps = [],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
cpu_pjrt_plugin = module_extension(
|
|
|
|
|
implementation = _cpu_pjrt_plugin_impl,
|
|
|
|
|
)
|