Skip to content

Commit

Permalink
Sync BUILD files
Browse files Browse the repository at this point in the history
  • Loading branch information
alekstheod committed Nov 20, 2024
1 parent 82f3c78 commit 6e89c4c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 28 deletions.
20 changes: 10 additions & 10 deletions third_party/gpus/rocm/BUILD.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ cc_library(
cc_library(
name = "rocblas",
hdrs = glob(["%{rocm_root}/include/rocblas/**"]),
# workaround to bring tensile files to the same fs layout as expected in the lib
# rocblas assumes that tensile files are located in ../roblas/libraries directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
data = glob([
"%{rocm_root}/lib/librocblas*.so*",
"%{rocm_root}/lib/rocblas/**",
Expand All @@ -102,9 +105,6 @@ cc_library(
includes = [
"%{rocm_root}/include",
],
# workaround to bring tensile files to the same fs layout as expected in the lib
# rocblas assumes that tensile files are located in ../roblas/libraries directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
strip_include_prefix = "%{rocm_root}",
visibility = ["//visibility:public"],
deps = [":rocm_config"],
Expand Down Expand Up @@ -153,17 +153,17 @@ cc_library(
cc_library(
name = "miopen",
hdrs = glob(["%{rocm_root}/include/rccl/**"]),
# workaround to bring miopen db files to the same fs layout as expected in the lib
# rocblas assumes that miopen db files are located in ../share/miopen/db directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
data = glob([
"%{rocm_root}/lib/libMIOpen*.so*",
"%{rocm_root}/lib/libMIOpen*.so*",
"%{rocm_root}/share/miopen/**",
]),
include_prefix = "rocm",
includes = [
"%{rocm_root}/include",
],
# workaround to bring miopen db files to the same fs layout as expected in the lib
# rocblas assumes that miopen db files are located in ../share/miopen/db directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
strip_include_prefix = "%{rocm_root}",
visibility = ["//visibility:public"],
deps = [":rocm_config"],
Expand Down Expand Up @@ -290,6 +290,9 @@ cc_library(
cc_library(
name = "hipblaslt",
hdrs = glob(["%{rocm_root}/include/hipblaslt/**"]),
# workaround to bring tensile files to the same fs layout as expected in the lib
# hibplatslt assumes that tensile files are located in ../hipblaslt/libraries directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
data = glob([
"%{rocm_root}/lib/hipblaslt/**",
"%{rocm_root}/lib/libhipblaslt.so*",
Expand All @@ -298,9 +301,6 @@ cc_library(
includes = [
"%{rocm_root}/include/",
],
# workaround to bring tensile files to the same fs layout as expected in the lib
# hibplatslt assumes that tensile files are located in ../hipblaslt/libraries directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
strip_include_prefix = "%{rocm_root}",
visibility = ["//visibility:public"],
deps = [":rocm_config"],
Expand Down
58 changes: 40 additions & 18 deletions third_party/xla/third_party/tsl/third_party/gpus/rocm/BUILD.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":hip",
":hsa_rocr",
":hipblas",
":hipblaslt",
":hiprand",
":hipsolver",
":hipsparse",
":hsa-rocr",
":miopen",
":rocblas",
":rocm_config",
Expand All @@ -62,10 +63,9 @@ cc_library(
)

cc_library(
name = "hip",
hdrs = glob(["%{rocm_root}/include/hip/**"]),
srcs = glob(["%{rocm_root}/lib/libamdhip*.so*"]),
data = glob(["%{rocm_root}/lib/hip/**"]),
name = "hsa-rocr",
hdrs = glob(["%{rocm_root}/include/hsa/**"]),
data = glob(["%{rocm_root}/lib/libhsa-runtime*.so*"]),
include_prefix = "rocm",
includes = [
"%{rocm_root}/include",
Expand All @@ -77,9 +77,10 @@ cc_library(
)

cc_library(
name = "hsa_rocr",
srcs = glob(["%{rocm_root}/lib/libhsa-runtime*.so*"]),
data = glob(["%{rocm_root}/lib/libhsa-runtime*.so*"]),
name = "hip",
srcs = glob(["%{rocm_root}/lib/libamdhip*.so*"]),
hdrs = glob(["%{rocm_root}/include/hip/**"]),
data = glob(["%{rocm_root}/lib/hip/**"]),
include_prefix = "rocm",
includes = [
"%{rocm_root}/include",
Expand All @@ -92,17 +93,18 @@ cc_library(

cc_library(
name = "rocblas",
srcs = glob(["%{rocm_root}/lib/librocblas*.so*"]),
hdrs = glob(["%{rocm_root}/include/rocblas/**"]),
# workaround to bring tensile files to the same fs layout as expected in the lib
# rocblas assumes that tensile files are located in ../roblas/libraries directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
data = glob([
"%{rocm_root}/lib/librocblas*.so",
"%{rocm_root}/lib/librocblas*.so*",
"%{rocm_root}/lib/rocblas/**",
]),
include_prefix = "rocm",
includes = [
"%{rocm_root}/include",
],
linkstatic = 1,
strip_include_prefix = "%{rocm_root}",
visibility = ["//visibility:public"],
deps = [":rocm_config"],
Expand Down Expand Up @@ -151,17 +153,17 @@ cc_library(
cc_library(
name = "miopen",
hdrs = glob(["%{rocm_root}/include/rccl/**"]),
# workaround to bring miopen db files to the same fs layout as expected in the lib
# rocblas assumes that miopen db files are located in ../share/miopen/db directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
data = glob([
"%{rocm_root}/lib/libMIOpen*.so*",
"%{rocm_root}/lib/libMIOpen*.so*",
"%{rocm_root}/share/miopen/**",
]),
include_prefix = "rocm",
includes = [
"%{rocm_root}/include",
],
# workaround to bring miopen db files to the same fs layout as expected in the lib
# rocblas assumes that miopen db files are located in ../share/miopen/db directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
strip_include_prefix = "%{rocm_root}",
visibility = ["//visibility:public"],
deps = [":rocm_config"],
Expand Down Expand Up @@ -211,7 +213,8 @@ cc_library(
strip_include_prefix = "%{rocm_root}",
visibility = ["//visibility:public"],
deps = [
":rocm",
":rocm_config",
":rocm_headers",
],
)

Expand Down Expand Up @@ -272,9 +275,28 @@ cc_library(

cc_library(
name = "hipblas",
srcs = glob(["%{rocm_root}/lib/libhipblas*.so*"]),
srcs = glob(["%{rocm_root}/lib/libhipblas.so*"]),
hdrs = glob(["%{rocm_root}/include/hipblas/**"]),
data = glob(["%{rocm_root}/lib/libhipblas*.so*"]),
data = glob(["%{rocm_root}/lib/libhipblas.so*"]),
include_prefix = "rocm",
includes = [
"%{rocm_root}/include/",
],
strip_include_prefix = "%{rocm_root}",
visibility = ["//visibility:public"],
deps = [":rocm_config"],
)

cc_library(
name = "hipblaslt",
hdrs = glob(["%{rocm_root}/include/hipblaslt/**"]),
# workaround to bring tensile files to the same fs layout as expected in the lib
# hibplatslt assumes that tensile files are located in ../hipblaslt/libraries directory
copts = ["-rpath local_config_rocm/rocm/rocm_dis/lib"],
data = glob([
"%{rocm_root}/lib/hipblaslt/**",
"%{rocm_root}/lib/libhipblaslt.so*",
]),
include_prefix = "rocm",
includes = [
"%{rocm_root}/include/",
Expand Down

0 comments on commit 6e89c4c

Please sign in to comment.