Skip to content

Commit fac6210

Browse files
authored
Merge pull request #64 from cocoa-xu/cx-tensorflow-2.12.0
tensorflow 2.12.0
2 parents 6b2de61 + 012e4d5 commit fac6210

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if(UNIX AND APPLE)
3434
set(CMAKE_SHARED_LINKER_FLAGS "-flat_namespace -undefined suppress -undefined dynamic_lookup")
3535
endif()
3636

37-
set(CMAKE_CXX_STANDARD 14)
37+
set(CMAKE_CXX_STANDARD 17)
3838
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wno-comment")
3939
if(DEFINED ENV{TARGET_GCC_FLAGS})
4040
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_GCC_FLAGS}")

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ endif
2323
# Tensorflow
2424
TFLITE_USE_GIT_HEAD ?= false
2525
TFLITE_GIT_REPO ?= "https://github.com/tensorflow/tensorflow.git"
26-
TFLITE_VER ?= 2.11.1
26+
TFLITE_VER ?= 2.12.0
2727
TFLITE_VER_V = v$(TFLITE_VER)
2828
ifneq ($(TFLITE_USE_GIT_HEAD), false)
2929
TFLITE_VER_V=$(TFLITE_USE_GIT_BRANCH)

patches/apply_patch.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def patch_fix_RoundToNearest(tf_version: str, tf_src_root: str):
13-
if tf_version not in ['2.11.0', '2.11.1']:
13+
if tf_version not in ['2.11.0', '2.11.1', '2.12.0']:
1414
print(f"warning: skip applying `patch_fix_RoundToNearest` to tf version `{tf_version}`")
1515
return
1616

@@ -38,8 +38,31 @@ def patch_fix_RoundToNearest(tf_version: str, tf_src_root: str):
3838
dst.truncate(0)
3939
dst.write(fixed.getvalue())
4040

41-
patches = [patch_fix_RoundToNearest]
41+
def patch_compiling_telemetry_cc(tf_version: str, tf_src_root: str):
42+
if tf_version not in ['2.12.0']:
43+
print(f"warning: skip applying `patch_compiling_telemetry_cc` to tf version `{tf_version}`")
44+
return
45+
46+
cmakelists_txt = Path(tf_src_root) / 'CMakeLists.txt'
47+
fixed = StringIO()
48+
patched_1 = False
49+
with open(cmakelists_txt, 'r') as source:
50+
for line in source:
51+
line_strip = line.strip()
52+
if not patched_1 and line_strip == '${TFLITE_SOURCE_DIR}/profiling/telemetry/profiler.cc':
53+
fixed.write(f" {line_strip} # fixed\n")
54+
fixed.write(" ${TFLITE_SOURCE_DIR}/profiling/telemetry/telemetry.cc\n")
55+
patched_1 = True
56+
else:
57+
fixed.write(line)
58+
59+
if patched_1:
60+
with open(cmakelists_txt, 'w') as dst:
61+
dst.truncate(0)
62+
dst.write(fixed.getvalue())
63+
4264

65+
patches = [patch_fix_RoundToNearest, patch_compiling_telemetry_cc]
4366

4467
if __name__ == '__main__':
4568
tf_version = None

0 commit comments

Comments
 (0)