@@ -4,12 +4,15 @@ def get_preprocessor_flags(is_fbcode):
44 flags = ["-DSTANDALONE_TORCH_HEADER" ]
55 if runtime .is_oss :
66 return flags
7- arm64_flags = [
8- "-DCPU_CAPABILITY_DEFAULT" ,
9- ]
10- if is_fbcode :
11- # TODO: enable Sleef in xplat?
12- arm64_flags = arm64_flags + ["-DAT_BUILD_ARM_VEC256_WITH_SLEEF" ]
7+ # AT_BUILD_ARM_VEC256_WITH_SLEEF is off on Windows because Sleef
8+ # is off on Windows per get_sleef_deps below.
9+ arm64_flags = select ({
10+ "DEFAULT" : [
11+ "-DCPU_CAPABILITY_DEFAULT" ,
12+ "-DAT_BUILD_ARM_VEC256_WITH_SLEEF" ,
13+ ],
14+ "ovr_config//os:windows" : ["-DCPU_CAPABILITY_DEFAULT" ],
15+ })
1316
1417 x86_avx2_flags = [
1518 "-DCPU_CAPABILITY_AVX2" ,
@@ -34,13 +37,16 @@ def get_sleef_deps():
3437 if runtime .is_oss :
3538 return []
3639 return select ({
37- "DEFAULT" : [],
38- "ovr_config//cpu:x86_64" : [
39- "fbsource//third-party/sleef:sleef" ,
40- ],
41- "ovr_config//cpu:arm64" : [
42- "fbsource//third-party/sleef:sleef" ,
43- ],
40+ "DEFAULT" : select ({
41+ "DEFAULT" : [],
42+ "ovr_config//cpu:x86_64" : [
43+ "fbsource//third-party/sleef:sleef" ,
44+ ],
45+ "ovr_config//cpu:arm64" : [
46+ "fbsource//third-party/sleef:sleef" ,
47+ ],
48+ }),
49+ "ovr_config//os:windows" : [],
4450 })
4551
4652def define_common_targets ():
@@ -107,7 +113,7 @@ def define_common_targets():
107113 "//xplat/caffe2/c10:c10_headers" ,
108114 ("//xplat/caffe2:ovrsource_aten_Config.h"
109115 if is_arvr_mode () else "//xplat/caffe2:generated_aten_config_header" ),
110- ], # + get_sleef_deps(), # TODO: enable Sleef in xplat?
116+ ] + get_sleef_deps (),
111117 fbcode_exported_deps = ([
112118 "//caffe2:aten-headers-cpu" ,
113119 "//caffe2:generated-config-header" ,
0 commit comments