Skip to content

Commit

Permalink
Remove IS_MSVC bool and build_host_info().compiler usage (#3204)
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookresearch/FBGEMM#303

Pull Request resolved: #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
  • Loading branch information
jdonald authored and facebook-github-bot committed Oct 2, 2024
1 parent c24a72d commit 7c2bfb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7c2bfb8

Please sign in to comment.