Skip to content

Commit 82a3ab3

Browse files
committed
[ROCm] Add new hip_runtime bazel target
In the jaxlib extension for ROCm, we need to link to the HIP runtime (libamdhip64.so) but without the extra links that are on rocm_hip, such as comgr, rocm-smi, and HSA runtime (which are linked by libamdhip itself) Comgr shouldn't be directly linked by any HIP users either, but that hasn't been an issue for others apparently, so add this target that we can use from jaxlib and not intefere with rocm_hip.
1 parent d457661 commit 82a3ab3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

third_party/gpus/rocm/BUILD.tpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,24 @@ cc_library(
180180
],
181181
)
182182

183+
# NOTE(mrodden): used by jax_rocm_plugin to minimally link to hip runtime
184+
cc_library(
185+
name = "hip_runtime",
186+
visibility = ["//visibility:public"],
187+
hdrs = glob(["%{rocm_root}/include/hip/**"]),
188+
srcs = glob(["%{rocm_root}/lib/libamdhip*.so"]),
189+
include_prefix = "rocm",
190+
includes = [
191+
"%{rocm_root}/include",
192+
],
193+
strip_include_prefix = "%{rocm_root}",
194+
deps = [
195+
":rocm_config",
196+
":rocprofiler_register",
197+
":system_libs",
198+
],
199+
)
200+
183201
cc_library(
184202
name = "rocblas",
185203
hdrs = glob(["%{rocm_root}/include/rocblas/**"]),

0 commit comments

Comments
 (0)