1load("//tensorflow/core/platform:rules_cc.bzl", "cc_library") 2load( 3 "//tensorflow:tensorflow.bzl", 4 "if_not_mobile", 5 "tf_cc_test", 6) 7load( 8 "//tensorflow/core/platform:build_config.bzl", 9 "tf_additional_all_protos", 10 "tf_proto_library", 11 "tf_protos_all", 12) 13 14package( 15 default_visibility = [ 16 "//tensorflow:internal", 17 ], 18 licenses = ["notice"], 19) 20 21# Export files for use on Android. 22exports_files([ 23 "captured_function.cc", 24 "captured_function.h", 25 "dataset_utils.cc", 26 "dataset_utils.h", 27 "finalization_utils.cc", 28 "finalization_utils.h", 29 "metric_utils.cc", 30 "metric_utils.h", 31 "name_utils.cc", 32 "name_utils.h", 33 "rewrite_utils.cc", 34 "rewrite_utils.h", 35 "root_dataset.cc", 36 "root_dataset.h", 37 "serialization_utils.cc", 38 "serialization_utils.h", 39 "split_utils.cc", 40 "split_utils.h", 41 "stats_utils.cc", 42 "stats_utils.h", 43 "unbounded_thread_pool.cc", 44 "unbounded_thread_pool.h", 45 "utils.cc", 46 "utils.h", 47]) 48 49cc_library( 50 name = "captured_function", 51 srcs = ["captured_function.cc"], 52 hdrs = ["captured_function.h"], 53 visibility = ["//visibility:public"], 54 deps = [ 55 ":dataset_utils", 56 ":stats_utils", 57 "@com_google_absl//absl/time", 58 "//tensorflow/core:core_cpu_internal", 59 "//tensorflow/core:framework", 60 "//tensorflow/core:framework_internal", 61 "//tensorflow/core:lib", 62 "//tensorflow/core:lib_internal", 63 "//tensorflow/core:protos_all_cc", 64 "//tensorflow/core/kernels:variable_ops", 65 "//tensorflow/core/profiler/lib:traceme", 66 ] + if_not_mobile([ 67 "//tensorflow/core/grappler:grappler_item", 68 "//tensorflow/core/grappler/optimizers:meta_optimizer", 69 ]), 70) 71 72cc_library( 73 name = "compression_utils", 74 srcs = ["compression_utils.cc"], 75 hdrs = ["compression_utils.h"], 76 deps = [ 77 ":dataset_proto_cc", 78 "//tensorflow/core:core_cpu", 79 "//tensorflow/core:core_cpu_internal", 80 "//tensorflow/core:framework_internal", 81 "//tensorflow/core:lib", 82 "//tensorflow/core:lib_internal", 83 "//tensorflow/core:protos_all_cc", 84 "@com_google_absl//absl/memory", 85 ], 86) 87 88tf_cc_test( 89 name = "compression_utils_test", 90 srcs = ["compression_utils_test.cc"], 91 tags = [ 92 "requires-mem:24g", 93 ], 94 deps = [ 95 ":compression_utils", 96 ":dataset_test_base", 97 "//tensorflow/core:lib", 98 "//tensorflow/core:lib_internal", 99 "//tensorflow/core:test", 100 "//tensorflow/core:test_main", 101 "//tensorflow/core:testlib", 102 "//tensorflow/core/platform:status_matchers", 103 ], 104) 105 106tf_proto_library( 107 name = "dataset_proto", 108 srcs = ["dataset.proto"], 109 cc_api_version = 2, 110 protodeps = tf_additional_all_protos(), 111) 112 113cc_library( 114 name = "dataset_test_base", 115 testonly = 1, 116 srcs = ["dataset_test_base.cc"], 117 hdrs = ["dataset_test_base.h"], 118 visibility = ["//visibility:public"], 119 deps = [ 120 ":dataset_utils", 121 ":name_utils", 122 ":serialization_utils", 123 ":split_utils", 124 "//tensorflow/core:core_cpu", 125 "//tensorflow/core:core_cpu_internal", 126 "//tensorflow/core:framework", 127 "//tensorflow/core:framework_internal", 128 "//tensorflow/core:lib", 129 "//tensorflow/core:lib_internal", 130 "//tensorflow/core:protos_all_cc", 131 "//tensorflow/core:test", 132 "//tensorflow/core:testlib", 133 "//tensorflow/core/framework:tensor_testutil", 134 "//tensorflow/core/kernels:function_ops", 135 "//third_party/eigen3", 136 "@com_google_absl//absl/strings", 137 ], 138) 139 140cc_library( 141 name = "dataset_utils", 142 srcs = ["dataset_utils.cc"], 143 hdrs = ["dataset_utils.h"], 144 visibility = ["//visibility:public"], 145 deps = [ 146 "//tensorflow/core:core_cpu_internal", 147 "//tensorflow/core:framework", 148 "//tensorflow/core:lib", 149 "//tensorflow/core:lib_internal", 150 "//tensorflow/core:protos_all_cc", 151 "//tensorflow/core/platform:regexp", 152 "@com_google_absl//absl/container:flat_hash_map", 153 "@com_google_absl//absl/container:flat_hash_set", 154 "@com_google_absl//absl/strings", 155 ], 156) 157 158tf_cc_test( 159 name = "dataset_utils_test", 160 size = "small", 161 srcs = ["dataset_utils_test.cc"], 162 deps = [ 163 ":dataset_test_base", 164 ":dataset_utils", 165 ":serialization_utils", 166 "//tensorflow/cc:cc_ops", 167 "//tensorflow/core:framework", 168 "//tensorflow/core:protos_all_cc", 169 "//tensorflow/core:test", 170 "//tensorflow/core:test_main", 171 "//tensorflow/core/platform:str_util", 172 "//tensorflow/core/util:determinism_test_util", 173 "@com_google_absl//absl/container:flat_hash_set", 174 ], 175) 176 177cc_library( 178 name = "hash_utils", 179 srcs = ["hash_utils.cc"], 180 hdrs = ["hash_utils.h"], 181 deps = [ 182 ":dataset_utils", 183 "//tensorflow/core:core_cpu_internal", 184 "//tensorflow/core:framework", 185 "//tensorflow/core:lib", 186 "//tensorflow/core:lib_internal", 187 "//tensorflow/core:protos_all_cc", 188 "//tensorflow/core/platform:regexp", 189 "@com_google_absl//absl/container:flat_hash_map", 190 "@com_google_absl//absl/container:flat_hash_set", 191 "@com_google_absl//absl/strings", 192 ], 193) 194 195tf_cc_test( 196 name = "hash_utils_test", 197 size = "small", 198 srcs = ["hash_utils_test.cc"], 199 deps = [ 200 ":hash_utils", 201 "//tensorflow/cc:cc_ops", 202 "//tensorflow/core:framework", 203 "//tensorflow/core:protos_all_cc", 204 "//tensorflow/core:test", 205 "//tensorflow/core:test_main", 206 ], 207) 208 209cc_library( 210 name = "metric_utils", 211 srcs = ["metric_utils.cc"], 212 hdrs = ["metric_utils.h"], 213 visibility = ["//visibility:public"], 214 deps = [ 215 "//tensorflow/core:framework", 216 "//tensorflow/core/data:utils", 217 "//tensorflow/core/platform:env", 218 "//tensorflow/core/platform:mutex", 219 "//tensorflow/core/platform:thread_annotations", 220 "@com_google_absl//absl/time", 221 ], 222) 223 224tf_cc_test( 225 name = "metric_utils_test", 226 size = "small", 227 srcs = ["metric_utils_test.cc"], 228 deps = [ 229 ":metric_utils", 230 "//tensorflow/core:framework", 231 "//tensorflow/core:test", 232 "//tensorflow/core:test_main", 233 "//tensorflow/core/lib/monitoring:cell_reader", 234 "//tensorflow/core/lib/monitoring:test_utils", 235 "//tensorflow/core/platform:env", 236 "@com_google_absl//absl/memory", 237 "@com_google_absl//absl/time", 238 ], 239) 240 241cc_library( 242 name = "name_utils", 243 srcs = ["name_utils.cc"], 244 hdrs = ["name_utils.h"], 245 visibility = ["//visibility:public"], 246 deps = [ 247 "//tensorflow/core:lib", 248 "@com_google_absl//absl/strings", 249 ], 250) 251 252tf_cc_test( 253 name = "name_utils_test", 254 size = "small", 255 srcs = ["name_utils_test.cc"], 256 deps = [ 257 ":name_utils", 258 "//tensorflow/core:framework", 259 "//tensorflow/core:test", 260 "//tensorflow/core:test_main", 261 ], 262) 263 264cc_library( 265 name = "rewrite_utils", 266 srcs = ["rewrite_utils.cc"], 267 hdrs = ["rewrite_utils.h"], 268 deps = [ 269 ":dataset_utils", 270 ":hash_utils", 271 ":serialization_utils", 272 "//tensorflow/core:core_cpu_internal", 273 "//tensorflow/core:framework", 274 "//tensorflow/core:lib", 275 "//tensorflow/core:lib_internal", 276 "//tensorflow/core:protos_all_cc", 277 "//tensorflow/core/grappler:graph_view", 278 "//tensorflow/core/grappler:grappler_item", 279 "//tensorflow/core/grappler:grappler_item_builder", 280 "//tensorflow/core/grappler/clusters:virtual_cluster", 281 "//tensorflow/core/grappler/optimizers:custom_graph_optimizer_registry", 282 "//tensorflow/core/grappler/optimizers:meta_optimizer", 283 "//tensorflow/core/grappler/optimizers/data", 284 "//tensorflow/core/grappler/optimizers/data:function_utils", 285 "//tensorflow/core/grappler/optimizers/data:graph_utils", 286 "//tensorflow/core/platform", 287 "@com_google_absl//absl/container:flat_hash_set", 288 "@com_google_absl//absl/strings", 289 ], 290) 291 292tf_cc_test( 293 name = "rewrite_utils_test", 294 size = "small", 295 srcs = ["rewrite_utils_test.cc"], 296 deps = [ 297 ":rewrite_utils", 298 "//tensorflow/core:framework", 299 "//tensorflow/core:lib", 300 "//tensorflow/core:protos_all_cc", 301 "//tensorflow/core:test", 302 "//tensorflow/core:test_main", 303 "//tensorflow/core/framework:function_proto_cc", 304 "//tensorflow/core/framework:function_testlib", 305 "//tensorflow/core/framework:graph_proto_cc", 306 "//tensorflow/core/framework:tensor_testutil", 307 "//tensorflow/core/framework:types_proto_cc", 308 "//tensorflow/core/grappler:grappler_item", 309 "//tensorflow/core/ops", 310 "@com_google_absl//absl/strings", 311 ], 312) 313 314cc_library( 315 name = "root_dataset", 316 srcs = ["root_dataset.cc"], 317 hdrs = ["root_dataset.h"], 318 deps = [ 319 ":dataset_utils", 320 ":name_utils", 321 ":rewrite_utils", 322 "//tensorflow/core:framework", 323 "//tensorflow/core:framework_internal", 324 "//tensorflow/core:lib_internal", 325 "//tensorflow/core:protos_all_cc", 326 "//tensorflow/core/platform:errors", 327 "//tensorflow/core/platform:stringprintf", 328 ], 329) 330 331cc_library( 332 name = "serialization_utils", 333 srcs = ["serialization_utils.cc"], 334 hdrs = ["serialization_utils.h"], 335 deps = [ 336 ":dataset_utils", 337 "//tensorflow/core:core_cpu_base", 338 "//tensorflow/core:framework", 339 "//tensorflow/core:graph", 340 "//tensorflow/core/lib/core:status", 341 ], 342) 343 344tf_cc_test( 345 name = "serialization_utils_test", 346 size = "small", 347 srcs = ["serialization_utils_test.cc"], 348 deps = [ 349 ":dataset_test_base", 350 ":dataset_utils", 351 ":serialization_utils", 352 "//tensorflow/cc:cc_ops", 353 "//tensorflow/core:framework", 354 "//tensorflow/core:protos_all_cc", 355 "//tensorflow/core:session_options", 356 "//tensorflow/core:test", 357 "//tensorflow/core:test_main", 358 "//tensorflow/core/common_runtime:device_factory", 359 "//tensorflow/core/platform:errors", 360 "//tensorflow/core/platform:str_util", 361 "@com_google_absl//absl/container:flat_hash_set", 362 ], 363) 364 365cc_library( 366 name = "split_utils", 367 srcs = ["split_utils.cc"], 368 hdrs = ["split_utils.h"], 369 deps = [ 370 "//tensorflow/core:framework", 371 "//tensorflow/core:lib", 372 ], 373) 374 375tf_cc_test( 376 name = "split_utils_test", 377 size = "small", 378 srcs = ["split_utils_test.cc"], 379 deps = [ 380 ":dataset_test_base", 381 ":serialization_utils", 382 ":split_utils", 383 "//tensorflow/core:framework", 384 "//tensorflow/core:test", 385 "//tensorflow/core:test_main", 386 "//tensorflow/core/data:dataset_utils", 387 "//tensorflow/core/framework:tensor_testutil", 388 ], 389) 390 391cc_library( 392 name = "snapshot_utils", 393 srcs = ["snapshot_utils.cc"], 394 hdrs = ["snapshot_utils.h"], 395 deps = [ 396 "//tensorflow/core:core_cpu_lib", 397 "//tensorflow/core:dataset_ops_op_lib", 398 "//tensorflow/core:framework", 399 "//tensorflow/core:lib", 400 "//tensorflow/core:lib_internal", 401 "//tensorflow/core:protos_all_cc", 402 "//tensorflow/core/data:name_utils", 403 "//tensorflow/core/platform:coding", 404 "//tensorflow/core/platform:random", 405 "//tensorflow/core/profiler/lib:traceme", 406 "@com_google_absl//absl/memory", 407 ], 408) 409 410tf_cc_test( 411 name = "snapshot_utils_test", 412 size = "small", 413 srcs = ["snapshot_utils_test.cc"], 414 deps = [ 415 ":snapshot_utils", 416 "//tensorflow/core:lib", 417 "//tensorflow/core:protos_all_cc", 418 "//tensorflow/core:test", 419 "//tensorflow/core:test_main", 420 ], 421) 422 423cc_library( 424 name = "standalone", 425 srcs = ["standalone.cc"], 426 hdrs = ["standalone.h"], 427 deps = [ 428 ":root_dataset", 429 ":unbounded_thread_pool", 430 "//tensorflow/core:all_kernels", 431 "//tensorflow/core:core_cpu_internal", 432 "//tensorflow/core:framework", 433 "//tensorflow/core:lib", 434 "//tensorflow/core:session_options", 435 "//tensorflow/core/platform:refcount", 436 "@com_google_absl//absl/memory", 437 ], 438) 439 440tf_cc_test( 441 name = "standalone_test", 442 srcs = ["standalone_test.cc"], 443 deps = [ 444 ":standalone", 445 "//tensorflow/core:test", 446 "//tensorflow/core:test_main", 447 ] + tf_protos_all(), 448) 449 450cc_library( 451 name = "stats_utils", 452 srcs = ["stats_utils.cc"], 453 hdrs = ["stats_utils.h"], 454 deps = [ 455 "//tensorflow/core:lib", 456 "@com_google_absl//absl/base:core_headers", 457 ], 458) 459 460cc_library( 461 name = "unbounded_thread_pool", 462 srcs = ["unbounded_thread_pool.cc"], 463 hdrs = ["unbounded_thread_pool.h"], 464 deps = [ 465 "//tensorflow/core:core_cpu_internal", 466 "//tensorflow/core:framework", 467 "//tensorflow/core:lib", 468 "//tensorflow/core:lib_internal", 469 "@com_google_absl//absl/memory", 470 ], 471) 472 473cc_library( 474 name = "finalization_utils", 475 srcs = ["finalization_utils.cc"], 476 hdrs = ["finalization_utils.h"], 477 deps = [ 478 ":root_dataset", 479 "//tensorflow/core:framework", 480 "//tensorflow/core/platform:errors", 481 "//tensorflow/core/platform:refcount", 482 ], 483) 484 485tf_cc_test( 486 name = "unbounded_thread_pool_test", 487 size = "small", 488 srcs = ["unbounded_thread_pool_test.cc"], 489 deps = [ 490 ":unbounded_thread_pool", 491 "//tensorflow/core:lib_internal", 492 "//tensorflow/core:test", 493 "//tensorflow/core:test_main", 494 ], 495) 496 497cc_library( 498 name = "utils", 499 srcs = ["utils.cc"], 500 hdrs = ["utils.h"], 501 deps = [ 502 "//tensorflow/core:framework", 503 ], 504) 505