Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
码匠许师傅
Tflite Micro
提交
f03c3765
T
Tflite Micro
项目概览
码匠许师傅
/
Tflite Micro
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tflite Micro
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f03c3765
编写于
5月 25, 2021
作者:
T
TFLM-bot
提交者:
GitHub
5月 25, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sync from upstream TF. (#100)
上级
7af878a3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
76 addition
and
4 deletion
+76
-4
tensorflow/lite/micro/cortex_m_generic/micro_time.cc
tensorflow/lite/micro/cortex_m_generic/micro_time.cc
+67
-0
tensorflow/lite/micro/micro_interpreter_test.cc
tensorflow/lite/micro/micro_interpreter_test.cc
+2
-2
tensorflow/lite/micro/micro_profiler.h
tensorflow/lite/micro/micro_profiler.h
+2
-2
tensorflow/lite/micro/tools/ci_build/test_x86.sh
tensorflow/lite/micro/tools/ci_build/test_x86.sh
+5
-0
未找到文件。
tensorflow/lite/micro/cortex_m_generic/micro_time.cc
0 → 100644
浏览文件 @
f03c3765
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/lite/micro/micro_time.h"
// DWT (Data Watchpoint and Trace) registers, only exists on ARM Cortex with a
// DWT unit.
#define KIN1_DWT_CONTROL (*((volatile uint32_t*)0xE0001000))
/*!< DWT Control register */
// DWT Control register.
#define KIN1_DWT_CYCCNTENA_BIT (1UL << 0)
// CYCCNTENA bit in DWT_CONTROL register.
#define KIN1_DWT_CYCCNT (*((volatile uint32_t*)0xE0001004))
// DWT Cycle Counter register.
#define KIN1_DEMCR (*((volatile uint32_t*)0xE000EDFC))
// DEMCR: Debug Exception and Monitor Control Register.
#define KIN1_TRCENA_BIT (1UL << 24)
#define KIN1_LAR (*((volatile uint32_t*)0xE0001FB0))
#define KIN1_DWT_CONTROL (*((volatile uint32_t*)0xE0001000))
// Unlock access to DWT (ITM, etc.)registers.
#define KIN1_UnlockAccessToDWT() KIN1_LAR = 0xC5ACCE55;
// TRCENA: Enable trace and debug block DEMCR (Debug Exception and Monitor
// Control Register.
#define KIN1_InitCycleCounter() KIN1_DEMCR |= KIN1_TRCENA_BIT
#define KIN1_ResetCycleCounter() KIN1_DWT_CYCCNT = 0
#define KIN1_EnableCycleCounter() KIN1_DWT_CONTROL |= KIN1_DWT_CYCCNTENA_BIT
#define KIN1_DisableCycleCounter() KIN1_DWT_CONTROL &= ~KIN1_DWT_CYCCNTENA_BIT
#define KIN1_GetCycleCounter() KIN1_DWT_CYCCNT
namespace
tflite
{
int32_t
ticks_per_second
()
{
return
0
;
}
int32_t
GetCurrentTimeTicks
()
{
static
bool
is_initialized
=
false
;
if
(
!
is_initialized
)
{
KIN1_UnlockAccessToDWT
();
KIN1_InitCycleCounter
();
KIN1_ResetCycleCounter
();
KIN1_EnableCycleCounter
();
is_initialized
=
true
;
}
return
KIN1_GetCycleCounter
();
}
}
// namespace tflite
tensorflow/lite/micro/micro_interpreter_test.cc
浏览文件 @
f03c3765
...
...
@@ -287,10 +287,10 @@ TF_LITE_MICRO_TEST(InterpreterWithProfilerShouldProfileOps) {
TF_LITE_MICRO_EXPECT_EQ
(
profiler
.
event_ends
(),
0
);
TF_LITE_MICRO_EXPECT_EQ
(
interpreter
.
AllocateTensors
(),
kTfLiteOk
);
TF_LITE_MICRO_EXPECT_EQ
(
interpreter
.
Invoke
(),
kTfLiteOk
);
#ifndef
NDEBUG
#ifndef
TF_LITE_STRIP_ERROR_STRINGS
TF_LITE_MICRO_EXPECT_EQ
(
profiler
.
event_starts
(),
3
);
TF_LITE_MICRO_EXPECT_EQ
(
profiler
.
event_ends
(),
3
);
#else
// Profile events will not occur on release builds.
#else
TF_LITE_MICRO_EXPECT_EQ
(
profiler
.
event_starts
(),
0
);
TF_LITE_MICRO_EXPECT_EQ
(
profiler
.
event_ends
(),
0
);
#endif
...
...
tensorflow/lite/micro/micro_profiler.h
浏览文件 @
f03c3765
/* Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
/* Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
...
...
@@ -70,7 +70,7 @@ class MicroProfiler {
TF_LITE_REMOVE_VIRTUAL_DELETE
;
};
#if defined(
NDEBUG
)
#if defined(
TF_LITE_STRIP_ERROR_STRINGS
)
// For release builds, the ScopedMicroProfiler is a noop.
//
// This is done because the ScipedProfiler is used as part of the
...
...
tensorflow/lite/micro/tools/ci_build/test_x86.sh
浏览文件 @
f03c3765
...
...
@@ -40,6 +40,11 @@ readable_run make -j8 -f tensorflow/lite/micro/tools/make/Makefile BUILD_TYPE=no
readable_run make
-f
tensorflow/lite/micro/tools/make/Makefile clean
readable_run make
-j8
-f
tensorflow/lite/micro/tools/make/Makefile
BUILD_TYPE
=
release build
# Next, build wit release and logs so that we can run the tests and get
# additional debugging info on failures.
readable_run make
-f
tensorflow/lite/micro/tools/make/Makefile clean
readable_run make
-s
-j8
-f
tensorflow/lite/micro/tools/make/Makefile
BUILD_TYPE
=
release_with_logs
test
# Next, build w/o release so that we can run the tests and get additional
# debugging info on failures.
readable_run make
-f
tensorflow/lite/micro/tools/make/Makefile clean
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录