mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
This reverts commit 0341deb1c7.
Reverted https://github.com/pytorch/pytorch/pull/109881 on behalf of https://github.com/albanD due to It does break buck build ([comment](https://github.com/pytorch/pytorch/pull/109881#issuecomment-1756195823))
108 lines
2.8 KiB
Python
108 lines
2.8 KiB
Python
def define_targets(rules):
|
|
rules.cc_library(
|
|
name = "CPUAllocator",
|
|
srcs = ["CPUAllocator.cpp"],
|
|
hdrs = ["CPUAllocator.h"],
|
|
linkstatic = True,
|
|
local_defines = ["C10_BUILD_MAIN_LIB"],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":alignment",
|
|
":base",
|
|
"//c10/mobile:CPUCachingAllocator",
|
|
"//c10/mobile:CPUProfilingAllocator",
|
|
"//c10/util:base",
|
|
],
|
|
# This library defines a flag, The use of alwayslink keeps it
|
|
# from being stripped.
|
|
alwayslink = True,
|
|
)
|
|
|
|
rules.cc_library(
|
|
name = "ScalarType",
|
|
hdrs = ["ScalarType.h"],
|
|
linkstatic = True,
|
|
local_defines = ["C10_BUILD_MAIN_LIB"],
|
|
visibility = ["//visibility:public"],
|
|
deps = ["//c10/util:base"],
|
|
)
|
|
|
|
rules.cc_library(
|
|
name = "alignment",
|
|
hdrs = ["alignment.h"],
|
|
linkstatic = True,
|
|
local_defines = ["C10_BUILD_MAIN_LIB"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
rules.cc_library(
|
|
name = "alloc_cpu",
|
|
srcs = ["impl/alloc_cpu.cpp"],
|
|
hdrs = ["impl/alloc_cpu.h"],
|
|
linkstatic = True,
|
|
local_defines = ["C10_BUILD_MAIN_LIB"],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":alignment",
|
|
"//c10/macros",
|
|
"//c10/util:base",
|
|
],
|
|
# This library defines flags, The use of alwayslink keeps them
|
|
# from being stripped.
|
|
alwayslink = True,
|
|
)
|
|
|
|
rules.cc_library(
|
|
name = "base",
|
|
srcs = rules.glob(
|
|
[
|
|
"*.cpp",
|
|
"impl/*.cpp",
|
|
"impl/cow/*.cpp",
|
|
],
|
|
exclude = [
|
|
"CPUAllocator.cpp",
|
|
"impl/alloc_cpu.cpp",
|
|
],
|
|
),
|
|
hdrs = rules.glob(
|
|
[
|
|
"*.h",
|
|
"impl/*.h",
|
|
"impl/cow/*.h",
|
|
],
|
|
exclude = [
|
|
"CPUAllocator.h",
|
|
"impl/alloc_cpu.h",
|
|
],
|
|
),
|
|
linkstatic = True,
|
|
local_defines = ["C10_BUILD_MAIN_LIB"],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":ScalarType",
|
|
"//third_party/cpuinfo",
|
|
"//c10/macros",
|
|
"//c10/util:TypeCast",
|
|
"//c10/util:base",
|
|
"//c10/util:typeid",
|
|
],
|
|
# This library uses flags and registration. Do not let the
|
|
# linker remove them.
|
|
alwayslink = True,
|
|
)
|
|
|
|
rules.filegroup(
|
|
name = "headers",
|
|
srcs = rules.glob(
|
|
[
|
|
"*.h",
|
|
"impl/*.h",
|
|
],
|
|
exclude = [
|
|
"alignment.h",
|
|
],
|
|
),
|
|
visibility = ["//c10:__pkg__"],
|
|
)
|