Skip to content

Commit f21bd43

Browse files
committed
Update
[ghstack-poisoned]
1 parent 8f1ded2 commit f21bd43

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

runtime/core/portable_type/c10/c10/targets.bzl

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

4652
def define_common_targets():
@@ -70,7 +76,7 @@ def define_common_targets():
7076
"//xplat/caffe2/c10:c10_headers",
7177
("//xplat/caffe2:ovrsource_aten_Config.h"
7278
if is_arvr_mode() else "//xplat/caffe2:generated_aten_config_header"),
73-
], # + get_sleef_deps(), # TODO: enable Sleef in xplat?
79+
] + get_sleef_deps(),
7480
fbcode_exported_deps = ([
7581
"//caffe2:aten-headers-cpu",
7682
"//caffe2:generated-config-header",

0 commit comments

Comments
 (0)