Skip to content

Commit

Permalink
build(bazel): replace cc_* with tflm_cc_* in remaining TFLM code
Browse files Browse the repository at this point in the history
Replace cc_* targets remaining in TFLM code with tflm_cc_* targets.
These are targets which did not formerly use the common copts. Avoid
changing imported TFLite code, if for no other reason than to avoid
merge conflicts during the automatic sync with upstream TFLite.
  • Loading branch information
rkuester committed Oct 17, 2024
1 parent a6368f4 commit a52f97f
Show file tree
Hide file tree
Showing 13 changed files with 177 additions and 137 deletions.
36 changes: 18 additions & 18 deletions tensorflow/lite/micro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ tflm_cc_library(
],
)

cc_test(
tflm_cc_test(
name = "micro_log_test",
srcs = [
"micro_log_test.cc",
Expand All @@ -433,7 +433,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "micro_mutable_op_resolver_test",
srcs = [
"micro_mutable_op_resolver_test.cc",
Expand All @@ -445,7 +445,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "micro_interpreter_context_test",
srcs = [
"micro_interpreter_context_test.cc",
Expand All @@ -459,7 +459,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "fake_micro_context_test",
srcs = [
"fake_micro_context_test.cc",
Expand All @@ -473,7 +473,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "micro_interpreter_test",
srcs = [
"micro_interpreter_test.cc",
Expand All @@ -490,7 +490,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "micro_allocator_test",
srcs = [
"micro_allocator_test.cc",
Expand All @@ -508,7 +508,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "micro_allocation_info_test",
srcs = [
"micro_allocation_info_test.cc",
Expand All @@ -520,7 +520,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "recording_micro_allocator_test",
srcs = [
"recording_micro_allocator_test.cc",
Expand All @@ -535,7 +535,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "flatbuffer_utils_test",
srcs = [
"flatbuffer_utils_test.cc",
Expand All @@ -550,7 +550,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "hexdump_test",
size = "small",
srcs = [
Expand All @@ -562,7 +562,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "memory_helpers_test",
srcs = [
"memory_helpers_test.cc",
Expand All @@ -574,7 +574,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "span_test",
size = "small",
srcs = [
Expand All @@ -586,7 +586,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "testing_helpers_test",
srcs = [
"testing_helpers_test.cc",
Expand All @@ -598,7 +598,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "micro_utils_test",
srcs = [
"micro_utils_test.cc",
Expand All @@ -609,7 +609,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "micro_time_test",
srcs = [
"micro_time_test.cc",
Expand All @@ -620,7 +620,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "micro_resource_variable_test",
srcs = ["micro_resource_variable_test.cc"],
deps = [
Expand All @@ -629,7 +629,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "memory_arena_threshold_test",
srcs = [
"memory_arena_threshold_test.cc",
Expand All @@ -643,7 +643,7 @@ cc_test(
],
)

cc_test(
tflm_cc_test(
name = "static_vector_test",
size = "small",
srcs = [
Expand Down
9 changes: 5 additions & 4 deletions tensorflow/lite/micro/arena_allocator/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_cc_test",
)

package(
Expand Down Expand Up @@ -33,7 +34,7 @@ tflm_cc_library(
],
)

cc_test(
tflm_cc_test(
name = "non_persistent_arena_buffer_allocator_test",
srcs = ["non_persistent_arena_buffer_allocator_test.cc"],
deps = [
Expand All @@ -57,7 +58,7 @@ tflm_cc_library(
],
)

cc_test(
tflm_cc_test(
name = "persistent_arena_buffer_allocator_test",
srcs = ["persistent_arena_buffer_allocator_test.cc"],
deps = [
Expand Down Expand Up @@ -85,7 +86,7 @@ tflm_cc_library(
],
)

cc_test(
tflm_cc_test(
name = "simple_memory_allocator_test",
srcs = [
"single_arena_buffer_allocator_test.cc",
Expand Down Expand Up @@ -113,7 +114,7 @@ tflm_cc_library(
],
)

cc_test(
tflm_cc_test(
name = "recording_simple_memory_allocator_test",
srcs = [
"recording_single_arena_buffer_allocator_test.cc",
Expand Down
18 changes: 12 additions & 6 deletions tensorflow/lite/micro/benchmarks/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Description:
# TensorFlow Lite microcontroller benchmarks.

load("//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_binary",
"tflm_cc_library",
)

package(
# Disabling layering_check because of http://b/177257332
features = ["-layering_check"],
Expand All @@ -11,7 +17,7 @@ package_group(
packages = ["//tensorflow/lite/micro"],
)

cc_library(
tflm_cc_library(
name = "micro_benchmark",
hdrs = [
"micro_benchmark.h",
Expand All @@ -29,7 +35,7 @@ cc_library(
],
)

cc_library(
tflm_cc_library(
name = "keyword_scrambled_model_data",
srcs = [
"//tensorflow/lite/micro/models:generated_keyword_scrambled_model_cc",
Expand All @@ -42,7 +48,7 @@ cc_library(
],
)

cc_binary(
tflm_cc_binary(
name = "keyword_benchmark",
srcs = ["keyword_benchmark.cc"],
deps = [
Expand All @@ -57,7 +63,7 @@ cc_binary(
],
)

cc_library(
tflm_cc_library(
name = "keyword_scrambled_8bit_model_data",
srcs = [
"//tensorflow/lite/micro/models:generated_keyword_scrambled_8bit_model_cc",
Expand All @@ -68,7 +74,7 @@ cc_library(
visibility = ["//visibility:private"],
)

cc_binary(
tflm_cc_binary(
name = "keyword_benchmark_8bit",
srcs = ["keyword_benchmark_8bit.cc"],
deps = [
Expand All @@ -82,7 +88,7 @@ cc_binary(
],
)

cc_binary(
tflm_cc_binary(
name = "person_detection_benchmark",
srcs = ["person_detection_benchmark.cc"],
deps = [
Expand Down
8 changes: 6 additions & 2 deletions tensorflow/lite/micro/compression/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
load("//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_cc_test",
)
load(
"@flatbuffers//:build_defs.bzl",
"flatbuffer_cc_library",
Expand All @@ -19,7 +23,7 @@ flatbuffer_cc_library(
srcs = ["metadata.fbs"],
)

cc_library(
tflm_cc_library(
# The header-only library generated by flatc in ":metadata_cc" is saved to
# the source tree and comitted to git as "metadata_saved.h", which is used
# by code which builds via the Make build system, which has no means of
Expand Down Expand Up @@ -50,7 +54,7 @@ flatbuffer_py_library(
srcs = ["metadata.fbs"],
)

cc_test(
tflm_cc_test(
name = "metadata_test_cc",
size = "small",
srcs = ["metadata_test.cc"],
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/examples/hello_world/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ load("@tflm_pip_deps//:requirements.bzl", "requirement")
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_cc_test",
)

package(
Expand All @@ -25,7 +26,7 @@ tflm_cc_library(
],
)

cc_test(
tflm_cc_test(
name = "hello_world_test",
srcs = [
"hello_world_test.cc",
Expand Down
18 changes: 11 additions & 7 deletions tensorflow/lite/micro/examples/micro_speech/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# TensorFlow Lite microcontroller example.
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load("@tflm_pip_deps//:requirements.bzl", "requirement")
load("//tensorflow/lite/micro:build_def.bzl", "generate_cc_arrays")
load("//tensorflow/lite/micro:build_def.bzl",
"generate_cc_arrays",
"tflm_cc_library",
"tflm_cc_test",
)

package(
default_visibility = ["//visibility:public"],
Expand Down Expand Up @@ -107,7 +111,7 @@ generate_cc_arrays(
out = "models/audio_preprocessor_int8_model_data.h",
)

cc_library(
tflm_cc_library(
name = "micro_speech_model_data",
srcs = [
":generated_micro_speech_model_cc",
Expand All @@ -117,7 +121,7 @@ cc_library(
],
)

cc_library(
tflm_cc_library(
name = "audio_preprocessor_model_data",
srcs = [
":generated_audio_preprocessor_model_cc",
Expand All @@ -127,7 +131,7 @@ cc_library(
],
)

cc_library(
tflm_cc_library(
name = "audio_sample_test_data_30ms",
srcs = [
":generated_no_30ms_wav_cc",
Expand All @@ -139,7 +143,7 @@ cc_library(
],
)

cc_library(
tflm_cc_library(
name = "audio_sample_test_data_1000ms",
srcs = [
":generated_no_1000ms_wav_cc",
Expand All @@ -155,14 +159,14 @@ cc_library(
],
)

cc_library(
tflm_cc_library(
name = "micro_model_settings",
hdrs = [
"micro_model_settings.h",
],
)

cc_test(
tflm_cc_test(
name = "micro_speech_test",
srcs = [
"micro_speech_test.cc",
Expand Down
Loading

0 comments on commit a52f97f

Please sign in to comment.