From 74b41af2ad22bad599c437e6687f0589b52c8ec3 Mon Sep 17 00:00:00 2001 From: Andrew Gallagher Date: Wed, 6 Jul 2022 23:42:57 +0000 Subject: [PATCH] [caffe2] Use `arch_deps` instead of host info for arch-specific deps (#80814) Test Plan: CI Reviewed By: psaab Differential Revision: D37588154 topic: not user facing Pull Request resolved: https://github.com/pytorch/pytorch/pull/80814 Approved by: https://github.com/mehtanirav --- defs.bzl | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/defs.bzl b/defs.bzl index c81f59274c1c..a40ee4b9091d 100644 --- a/defs.bzl +++ b/defs.bzl @@ -1,19 +1,20 @@ -def get_sleef_deps(): - return [("sleef", None, "sleef")] if not (host_info().arch.is_aarch64) else [] +def get_sleef_arch_deps(): + return [ + ("x86_64", [ + "third-party//sleef:sleef", + ]), + ] -def get_blas_gomp_deps(): - if host_info().arch.is_x86_64: - return [( - "IntelComposerXE", - None, - native.read_config("fbcode", "mkl_lp64", "mkl_lp64_omp"), - )] - if host_info().arch.is_aarch64: - return [ - ("OpenBLAS", None, "OpenBLAS"), - ("openmp", None, "omp"), - ] - fail("Unsupported architecture") +def get_blas_gomp_arch_deps(): + return [ + ("x86_64", [ + "third-party//IntelComposerXE:{}".format(native.read_config("fbcode", "mkl_lp64", "mkl_lp64_omp")), + ]), + ("aarch64", [ + "third-party//OpenBLAS:OpenBLAS", + "third-party//openmp:omp", + ]), + ] default_compiler_flags = [ "-Wall",