mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
extract out a caffe2 macros library (#98156)
Slowly carving out the minimal caffe2 dependencies to build PyTorch. Differential Revision: [D44609764](https://our.internmc.facebook.com/intern/diff/D44609764/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D44609764/)! Pull Request resolved: https://github.com/pytorch/pytorch/pull/98156 Approved by: https://github.com/ezyang, https://github.com/PaliC
This commit is contained in:
committed by
PyTorch MergeBot
parent
f6272ce79d
commit
950431c334
79
BUILD.bazel
79
BUILD.bazel
@ -1261,7 +1261,7 @@ cc_library(
|
|||||||
copts = CAFFE2_COPTS,
|
copts = CAFFE2_COPTS,
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
":caffe2_core_macros_h",
|
":caffe2_core_macros",
|
||||||
"//c10:headers",
|
"//c10:headers",
|
||||||
"//caffe2/proto:caffe2_pb",
|
"//caffe2/proto:caffe2_pb",
|
||||||
],
|
],
|
||||||
@ -1292,41 +1292,46 @@ genrule(
|
|||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "caffe2_headers",
|
name = "caffe2_headers",
|
||||||
hdrs = glob([
|
hdrs = glob(
|
||||||
"caffe2/contrib/aten/*.h",
|
[
|
||||||
"caffe2/contrib/gloo/*.h",
|
"caffe2/contrib/aten/*.h",
|
||||||
"caffe2/core/*.h",
|
"caffe2/contrib/gloo/*.h",
|
||||||
"caffe2/core/nomnigraph/include/nomnigraph/Converters/*.h",
|
"caffe2/core/*.h",
|
||||||
"caffe2/core/nomnigraph/include/nomnigraph/Generated/*.h",
|
"caffe2/core/nomnigraph/include/nomnigraph/Converters/*.h",
|
||||||
"caffe2/core/nomnigraph/include/nomnigraph/Graph/*.h",
|
"caffe2/core/nomnigraph/include/nomnigraph/Generated/*.h",
|
||||||
"caffe2/core/nomnigraph/include/nomnigraph/Representations/*.h",
|
"caffe2/core/nomnigraph/include/nomnigraph/Graph/*.h",
|
||||||
"caffe2/core/nomnigraph/include/nomnigraph/Support/*.h",
|
"caffe2/core/nomnigraph/include/nomnigraph/Representations/*.h",
|
||||||
"caffe2/core/nomnigraph/include/nomnigraph/Transformations/*.h",
|
"caffe2/core/nomnigraph/include/nomnigraph/Support/*.h",
|
||||||
"caffe2/core/nomnigraph/tests/*.h",
|
"caffe2/core/nomnigraph/include/nomnigraph/Transformations/*.h",
|
||||||
"caffe2/db/*.h",
|
"caffe2/core/nomnigraph/tests/*.h",
|
||||||
"caffe2/distributed/*.h",
|
"caffe2/db/*.h",
|
||||||
"caffe2/ideep/*.h",
|
"caffe2/distributed/*.h",
|
||||||
"caffe2/ideep/operators/*.h",
|
"caffe2/ideep/*.h",
|
||||||
"caffe2/ideep/operators/quantization/*.h",
|
"caffe2/ideep/operators/*.h",
|
||||||
"caffe2/ideep/utils/*.h",
|
"caffe2/ideep/operators/quantization/*.h",
|
||||||
"caffe2/onnx/*.h",
|
"caffe2/ideep/utils/*.h",
|
||||||
"caffe2/operators/*.h",
|
"caffe2/onnx/*.h",
|
||||||
"caffe2/operators/rnn/*.h",
|
"caffe2/operators/*.h",
|
||||||
"caffe2/opt/*.h",
|
"caffe2/operators/rnn/*.h",
|
||||||
"caffe2/perfkernels/*.h",
|
"caffe2/opt/*.h",
|
||||||
"caffe2/predictor/*.h",
|
"caffe2/perfkernels/*.h",
|
||||||
"caffe2/predictor/emulator/*.h",
|
"caffe2/predictor/*.h",
|
||||||
"caffe2/quantization/server/*.h",
|
"caffe2/predictor/emulator/*.h",
|
||||||
"caffe2/queue/*.h",
|
"caffe2/quantization/server/*.h",
|
||||||
"caffe2/serialize/*.h",
|
"caffe2/queue/*.h",
|
||||||
"caffe2/sgd/*.h",
|
"caffe2/serialize/*.h",
|
||||||
"caffe2/share/contrib/depthwise/*.h",
|
"caffe2/sgd/*.h",
|
||||||
"caffe2/transforms/*.h",
|
"caffe2/share/contrib/depthwise/*.h",
|
||||||
"caffe2/utils/*.h",
|
"caffe2/transforms/*.h",
|
||||||
"caffe2/utils/math/*.h",
|
"caffe2/utils/*.h",
|
||||||
"caffe2/utils/threadpool/*.h",
|
"caffe2/utils/math/*.h",
|
||||||
"modules/**/*.h",
|
"caffe2/utils/threadpool/*.h",
|
||||||
]) + if_cuda(glob([
|
"modules/**/*.h",
|
||||||
|
],
|
||||||
|
exclude = [
|
||||||
|
"caffe2/core/macros.h",
|
||||||
|
],
|
||||||
|
) + if_cuda(glob([
|
||||||
"caffe2/**/*.cuh",
|
"caffe2/**/*.cuh",
|
||||||
"caffe2/image/*.h",
|
"caffe2/image/*.h",
|
||||||
])) + [":generated_caffe2_aten_op_headers"],
|
])) + [":generated_caffe2_aten_op_headers"],
|
||||||
@ -1337,6 +1342,7 @@ cc_library(
|
|||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
":caffe2_core_macros",
|
||||||
":caffe2_for_aten_headers",
|
":caffe2_for_aten_headers",
|
||||||
"//caffe2/proto:caffe2_pb",
|
"//caffe2/proto:caffe2_pb",
|
||||||
"//caffe2/proto:cc_proto",
|
"//caffe2/proto:cc_proto",
|
||||||
@ -1395,6 +1401,7 @@ cc_library(
|
|||||||
linkstatic = 1,
|
linkstatic = 1,
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
":caffe2_core_macros",
|
||||||
":caffe2_dnnlowp_avx2_ops",
|
":caffe2_dnnlowp_avx2_ops",
|
||||||
":caffe2_headers",
|
":caffe2_headers",
|
||||||
":caffe2_perfkernels_avx",
|
":caffe2_perfkernels_avx",
|
||||||
|
@ -6,6 +6,11 @@ load(
|
|||||||
)
|
)
|
||||||
|
|
||||||
def define_targets(rules):
|
def define_targets(rules):
|
||||||
|
rules.cc_library(
|
||||||
|
name = "caffe2_core_macros",
|
||||||
|
hdrs = [":caffe2_core_macros_h"],
|
||||||
|
)
|
||||||
|
|
||||||
rules.cmake_configure_file(
|
rules.cmake_configure_file(
|
||||||
name = "caffe2_core_macros_h",
|
name = "caffe2_core_macros_h",
|
||||||
src = "caffe2/core/macros.h.in",
|
src = "caffe2/core/macros.h.in",
|
||||||
|
Reference in New Issue
Block a user