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.

BUG=tensorflow#2636
  • Loading branch information
rkuester committed Nov 14, 2024
1 parent 525ed4c commit e9b7433
Show file tree
Hide file tree
Showing 12 changed files with 176 additions and 134 deletions.
34 changes: 17 additions & 17 deletions tensorflow/lite/micro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ tflm_cc_library(
],
)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

cc_test(
tflm_cc_test(
name = "memory_arena_threshold_test",
srcs = [
"memory_arena_threshold_test.cc",
Expand All @@ -615,7 +615,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,6 +1,7 @@
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_cc_test",
)

package(
Expand Down Expand Up @@ -34,7 +35,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 @@ -58,7 +59,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 @@ -86,7 +87,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 @@ -114,7 +115,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
19 changes: 13 additions & 6 deletions tensorflow/lite/micro/benchmarks/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# 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 +18,7 @@ package_group(
packages = ["//tensorflow/lite/micro"],
)

cc_library(
tflm_cc_library(
name = "micro_benchmark",
hdrs = [
"micro_benchmark.h",
Expand All @@ -29,7 +36,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 +49,7 @@ cc_library(
],
)

cc_binary(
tflm_cc_binary(
name = "keyword_benchmark",
srcs = ["keyword_benchmark.cc"],
deps = [
Expand All @@ -57,7 +64,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 +75,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 +89,7 @@ cc_binary(
],
)

cc_binary(
tflm_cc_binary(
name = "person_detection_benchmark",
srcs = ["person_detection_benchmark.cc"],
deps = [
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
19 changes: 12 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,12 @@
# 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 +112,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 +122,7 @@ cc_library(
],
)

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

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

cc_library(
tflm_cc_library(
name = "audio_sample_test_data_1000ms",
srcs = [
":generated_no_1000ms_wav_cc",
Expand All @@ -155,14 +160,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 e9b7433

Please sign in to comment.