forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUCK.oss
122 lines (115 loc) · 3.93 KB
/
BUCK.oss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
load("//tools/build_defs:glob_defs.bzl", "subdir_glob")
load(
":pt_ops.bzl",
"pt_operator_library",
)
load(":buckbuild.bzl",
"define_buck_targets",
"get_pt_operator_registry_dict",
)
# define shared buck targets
define_buck_targets()
# define OSS only targets
cxx_library(
name = "pthreadpool",
srcs = ['caffe2/utils/threadpool/pthreadpool.cc', 'caffe2/utils/threadpool/pthreadpool_impl.cc', 'caffe2/utils/threadpool/pthreadpool-cpp.cc', 'caffe2/utils/threadpool/thread_pool_guard.cpp', 'caffe2/utils/threadpool/ThreadPool.cc'],
deps = [':caffe2_headers', '//third_party:cpuinfo', '//third_party:glog', '//c10:c10', '//third_party:FXdiv'],
exported_deps = ['//third_party:pthreadpool'],
compiler_flags = ['-Wno-unused-function'],
preferred_linkage = "static",
exported_headers = subdir_glob([("", "caffe2/utils/threadpool/*.h")]),
exported_preprocessor_flags = ['-DUSE_PTHREADPOOL'],
header_namespace = "",
headers = [],
link_whole = True,
platform_preprocessor_flags = [['windows', ['-D_WINDOWS', '-D_WIN32', '-DWIN32', '-DNOMINMAX', '-D_CRT_SECURE_NO_WARNINGS', '-D_USE_MATH_DEFINES']], ['windows.*64$', ['-D_WIN64']]],
visibility = ['PUBLIC'],
)
cxx_library(
name = "caffe2_headers",
deps = ['//c10:c10'],
exported_headers = subdir_glob(
[
("", "caffe2/**/*.h"),
("", "binaries/**/*.h"),
("modules", "**/*.h"),
("aten/src", "ATen/core/**/*.h"),
],
exclude = [
"caffe2/fb/**/*.h",
"caffe2/mobile/contrib/libopencl-stub/**/*.h",
"caffe2/mobile/contrib/libvulkan-stub/**/*.h",
"caffe2/mobile/contrib/nnapi/**/*.h",
"caffe2/mobile/fb/binary/**/*.h",
"caffe2/mobile/fb/snpe_so/**/*.h",
"caffe2/mobile/fb/boltnn/bolt_lib/include/**/*.h",
"caffe2/mobile/contrib/snpe/**/*.h",
"caffe2/mobile/fb/qpl/jni/QuickPerformanceLogger.h",
"caffe2/share/fb/x3d/ldi/*.h",
"**/*.pb.h",
],
),
compiler_flags = ['-Os', '-fexceptions', '-frtti', '-Wno-shadow', '-Wno-unknown-pragmas', '-Wno-unused-variable', '-Wno-sign-compare', '-Icaffe2', '-Imodules', '-DEIGEN_NO_DEBUG', '-DCAFFE2_USE_GOOGLE_GLOG','-DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK=1', '-DCAFFE2_IS_XPLAT_BUILD', '-DSTRIP_ERROR_MESSAGES', '-DUSE_INTERNAL_PTHREADPOOL_IMPL'],
preferred_linkage = "static",
platform_preprocessor_flags = [['windows', ['-D_WINDOWS', '-D_WIN32', '-DWIN32', '-DNOMINMAX', '-D_CRT_SECURE_NO_WARNINGS', '-D_USE_MATH_DEFINES']], ['windows.*64$', ['-D_WIN64']]],
preprocessor_flags = ['-DUSE_INTERNAL_PTHREADPOOL_IMPL'],
visibility = ['PUBLIC'],
)
cxx_library(
name = "caffe2_serialize",
srcs = [
"caffe2/serialize/file_adapter.cc",
"caffe2/serialize/inline_container.cc",
"caffe2/serialize/istream_adapter.cc",
"caffe2/serialize/read_adapter_interface.cc",
],
visibility = ["PUBLIC"],
deps = [
":caffe2_headers",
"//third_party:glog",
"//c10:c10",
"//third_party:miniz",
],
)
pt_operator_library(
name = "torch_mobile_ops_full_dev",
include_all_operators = True,
)
cxx_library(
name = "pt_ops_full",
**get_pt_operator_registry_dict(
name = "pt_ops_full",
deps = [
":torch_mobile_ops_full_dev",
],
)
)
cxx_binary(
name = 'ptmobile_benchmark',
srcs = [
'binaries/speed_benchmark_torch.cc',
],
compiler_flags = [
"-fexceptions",
"-frtti",
"-Wno-deprecated-declarations",
],
preprocessor_flags = [
"-DBUILD_LITE_INTERPRETER",
],
platform_linker_flags = [
(
"^linux.*$",
[
"-Wl,--no-as-needed",
"-ldl",
"-pthread",
],
),
],
deps = [
":torch_mobile_core",
":pt_ops_full",
"//c10:c10",
],
)