Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions tensorflow/lite/micro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,6 @@ tflm_cc_library(
hdrs = ["span.h"],
)

tflm_cc_library(
name = "static_vector",
hdrs = ["static_vector.h"],
deps = [
"//tensorflow/lite/kernels:op_macros",
],
)

tflm_cc_library(
name = "system_setup",
srcs = [
Expand Down
14 changes: 7 additions & 7 deletions tensorflow/lite/micro/hexdump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <cctype>

#include "tensorflow/lite/micro/debug_log.h"
#include "tensorflow/lite/micro/static_vector.h"

namespace {

Expand Down Expand Up @@ -52,15 +51,16 @@ tflite::Span<char> output(const tflite::Span<char>& buf, const char* format,

} // end anonymous namespace

tflite::Span<char> tflite::hexdump(const tflite::Span<const std::byte> region,
tflite::Span<char> tflite::hexdump(const tflite::Span<const unsigned char> region,
const tflite::Span<char> out) {
tflite::Span<char> buffer{out};
std::size_t byte_nr = 0;
constexpr int per_line = 16;
const int lines = (region.size() + per_line - 1) / per_line; // round up

for (int line = 0; line < lines; ++line) {
tflite::StaticVector<char, per_line> ascii;
char ascii[per_line];
int ascii_nr = 0;

// print address
buffer = output(buffer, "%08X:", line);
Expand All @@ -76,7 +76,7 @@ tflite::Span<char> tflite::hexdump(const tflite::Span<const std::byte> region,
if (std::isprint(as_int)) {
c = static_cast<char>(as_int);
}
ascii.push_back(c);
ascii[ascii_nr++] = c;
} else {
buffer = output(buffer, " ");
}
Expand All @@ -89,15 +89,15 @@ tflite::Span<char> tflite::hexdump(const tflite::Span<const std::byte> region,

// print the ascii value
buffer = output(buffer, " ");
for (const auto& c : ascii) {
buffer = output(buffer, "%c", c);
for (int ascii_index = 0; ascii_index < ascii_nr; ascii_index++) {
buffer = output(buffer, "%c", ascii[ascii_index]);
}
buffer = output(buffer, "%c", '\n');
}

return {out.data(), out.size() - buffer.size()};
}

void tflite::hexdump(const tflite::Span<const std::byte> region) {
void tflite::hexdump(const tflite::Span<const unsigned char> region) {
hexdump(region, {nullptr, 0});
}
4 changes: 2 additions & 2 deletions tensorflow/lite/micro/hexdump.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ namespace tflite {

// Displays the contents of a memory region, formatted in hexadecimal and ASCII
// in a style matching Python's hexdump module, using DebugLog().
void hexdump(Span<const std::byte> region);
void hexdump(Span<const unsigned char> region);

// Writes the contents of a memory region, formatted in hexadecimal and ASCII
// in a style matching Python's hexdump module, to a buffer. Returns the portion
// of the buffer written.
Span<char> hexdump(Span<const std::byte> region, Span<char> buffer);
Span<char> hexdump(Span<const unsigned char> region, Span<char> buffer);

} // end namespace tflite

Expand Down
83 changes: 0 additions & 83 deletions tensorflow/lite/micro/static_vector.h

This file was deleted.

82 changes: 0 additions & 82 deletions tensorflow/lite/micro/static_vector_test.cc

This file was deleted.

5 changes: 2 additions & 3 deletions tensorflow/lite/micro/tools/make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ ifeq ($(TARGET), $(HOST_OS))
endif

CXXFLAGS := \
-std=c++17 \
-std=c++11 \
-fno-rtti \
-fno-exceptions \
-fno-threadsafe-statics \
Expand All @@ -192,7 +192,7 @@ CXXFLAGS := \

CCFLAGS := \
-Wimplicit-function-declaration \
-std=c17 \
-std=c11 \
$(COMMON_FLAGS)

ARFLAGS := -r
Expand Down Expand Up @@ -346,7 +346,6 @@ $(TENSORFLOW_ROOT)tensorflow/lite/micro/micro_time_test.cc \
$(TENSORFLOW_ROOT)tensorflow/lite/micro/micro_utils_test.cc \
$(TENSORFLOW_ROOT)tensorflow/lite/micro/recording_micro_allocator_test.cc \
$(TENSORFLOW_ROOT)tensorflow/lite/micro/span_test.cc \
$(TENSORFLOW_ROOT)tensorflow/lite/micro/static_vector_test.cc \
$(TENSORFLOW_ROOT)tensorflow/lite/micro/arena_allocator/non_persistent_arena_buffer_allocator_test.cc \
$(TENSORFLOW_ROOT)tensorflow/lite/micro/arena_allocator/persistent_arena_buffer_allocator_test.cc \
$(TENSORFLOW_ROOT)tensorflow/lite/micro/arena_allocator/recording_single_arena_buffer_allocator_test.cc \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ endif
TARGET_ARCH_DEFINES := -D$(shell echo $(TARGET_ARCH) | tr [a-z] [A-Z])

PLATFORM_FLAGS = \
-stdlib=libc++ \
-DTF_LITE_MCU_DEBUG_LOG \
-DTF_LITE_USE_CTIME \
--xtensa-core=$(XTENSA_CORE) \
Expand Down
Loading