Skip to content

Commit 0b5d9d4

Browse files
desertfirefacebook-github-bot
authored andcommitted
Extract DeviceType to a standalone header file (#11145)
Summary: X-link: pytorch/pytorch#154417 The goal of this PR and future follow-up PRs is to group a set of header files required by AOTInductor Standalone in a separate directory, ensuring they are implemented in a header-only manner. More specifically, here is what this PR does: * Extract the DeviceType enum class into a standalone header file in a new torch/standalone/header_only directory * Retain the existing c10/core/DeviceType.[h|cpp] files to handle complex logic and static variables * Import symbols from the new torch::standalone namespace into c10 for backward compatibility This is an updated version of pytorch/pytorch#152787, because we need to land in fbcode first. See the original comments and discussions in pytorch/pytorch#152787. Reviewed By: janeyx99 Differential Revision: D75313723
1 parent 0cf2d53 commit 0b5d9d4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def define_common_targets():
6565
fbcode_exported_deps = ([
6666
"//caffe2:aten-headers-cpu",
6767
"//caffe2:generated-config-header",
68+
"//caffe2:torch_standalone_headers",
6869
"//caffe2/c10:c10_headers",
6970
] + select({
7071
"DEFAULT": [],
@@ -83,6 +84,7 @@ def define_common_targets():
8384
] + get_sleef_preprocessor_flags(),
8485
xplat_exported_deps = [
8586
"//xplat/caffe2:aten_header",
87+
"//xplat/caffe2:torch_standalone_headers",
8688
"//xplat/caffe2/c10:c10_headers",
8789
] + ["//xplat/caffe2:ovrsource_aten_Config.h" if is_arvr_mode() else "//xplat/caffe2:generated_aten_config_header",],
8890
exported_preprocessor_flags = select({

0 commit comments

Comments
 (0)