From 7c2bfb8f7c99be8b897fdf9186e84ef1d2445a49 Mon Sep 17 00:00:00 2001 From: James Donald Date: Tue, 1 Oct 2024 18:42:03 -0700 Subject: [PATCH] Remove IS_MSVC bool and build_host_info().compiler usage (#3204) Summary: X-link: https://github.com/facebookresearch/FBGEMM/pull/303 Pull Request resolved: https://github.com/pytorch/FBGEMM/pull/3204 `build_host_info()` checks come from buck1, as in buck1 we didn't have a concept of a 'host select()', whereas on buck2 it is preferred to use `select()` after doing a proper configuration transition to the execution platform. Replace the call to `build_host_info().compiler` here with a select(). Note we still retain function arguments like `msvc` and `buck` as these are apparently used in the CMake build flow. Reviewed By: 8Keep Differential Revision: D63710016 fbshipit-source-id: 21864acf1a5ad4eb7a1a71b55723f6667aaae362 --- defs.bzl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/defs.bzl b/defs.bzl index 43d17b13e..9da6f6920 100644 --- a/defs.bzl +++ b/defs.bzl @@ -105,7 +105,8 @@ def get_fbgemm_inline_avx2_srcs(msvc = False, buck = False): asm_srcs = ["src/FbgemmFP16UKernelsAvx2.cc"] if buck: return select({ - "DEFAULT": asm_srcs if not msvc else intrinsics_srcs, + "DEFAULT": asm_srcs, + "ovr_config//compiler:cl": intrinsics_srcs, "ovr_config//cpu:arm64": intrinsics_srcs, }) return asm_srcs if not msvc else intrinsics_srcs @@ -135,7 +136,8 @@ def get_fbgemm_inline_avx512_srcs(msvc = False, buck = False): ] if buck: return select({ - "DEFAULT": asm_srcs if not msvc else intrinsics_srcs, + "DEFAULT": asm_srcs, + "ovr_config//compiler:cl": intrinsics_srcs, "ovr_config//cpu:arm64": intrinsics_srcs, }) return asm_srcs if not msvc else intrinsics_srcs