Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
d93b72b5
Commit
d93b72b5
authored
Jul 18, 2018
by
alex-weaver
Committed by
Tianqi Chen
Jul 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[RPC] Added native debug logging to Android RPC (#1432)
parent
a566d36b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
apps/android_rpc/app/src/main/jni/tvm_runtime.h
+21
-0
No files found.
apps/android_rpc/app/src/main/jni/tvm_runtime.h
View file @
d93b72b5
...
...
@@ -6,6 +6,18 @@
#include <sys/stat.h>
#include <fstream>
/* Enable custom logging - this will cause TVM to pass every log message
* through CustomLogMessage instead of LogMessage. By enabling this, we must
* implement dmlc::CustomLogMessage::Log. We use this to pass TVM log
* messages to Android logcat.
*/
#define DMLC_LOG_CUSTOMIZE 1
/* Ensure that fatal errors are passed to the logger before throwing
* in LogMessageFatal
*/
#define DMLC_LOG_BEFORE_THROW 1
#include "../src/runtime/c_runtime_api.cc"
#include "../src/runtime/cpu_device_api.cc"
#include "../src/runtime/workspace_pool.cc"
...
...
@@ -34,3 +46,12 @@
#include "../src/runtime/vulkan/vulkan_device_api.cc"
#include "../src/runtime/vulkan/vulkan_module.cc"
#endif
#include <android/log.h>
void
dmlc
::
CustomLogMessage
::
Log
(
const
std
::
string
&
msg
)
{
// This is called for every message logged by TVM.
// We pass the message to logcat.
__android_log_write
(
ANDROID_LOG_DEBUG
,
"TVM_RUNTIME"
,
msg
.
c_str
());
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment