This repository has been archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
/
BUILD
103 lines (95 loc) · 3.84 KB
/
BUILD
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
licenses(["notice"]) # Apache 2.0
package(default_visibility = ["//visibility:public"])
load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda_is_configured", "if_cuda")
config_setting(
name = "windows",
constraint_values = ["@bazel_tools//platforms:windows"],
)
cc_library(
name = "cuda",
data = [
"@local_config_cuda//cuda:cudart",
],
linkopts = select({
"@local_config_cuda//cuda:darwin": [
"-Wl,-rpath,../local_config_cuda/cuda/lib",
"-Wl,-rpath,../local_config_cuda/cuda/extras/CUPTI/lib",
],
":windows": [],
"//conditions:default": [
"-Wl,-rpath,../local_config_cuda/cuda/lib64",
"-Wl,-rpath,../local_config_cuda/cuda/extras/CUPTI/lib64",
],
}),
deps = [
"@local_config_cuda//cuda:cudart",
],
)
cc_library(
name = "time_two_ops_gpu",
srcs = ["cc/kernels/time_two.h", "cc/kernels/time_two_kernels.cu.cc"],
deps = [
"@local_config_tf//:libtensorflow_framework",
"@local_config_tf//:tf_header_lib",
] + if_cuda_is_configured([":cuda", "@local_config_cuda//cuda:cuda_headers"]),
alwayslink = 1,
linkopts = [],
copts = select({
":windows": ["/D__CLANG_SUPPORT_DYN_ANNOTATION__", "/DEIGEN_MPL2_ONLY", "/DEIGEN_MAX_ALIGN_BYTES=64", "/DEIGEN_HAS_TYPE_TRAITS=0", "/DTF_USE_SNAPPY", "/showIncludes", "/MD", "/O2", "/DNDEBUG", "/w", "-DWIN32_LEAN_AND_MEAN", "-DNOGDI", "/d2ReducedOptimizeHugeFunctions", "/arch:AVX", "/std:c++14", "-DTENSORFLOW_MONOLITHIC_BUILD", "/DPLATFORM_WINDOWS", "/DEIGEN_HAS_C99_MATH", "/DTENSORFLOW_USE_EIGEN_THREADPOOL", "/DEIGEN_AVOID_STL_ARRAY", "/Iexternal/gemmlowp", "/wd4018", "/wd4577", "/DNOGDI", "/UTF_COMPILE_LIBRARY"],
"//conditions:default": ["-pthread", "-std=c++11", "-D_GLIBCXX_USE_CXX11_ABI=0"],
}) + if_cuda_is_configured(["-DTENSORFLOW_USE_NVCC=1", "-DGOOGLE_CUDA=1", "-x cuda", "-nvcc_options=relaxed-constexpr", "-nvcc_options=ftz=true"]),
)
cc_binary(
name = 'python/ops/_time_two_ops.so',
srcs = [
"cc/kernels/time_two.h",
"cc/kernels/time_two_kernels.cc",
"cc/ops/time_two_ops.cc",
],
linkshared = 1,
features = select({
":windows": ["windows_export_all_symbols"],
"//conditions:default": [],
}),
deps = [
"@local_config_tf//:libtensorflow_framework",
"@local_config_tf//:tf_header_lib",
] + if_cuda_is_configured([":time_two_ops_gpu"]),
copts = select({
":windows": ["/D__CLANG_SUPPORT_DYN_ANNOTATION__", "/DEIGEN_MPL2_ONLY", "/DEIGEN_MAX_ALIGN_BYTES=64", "/DEIGEN_HAS_TYPE_TRAITS=0", "/DTF_USE_SNAPPY", "/showIncludes", "/MD", "/O2", "/DNDEBUG", "/w", "-DWIN32_LEAN_AND_MEAN", "-DNOGDI", "/d2ReducedOptimizeHugeFunctions", "/arch:AVX", "/std:c++14", "-DTENSORFLOW_MONOLITHIC_BUILD", "/DPLATFORM_WINDOWS", "/DEIGEN_HAS_C99_MATH", "/DTENSORFLOW_USE_EIGEN_THREADPOOL", "/DEIGEN_AVOID_STL_ARRAY", "/Iexternal/gemmlowp", "/wd4018", "/wd4577", "/DNOGDI", "/UTF_COMPILE_LIBRARY"],
"//conditions:default": ["-pthread", "-std=c++11", "-D_GLIBCXX_USE_CXX11_ABI=0"],
}) + if_cuda_is_configured(["-DTENSORFLOW_USE_NVCC=1", "-DGOOGLE_CUDA=1", "-x cuda", "-nvcc_options=relaxed-constexpr", "-nvcc_options=ftz=true"]),
)
py_library(
name = "time_two_ops_py",
srcs = ([
"python/ops/time_two_ops.py",
]),
data = [
":python/ops/_time_two_ops.so"
],
srcs_version = "PY2AND3",
)
py_test(
name = "time_two_ops_py_test",
srcs = [
"python/ops/time_two_ops_test.py"
],
main = "python/ops/time_two_ops_test.py",
deps = [
":time_two_ops_py",
],
srcs_version = "PY2AND3",
)
py_library(
name = "time_two_py",
srcs = ([
"__init__.py",
"python/__init__.py",
"python/ops/__init__.py",
]),
deps = [
":time_two_ops_py"
],
srcs_version = "PY2AND3",
)