mirror of
https://github.com/zebrajr/pytorch.git
synced 2026-01-15 12:15:51 +00:00
Summary: Some build rules want to consume c10 from an external source. Convert it to an alias (like other pytorch entry points), and redirect conda builds to use the `fbcode//conda/buck_integration/toolchains/third-party:torch-cpp` target. Test Plan: CI. Reviewed By: athmasagar Differential Revision: D81518888 Pull Request resolved: https://github.com/pytorch/pytorch/pull/169004 Approved by: https://github.com/malfet
36 lines
1002 B
Python
36 lines
1002 B
Python
def define_targets(rules, c10_name = "c10"):
|
|
rules.cc_library(
|
|
name = c10_name,
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//c10/core:CPUAllocator",
|
|
"//c10/core:ScalarType",
|
|
"//c10/core:alignment",
|
|
"//c10/core:alloc_cpu",
|
|
"//c10/core:base",
|
|
"//c10/macros",
|
|
"//c10/mobile:CPUCachingAllocator",
|
|
"//c10/mobile:CPUProfilingAllocator",
|
|
"//c10/util:TypeCast",
|
|
"//c10/util:base",
|
|
"//c10/util:typeid",
|
|
] + rules.if_cuda(
|
|
[
|
|
"//c10/cuda:cuda",
|
|
"//c10/cuda:Macros",
|
|
],
|
|
[],
|
|
),
|
|
)
|
|
|
|
rules.cc_library(
|
|
name = c10_name + "_headers",
|
|
deps = [
|
|
"//c10/core:base_headers",
|
|
"//c10/macros",
|
|
"//c10/util:base_headers",
|
|
"//c10/util:bit_cast",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|