Skip to content

Commit a677f00

Browse files
gonnetcopybara-github
authored andcommitted
Move all header files in mobile_srcs_(no|only)_runtime filegroups into new mobile_hdrs_(no|only)_runtime groups and make the portable_tensorflow_lib.* targets export these headers.
This fixes several issues with strict header requirements. PiperOrigin-RevId: 919223730
1 parent 0454fcb commit a677f00

2 files changed

Lines changed: 58 additions & 24 deletions

File tree

tsl/platform/BUILD

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ load(
1515
"tf_cuda_root_path_deps",
1616
"tf_error_logging_deps",
1717
"tf_fingerprint_deps",
18+
"tf_google_mobile_hdrs_no_runtime",
1819
"tf_google_mobile_srcs_no_runtime",
1920
"tf_platform_deps",
2021
"tf_stream_executor_deps",
@@ -357,6 +358,7 @@ filegroup(
357358
"random.h",
358359
"stacktrace.h",
359360
"stacktrace_handler.h",
361+
"status.h",
360362
"statusor.h",
361363
"str_util.h",
362364
"stringpiece.h",
@@ -404,55 +406,69 @@ filegroup(
404406
name = "mobile_srcs_no_runtime",
405407
srcs = [
406408
"abi.cc",
407-
"abi.h",
408409
"base64.cc",
410+
"coding.cc",
411+
"cpu_info.cc",
412+
"denormal.cc",
413+
"hash.cc",
414+
"numbers.cc",
415+
"path.cc",
416+
"protobuf.cc",
417+
"protobuf_util.cc",
418+
"scanner.cc",
419+
"setround.cc",
420+
"str_util.cc",
421+
"@xla//xla/tsl/platform:mobile_srcs_no_runtime",
422+
] + select({
423+
"@xla//xla/tsl:fuchsia": tf_google_mobile_srcs_no_runtime(),
424+
"//conditions:default": [
425+
"tracing.cc",
426+
"@xla//xla/tsl/platform/default:mobile_srcs_no_runtime",
427+
],
428+
}),
429+
compatible_with = get_compatible_with_portable(),
430+
)
431+
432+
filegroup(
433+
name = "mobile_hdrs_no_runtime",
434+
srcs = [
435+
"abi.h",
409436
"base64.h",
410437
"bfloat16.h",
411438
"blocking_counter.h",
412439
"casts.h",
413-
"coding.cc",
414440
"coding.h",
415441
"context.h",
416-
"cpu_info.cc",
417442
"cpu_info.h",
418443
"demangle.h",
419-
"denormal.cc",
420444
"denormal.h",
421445
"env.h",
422446
"env_time.h",
423447
"errors.h",
424448
"file_statistics.h",
425449
"file_system.h",
426450
"file_system_helper.h",
427-
"hash.cc",
428451
"hash.h",
429452
"host_info.h",
430453
"init_main.h",
431454
"load_library.h",
432455
"macros.h",
433456
"mem.h",
434457
"numa.h",
435-
"numbers.cc",
436458
"numbers.h",
437-
"path.cc",
438459
"path.h",
439460
"platform.h",
440461
"platform_strings_computed.h",
441-
"protobuf.cc",
442462
"protobuf.h",
443-
"protobuf_util.cc",
444463
"raw_coding.h",
445464
"refcount.h",
446465
"regexp.h",
447-
"scanner.cc",
448466
"scanner.h",
449-
"setround.cc",
450467
"setround.h",
451468
"snappy.h",
452469
"stacktrace.h",
453470
"status.h",
454471
"statusor.h",
455-
"str_util.cc",
456472
"str_util.h",
457473
"strcat.h",
458474
"stringpiece.h",
@@ -461,32 +477,42 @@ filegroup(
461477
"threadpool.h",
462478
"threadpool_interface.h",
463479
"tracing.h",
464-
"@xla//xla/tsl/platform:mobile_srcs_no_runtime",
480+
"@xla//xla/tsl/platform:mobile_hdrs_no_runtime",
465481
] + select({
466-
"@xla//xla/tsl:fuchsia": tf_google_mobile_srcs_no_runtime(),
482+
"@xla//xla/tsl:fuchsia": tf_google_mobile_hdrs_no_runtime(),
467483
"//conditions:default": [
468-
"tracing.cc",
469-
"@xla//xla/tsl/platform/default:mobile_srcs_no_runtime",
484+
"@xla//xla/tsl/platform/default:mobile_hdrs_no_runtime",
470485
],
471486
}),
472487
compatible_with = get_compatible_with_portable(),
473488
)
474489

475490
filegroup(
476491
name = "mobile_srcs_only_runtime",
492+
srcs = [
493+
"random.cc",
494+
"@xla//xla/tsl/platform/profile_utils:android_armv7a_cpu_utils_helper.cc",
495+
"@xla//xla/tsl/platform/profile_utils:cpu_utils.cc",
496+
],
497+
compatible_with = get_compatible_with_portable(),
498+
visibility = internal_visibility([
499+
"//tensorflow/core:__pkg__",
500+
"//tensorflow/core/platform:__pkg__",
501+
]),
502+
)
503+
504+
filegroup(
505+
name = "mobile_hdrs_only_runtime",
477506
srcs = [
478507
"error_logging.h",
479508
"fingerprint.h",
480509
"notification.h",
481-
"random.cc",
482510
"random.h",
483511
"test_benchmark.h",
484512
"threadpool_options.h",
485513
"unbounded_work_queue.h",
486-
"@xla//xla/tsl/platform:mobile_srcs_only_runtime",
487-
"@xla//xla/tsl/platform/profile_utils:android_armv7a_cpu_utils_helper.cc",
514+
"@xla//xla/tsl/platform:mobile_hdrs_only_runtime",
488515
"@xla//xla/tsl/platform/profile_utils:android_armv7a_cpu_utils_helper.h",
489-
"@xla//xla/tsl/platform/profile_utils:cpu_utils.cc",
490516
"@xla//xla/tsl/platform/profile_utils:cpu_utils.h",
491517
"@xla//xla/tsl/platform/profile_utils:i_cpu_utils_helper.h",
492518
],

tsl/profiler/lib/BUILD

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,29 @@ cc_library(
3131
filegroup(
3232
name = "mobile_srcs_no_runtime",
3333
srcs = [
34-
"nvtx_utils.h",
3534
"nvtx_utils_stub.cc", #Include the stub implementation here since CUDA isn't relevant to Android.
36-
"scoped_annotation.h",
3735
"scoped_memory_debug_annotation.cc",
36+
],
37+
compatible_with = get_compatible_with_portable(),
38+
visibility = ["//visibility:public"],
39+
)
40+
41+
filegroup(
42+
name = "mobile_hdrs_no_runtime",
43+
srcs = [
44+
"nvtx_utils.h",
45+
"scoped_annotation.h",
3846
"scoped_memory_debug_annotation.h",
3947
"traceme.h",
4048
"traceme_encode.h",
41-
"@xla//xla/tsl/profiler/utils:mobile_srcs_no_runtime",
49+
"@xla//xla/tsl/profiler/utils:mobile_hdrs_no_runtime",
4250
],
4351
compatible_with = get_compatible_with_portable(),
4452
visibility = ["//visibility:public"],
4553
)
4654

4755
filegroup(
48-
name = "mobile_srcs_only_runtime",
56+
name = "mobile_hdrs_only_runtime",
4957
srcs = [
5058
"connected_traceme.h",
5159
"context_types.h",

0 commit comments

Comments
 (0)