61 lines
1.5 KiB
Python
61 lines
1.5 KiB
Python
load("@rules_zig//zig:defs.bzl", "zig_library")
|
|
load("@zml//bazel:zig.bzl", "zig_cc_binary")
|
|
load("//bazel:zig_proto_library.bzl", "zig_proto_library")
|
|
|
|
cc_library(
|
|
name = "dlfcn",
|
|
hdrs = ["dlfcn.h"],
|
|
target_compatible_with = [
|
|
"@platforms//os:linux",
|
|
],
|
|
)
|
|
|
|
zig_library(
|
|
name = "pjrt",
|
|
srcs = ["profiler.zig"] + glob(["convert/*.zig"]),
|
|
main = "pjrt.zig",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":profiler_options_proto",
|
|
":trace_events_proto",
|
|
":xplane_proto",
|
|
"//stdx",
|
|
"@xla//xla/pjrt/c:pjrt_c_api_gpu_extension_hdrs",
|
|
"@xla//xla/pjrt/c:pjrt_c_api_hdrs",
|
|
"@xla//xla/pjrt/c:pjrt_c_api_profiler_extension_hdrs",
|
|
] + select({
|
|
"@platforms//os:linux": [":dlfcn"],
|
|
"//conditions:default": [],
|
|
}),
|
|
)
|
|
|
|
zig_proto_library(
|
|
name = "profiler_options_proto",
|
|
import_name = "//tsl:profiler_options_proto",
|
|
deps = ["@tsl//tsl/profiler/protobuf:profiler_options_proto"],
|
|
)
|
|
|
|
zig_proto_library(
|
|
name = "xplane_proto",
|
|
import_name = "//tsl:xplane_proto",
|
|
deps = ["@tsl//tsl/profiler/protobuf:xplane_proto"],
|
|
)
|
|
|
|
zig_proto_library(
|
|
name = "trace_events_proto",
|
|
import_name = "//tsl:trace_events_proto",
|
|
deps = ["@tsl//tsl/profiler/protobuf:trace_events_proto"],
|
|
)
|
|
|
|
zig_cc_binary(
|
|
name = "xspace_to_json",
|
|
srcs = glob(["convert/*.zig"]),
|
|
main = "xspace_to_json.zig",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":trace_events_proto",
|
|
":xplane_proto",
|
|
"//stdx",
|
|
],
|
|
)
|