Skip to content

Commit

Permalink
Enable static memory flag for bazel builds (tensorflow#2987)
Browse files Browse the repository at this point in the history
Re enabling static memory for bazel builds, see tensorflow#2945.

BUG=static mem for bazel
  • Loading branch information
suleshahid authored Dec 6, 2024
1 parent a06ff26 commit 2f1f185
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tensorflow/lite/micro/build_def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def tflm_copts():
"""
return [
"-fno-asynchronous-unwind-tables",
"-fno-exceptions",
"-Wall",
"-Wno-unused-parameter",
"-Wnon-virtual-dtor",
Expand All @@ -31,14 +32,21 @@ def tflm_defines():
this function directly; however, it may be useful when additively
overriding the defaults for a particular target.
"""
return select({
defines = [
# Exclude dynamic memory use in shared TFLite code.
"TF_LITE_STATIC_MEMORY=1",
]

defines += select({
# Include code for the compression feature.
"//:with_compression_enabled": ["USE_TFLM_COMPRESSION=1"],

# By default, don't include code for the compression feature.
"//conditions:default": [],
})

return defines

def tflm_cc_binary(copts = tflm_copts(), defines = tflm_defines(), **kwargs):
native.cc_binary(
copts = copts,
Expand Down

0 comments on commit 2f1f185

Please sign in to comment.