[better_engineering][multiplatform] Repalce host_info() check with select for default_compiler_flags (#98306)

Summary: Same as title

Test Plan: CI

Differential Revision: D44667769

Pull Request resolved: https://github.com/pytorch/pytorch/pull/98306
Approved by: https://github.com/priyaramani, https://github.com/malfet
This commit is contained in:
Keshav Kolur
2023-04-07 15:39:38 +00:00
committed by PyTorch MergeBot
parent 390c51bf87
commit 79e14f8fd6

View File

@ -43,11 +43,12 @@ default_compiler_flags = [
# nvrtc library which we load canonically anyway
"-DUSE_DIRECT_NVRTC",
"-DUSE_RUY_QMATMUL",
] + ([] if native.host_info().os.is_windows else [
] + select({
# XNNPACK depends on an updated version of pthreadpool interface, whose implementation
# includes <pthread.h> - a header not available on Windows.
"-DUSE_XNNPACK",
]) + (["-O1"] if native.read_config("fbcode", "build_mode_test_label", "") == "dev-nosan" else [])
"DEFAULT": ["-DUSE_XNNPACK"],
"ovr_config//os:windows": [],
}) + (["-O1"] if native.read_config("fbcode", "build_mode_test_label", "") == "dev-nosan" else [])
compiler_specific_flags = {
"clang": [