35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
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"),
|
|
sha256 = "14317143acd6a38656e97280e8010c0b8d8c0863dff2ae82834b6f2fe747427b",
|
|
url = "https://github.com/zml/pjrt-artifacts/releases/download/v0.1.13/pjrt-cpu_linux-amd64.tar.gz",
|
|
)
|
|
|
|
http_archive(
|
|
name = "libpjrt_cpu_darwin_arm64",
|
|
build_file_content = _BUILD.format(ext = "dylib"),
|
|
sha256 = "3a26e1372f68fc11028c4ec22a0c72693f08e7690ba8c5f28b17f5baa9c9dc77",
|
|
url = "https://github.com/zml/pjrt-artifacts/releases/download/v0.1.13/pjrt-cpu_darwin-arm64.tar.gz",
|
|
)
|
|
|
|
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,
|
|
)
|