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-12-13 10:10:32 +00:00
|
|
|
sha256 = "35b6aefa0359317ae2892f846d6da892bee2116d8c6722e397ef0120cf572183",
|
|
|
|
|
url = "https://github.com/zml/pjrt-artifacts/releases/download/v4.0.0/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-12-13 10:10:32 +00:00
|
|
|
sha256 = "a532a2e1511f91ec6d6adc60290f6bc4d88d2521508661e90b9824061ebabb3a",
|
|
|
|
|
url = "https://github.com/zml/pjrt-artifacts/releases/download/v4.0.0/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,
|
|
|
|
|
)
|