Skip to content

Commit 74b41af

Browse files
andrewjcgpytorchmergebot
authored andcommitted
[caffe2] Use arch_deps instead of host info for arch-specific deps (pytorch#80814)
Test Plan: CI Reviewed By: psaab Differential Revision: D37588154 topic: not user facing Pull Request resolved: pytorch#80814 Approved by: https://github.com/mehtanirav
1 parent e08026d commit 74b41af

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

defs.bzl

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
def get_sleef_deps():
2-
return [("sleef", None, "sleef")] if not (host_info().arch.is_aarch64) else []
1+
def get_sleef_arch_deps():
2+
return [
3+
("x86_64", [
4+
"third-party//sleef:sleef",
5+
]),
6+
]
37

4-
def get_blas_gomp_deps():
5-
if host_info().arch.is_x86_64:
6-
return [(
7-
"IntelComposerXE",
8-
None,
9-
native.read_config("fbcode", "mkl_lp64", "mkl_lp64_omp"),
10-
)]
11-
if host_info().arch.is_aarch64:
12-
return [
13-
("OpenBLAS", None, "OpenBLAS"),
14-
("openmp", None, "omp"),
15-
]
16-
fail("Unsupported architecture")
8+
def get_blas_gomp_arch_deps():
9+
return [
10+
("x86_64", [
11+
"third-party//IntelComposerXE:{}".format(native.read_config("fbcode", "mkl_lp64", "mkl_lp64_omp")),
12+
]),
13+
("aarch64", [
14+
"third-party//OpenBLAS:OpenBLAS",
15+
"third-party//openmp:omp",
16+
]),
17+
]
1718

1819
default_compiler_flags = [
1920
"-Wall",

0 commit comments

Comments
 (0)