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
4392a6cf
Commit
4392a6cf
authored
Mar 05, 2018
by
nhynes
Committed by
Tianqi Chen
Mar 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SGXify graph runtime (#937)
parent
68ea2c3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
dmlc-core
+1
-1
src/runtime/graph/graph_runtime.cc
+8
-12
No files found.
dmlc-core
@
d3f7fbb5
Subproject commit
7e84e8b036a3ff5c0104a3da1f4c7eebf94396e
c
Subproject commit
d3f7fbb53e5b037c0f5bf6bd21871ccc720690c
c
src/runtime/graph/graph_runtime.cc
View file @
4392a6cf
...
...
@@ -64,7 +64,11 @@ class GraphRuntime : public ModuleNode {
void
Init
(
const
std
::
string
&
graph_json
,
tvm
::
runtime
::
Module
module
,
TVMContext
ctx
)
{
#ifndef _LIBCPP_SGX_NO_IOSTREAMS
std
::
istringstream
is
(
graph_json
);
#else
std
::
string
is
=
graph_json
;
#endif
dmlc
::
JSONReader
reader
(
&
is
);
this
->
Load
(
&
reader
);
module_
=
module
;
...
...
@@ -198,27 +202,19 @@ class GraphRuntime : public ModuleNode {
std
::
string
key
,
value
;
reader
->
BeginObject
();
while
(
reader
->
NextObjectItem
(
&
key
))
{
reader
->
Read
(
&
value
);
if
(
key
==
"func_name"
)
{
reader
->
Read
(
&
value
);
param
->
func_name
=
value
;
bitmask
|=
1
;
}
else
if
(
key
==
"num_inputs"
)
{
reader
->
Read
(
&
value
);
std
::
istringstream
is
(
value
);
is
>>
param
->
num_inputs
;
param
->
num_inputs
=
strtoul
(
value
.
c_str
(),
nullptr
,
10
);
bitmask
|=
2
;
}
else
if
(
key
==
"num_outputs"
)
{
reader
->
Read
(
&
value
);
std
::
istringstream
is
(
value
);
is
>>
param
->
num_outputs
;
param
->
num_outputs
=
strtoul
(
value
.
c_str
(),
nullptr
,
10
);
bitmask
|=
4
;
}
else
if
(
key
==
"flatten_data"
)
{
reader
->
Read
(
&
value
);
std
::
istringstream
is
(
value
);
is
>>
param
->
flatten_data
;
param
->
flatten_data
=
strtoul
(
value
.
c_str
(),
nullptr
,
10
);
bitmask
|=
8
;
}
else
{
reader
->
Read
(
&
value
);
}
}
CHECK_EQ
(
bitmask
,
1
|
2
|
4
|
8
)
<<
"invalid format"
;
...
...
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