@@ -4,12 +4,15 @@ def get_preprocessor_flags(is_fbcode):
4
4
flags = ["-DSTANDALONE_TORCH_HEADER" ]
5
5
if runtime .is_oss :
6
6
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
+ })
13
16
14
17
x86_avx2_flags = [
15
18
"-DCPU_CAPABILITY_AVX2" ,
@@ -34,13 +37,16 @@ def get_sleef_deps():
34
37
if runtime .is_oss :
35
38
return []
36
39
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" : [],
44
50
})
45
51
46
52
def define_common_targets ():
@@ -70,7 +76,7 @@ def define_common_targets():
70
76
"//xplat/caffe2/c10:c10_headers" ,
71
77
("//xplat/caffe2:ovrsource_aten_Config.h"
72
78
if is_arvr_mode () else "//xplat/caffe2:generated_aten_config_header" ),
73
- ], # + get_sleef_deps(), # TODO: enable Sleef in xplat?
79
+ ] + get_sleef_deps (),
74
80
fbcode_exported_deps = ([
75
81
"//caffe2:aten-headers-cpu" ,
76
82
"//caffe2:generated-config-header" ,
0 commit comments