Skip to content

Commit

Permalink
build: patch the xi_tflmlib_vision_p6 download to use <climits>
Browse files Browse the repository at this point in the history
Patch the Xtensa vision_p6 platform download xi_tflmlib_vision_p6 for
compatibility with the C++ library standard. Use the header <climits> to
access constants such as INT_MAX.
  • Loading branch information
rkuester committed Aug 1, 2024
1 parent 33271fa commit 27f9bc6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From ed92529a6be7a910462558edcf10070fbb0f2870 Mon Sep 17 00:00:00 2001
From: Ryan Kuester <kuester@bdti.com>
Date: Thu, 1 Aug 2024 12:48:12 -0500
Subject: [PATCH] fix: use <climits> instead of <limits> to access INT_MAX and
friends

For compatibility with the C++ library standard, use the header,
<climits>, to access constants such as INT_MAX.
---
runtime/include/cnnrt_xi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/include/cnnrt_xi.h b/runtime/include/cnnrt_xi.h
index f3a911e..00c74b8 100644
--- a/runtime/include/cnnrt_xi.h
+++ b/runtime/include/cnnrt_xi.h
@@ -25,7 +25,7 @@
# define INCLUDE_XI_CNN
#endif

-#include <limits>
+#include <climits>
#include "xi_api.h"
#include "xi_cnn_api.h"
#include "xi_tile_manager.h"
--
2.43.0

Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ elif [[ ${2} == "vision_p6" ]]; then
LIBRARY_URL="https://github.com/foss-xtensa/tflmlib_vision/raw/main/archive/xi_tflmlib_vision_p6_22_06_29.zip"
LIBRARY_DIRNAME="xi_tflmlib_vision_p6"
LIBRARY_MD5="fea3720d76fdb3a5a337ace7b6081b56"
PATCH="../../ext_libs/xi_tflmlib_vision_p6.patch"
else
echo "Attempting to download an unsupported xtensa variant: ${2}"
exit 1
Expand Down

0 comments on commit 27f9bc6

Please sign in to comment.