mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Use c10 version of half/bfloat16 in executorch (#144111)
Summary: X-link: https://github.com/pytorch/executorch/pull/7040 Accomplished by importing relevant files from c10 into executorch/runtime/core/portable_type/c10, and then using `using` in the top-level ExecuTorch headers. This approach should keep the ExecuTorch build hermetic for embedded use cases. In the future, we should add a CI job to ensure the c10 files stay identical to the PyTorch ones. ghstack-source-id: 260047850 exported-using-ghexport Test Plan: builds Differential Revision: D66106969 Pull Request resolved: https://github.com/pytorch/pytorch/pull/144111 Approved by: https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
92b7e610ab
commit
ade8fee512
@ -997,6 +997,7 @@ def define_buck_targets(
|
||||
"Config.h": ":generate_aten_config[Config.h]",
|
||||
},
|
||||
labels = labels,
|
||||
visibility = ["PUBLIC"],
|
||||
)
|
||||
|
||||
fb_xplat_cxx_library(
|
||||
|
||||
@ -22,3 +22,15 @@ def define_targets(rules):
|
||||
[],
|
||||
),
|
||||
)
|
||||
|
||||
rules.cc_library(
|
||||
name = "c10_headers",
|
||||
deps = [
|
||||
"//c10/core:base_headers",
|
||||
"//c10/macros",
|
||||
"//c10/util:base_headers",
|
||||
"//c10/util:bit_cast",
|
||||
"//c10/util:ssize",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
@ -90,6 +90,22 @@ def define_targets(rules):
|
||||
alwayslink = True,
|
||||
)
|
||||
|
||||
rules.cc_library(
|
||||
name = "base_headers",
|
||||
srcs = [],
|
||||
hdrs = rules.glob(
|
||||
[
|
||||
"*.h",
|
||||
"impl/*.h",
|
||||
],
|
||||
exclude = [
|
||||
"CPUAllocator.h",
|
||||
"impl/alloc_cpu.h",
|
||||
],
|
||||
),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
rules.filegroup(
|
||||
name = "headers",
|
||||
srcs = rules.glob(
|
||||
@ -101,5 +117,5 @@ def define_targets(rules):
|
||||
"alignment.h",
|
||||
],
|
||||
),
|
||||
visibility = ["//c10:__pkg__"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
@ -80,6 +80,18 @@ def define_targets(rules):
|
||||
],
|
||||
)
|
||||
|
||||
rules.cc_library(
|
||||
name = "base_headers",
|
||||
hdrs = rules.glob(
|
||||
["*.h"],
|
||||
exclude = [
|
||||
"bit_cast.h",
|
||||
"ssize.h",
|
||||
],
|
||||
),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
rules.filegroup(
|
||||
name = "headers",
|
||||
srcs = rules.glob(
|
||||
|
||||
Reference in New Issue
Block a user