Skip to content

Commit 6229afa

Browse files
Upgrade apps/hannk to TFLite 2.6 (halide#6197)
* Upgrade apps/hannk to TFLite 2.6 * Remove scalpel left in patient
1 parent 69075b4 commit 6229afa

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

apps/hannk/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ find_package(Halide REQUIRED)
2020

2121
# Set up the version of TFLite we expect
2222
set(TFLITE_VERSION_MAJOR "2" CACHE STRING "Major version of TFLite to assume")
23-
set(TFLITE_VERSION_MINOR "5" CACHE STRING "Minor version of TFLite to assume")
23+
set(TFLITE_VERSION_MINOR "6" CACHE STRING "Minor version of TFLite to assume")
2424
set(TFLITE_VERSION_PATCH "0" CACHE STRING "Patch version of TFLite to assume")
2525

26+
add_compile_definitions(TFLITE_VERSION_MAJOR=${TFLITE_VERSION_MAJOR})
27+
add_compile_definitions(TFLITE_VERSION_MINOR=${TFLITE_VERSION_MINOR})
28+
add_compile_definitions(TFLITE_VERSION_PATCH=${TFLITE_VERSION_PATCH})
29+
2630
set(TFLITE_VERSION "${TFLITE_VERSION_MAJOR}.${TFLITE_VERSION_MINOR}.${TFLITE_VERSION_PATCH}")
2731

2832
add_subdirectory(delegate)

apps/hannk/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ clean:
5656
# ---------------------- TFLite glue
5757

5858
TFLITE_VERSION_MAJOR ?= 2
59-
TFLITE_VERSION_MINOR ?= 5
59+
TFLITE_VERSION_MINOR ?= 6
6060
TFLITE_VERSION_PATCH ?= 0
6161

6262
TFLITE_VERSION = $(TFLITE_VERSION_MAJOR).$(TFLITE_VERSION_MINOR).$(TFLITE_VERSION_PATCH)

apps/hannk/configure_cmake.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mkdir -p "${BUILD_DIR}"
99
cd "${BUILD_DIR}"
1010

1111
if [ -z ${HALIDE_INSTALL_PATH} ]; then
12-
HALIDE_INSTALL_PATH=${HOME}/halide-13-install/
12+
HALIDE_INSTALL_PATH=${HOME}/halide-14-install/
1313
fi
1414
echo Using HalideInstall=${HALIDE_INSTALL_PATH}
1515

apps/hannk/delegate/hannk_delegate_provider.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ class HannkDelegateProvider : public DelegateProvider {
3939
}
4040
}
4141

42+
#if (TFLITE_VERSION_MAJOR >= 3) || (TFLITE_VERSION_MAJOR >= 2 && TFLITE_VERSION_MINOR >= 6)
43+
std::pair<TfLiteDelegatePtr, int> CreateRankedTfLiteDelegate(const ToolParams &params) const final {
44+
auto ptr = CreateTfLiteDelegate(params);
45+
return std::make_pair(std::move(ptr), params.GetPosition<bool>("use_hannk"));
46+
}
47+
#endif
48+
4249
std::string GetName() const final {
4350
return "HANNK";
4451
}

0 commit comments

Comments
 (0)