Skip to content

Commit 79a1c26

Browse files
authored
Fix format of Custom Ops build (#2346)
1 parent e71ee60 commit 79a1c26

File tree

1 file changed

+47
-17
lines changed

1 file changed

+47
-17
lines changed

keras_cv/custom_ops/BUILD

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,68 @@ cc_library(
1111
name = "box_util",
1212
srcs = ["box_util.cc"],
1313
hdrs = ["box_util.h"],
14+
copts = select({
15+
":windows": [
16+
"/DEIGEN_STRONG_INLINE=inline",
17+
"-DTENSORFLOW_MONOLITHIC_BUILD",
18+
"/DPLATFORM_WINDOWS",
19+
"/DEIGEN_HAS_C99_MATH",
20+
"/DTENSORFLOW_USE_EIGEN_THREADPOOL",
21+
"/DEIGEN_AVOID_STL_ARRAY",
22+
"/Iexternal/gemmlowp",
23+
"/wd4018",
24+
"/wd4577",
25+
"/DNOGDI",
26+
"/UTF_COMPILE_LIBRARY",
27+
],
28+
"//conditions:default": [
29+
"-pthread",
30+
"-std=c++17",
31+
],
32+
}),
1433
deps = [
1534
"@local_config_tf//:libtensorflow_framework",
1635
"@local_config_tf//:tf_header_lib",
1736
],
18-
copts = select({
19-
":windows": ["/DEIGEN_STRONG_INLINE=inline", "-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"],
20-
"//conditions:default": ["-pthread", "-std=c++17"],
21-
}),
2237
)
2338

2439
cc_binary(
25-
name = '_keras_cv_custom_ops.so',
40+
name = "_keras_cv_custom_ops.so",
2641
srcs = [
2742
"kernels/pairwise_iou_kernel.cc",
28-
"ops/pairwise_iou_op.cc",
29-
"kernels/withinbox_op.cc",
30-
"ops/withinbox_op.cc",
3143
"kernels/within_any_box_op.cc",
44+
"kernels/withinbox_op.cc",
45+
"ops/pairwise_iou_op.cc",
3246
"ops/within_any_box_op.cc",
47+
"ops/withinbox_op.cc",
3348
],
49+
copts = select({
50+
":windows": [
51+
"/DEIGEN_STRONG_INLINE=inline",
52+
"-DTENSORFLOW_MONOLITHIC_BUILD",
53+
"/DPLATFORM_WINDOWS",
54+
"/DEIGEN_HAS_C99_MATH",
55+
"/DTENSORFLOW_USE_EIGEN_THREADPOOL",
56+
"/DEIGEN_AVOID_STL_ARRAY",
57+
"/Iexternal/gemmlowp",
58+
"/wd4018",
59+
"/wd4577",
60+
"/DNOGDI",
61+
"/UTF_COMPILE_LIBRARY",
62+
],
63+
"//conditions:default": [
64+
"-pthread",
65+
"-std=c++17",
66+
],
67+
}),
68+
features = select({
69+
":windows": ["windows_export_all_symbols"],
70+
"//conditions:default": [],
71+
}),
3472
linkshared = 1,
3573
deps = [
74+
":box_util",
3675
"@local_config_tf//:libtensorflow_framework",
3776
"@local_config_tf//:tf_header_lib",
38-
":box_util",
3977
],
40-
features = select({
41-
":windows": ["windows_export_all_symbols"],
42-
"//conditions:default": [],
43-
}),
44-
copts = select({
45-
":windows": ["/DEIGEN_STRONG_INLINE=inline", "-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"],
46-
"//conditions:default": ["-pthread", "-std=c++17"],
47-
}),
4878
)

0 commit comments

Comments
 (0)