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
b4a6c0e7
Commit
b4a6c0e7
authored
Jun 20, 2018
by
Tianqi Chen
Committed by
GitHub
Jun 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUILD] Fix reflection build for gcc-8 (#1304)
parent
80e4bc02
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
+23
-21
dmlc-core
+1
-1
src/lang/reflection.cc
+20
-18
src/pass/unroll_loop.cc
+2
-2
No files found.
dmlc-core
@
e864aa67
Subproject commit
9b3f9753ae81d657743c555e0cacc4e43f0bed2d
Subproject commit
e864aa6757cdbe78b1296fe5231fd3050b7802c3
src/lang/reflection.cc
View file @
b4a6c0e7
...
@@ -375,41 +375,43 @@ class NodeAttrSetter : public AttrVisitor {
...
@@ -375,41 +375,43 @@ class NodeAttrSetter : public AttrVisitor {
std
::
string
type_key
;
std
::
string
type_key
;
std
::
unordered_map
<
std
::
string
,
runtime
::
TVMArgValue
>
attrs
;
std
::
unordered_map
<
std
::
string
,
runtime
::
TVMArgValue
>
attrs
;
template
<
typename
T
>
void
SetValue
(
const
char
*
key
,
T
*
value
)
{
auto
it
=
attrs
.
find
(
key
);
if
(
it
==
attrs
.
end
())
{
LOG
(
FATAL
)
<<
type_key
<<
": require field "
<<
key
;
}
*
value
=
it
->
second
.
operator
T
();
attrs
.
erase
(
it
);
}
void
Visit
(
const
char
*
key
,
double
*
value
)
final
{
void
Visit
(
const
char
*
key
,
double
*
value
)
final
{
SetValue
(
key
,
value
);
*
value
=
GetAttr
(
key
).
operator
double
(
);
}
}
void
Visit
(
const
char
*
key
,
int64_t
*
value
)
final
{
void
Visit
(
const
char
*
key
,
int64_t
*
value
)
final
{
SetValue
(
key
,
value
);
*
value
=
GetAttr
(
key
).
operator
int64_t
(
);
}
}
void
Visit
(
const
char
*
key
,
uint64_t
*
value
)
final
{
void
Visit
(
const
char
*
key
,
uint64_t
*
value
)
final
{
SetValue
(
key
,
value
);
*
value
=
GetAttr
(
key
).
operator
uint64_t
(
);
}
}
void
Visit
(
const
char
*
key
,
int
*
value
)
final
{
void
Visit
(
const
char
*
key
,
int
*
value
)
final
{
SetValue
(
key
,
value
);
*
value
=
GetAttr
(
key
).
operator
int
(
);
}
}
void
Visit
(
const
char
*
key
,
bool
*
value
)
final
{
void
Visit
(
const
char
*
key
,
bool
*
value
)
final
{
SetValue
(
key
,
value
);
*
value
=
GetAttr
(
key
).
operator
bool
(
);
}
}
void
Visit
(
const
char
*
key
,
std
::
string
*
value
)
final
{
void
Visit
(
const
char
*
key
,
std
::
string
*
value
)
final
{
SetValue
(
key
,
value
);
*
value
=
GetAttr
(
key
).
operator
std
::
string
(
);
}
}
void
Visit
(
const
char
*
key
,
void
**
value
)
final
{
void
Visit
(
const
char
*
key
,
void
**
value
)
final
{
SetValue
(
key
,
value
);
*
value
=
GetAttr
(
key
).
operator
void
*
(
);
}
}
void
Visit
(
const
char
*
key
,
Type
*
value
)
final
{
void
Visit
(
const
char
*
key
,
Type
*
value
)
final
{
SetValue
(
key
,
value
);
*
value
=
GetAttr
(
key
).
operator
Type
(
);
}
}
void
Visit
(
const
char
*
key
,
NodeRef
*
value
)
final
{
void
Visit
(
const
char
*
key
,
NodeRef
*
value
)
final
{
SetValue
(
key
,
value
);
*
value
=
GetAttr
(
key
).
operator
NodeRef
();
}
private
:
runtime
::
TVMArgValue
GetAttr
(
const
char
*
key
)
{
auto
it
=
attrs
.
find
(
key
);
if
(
it
==
attrs
.
end
())
{
LOG
(
FATAL
)
<<
type_key
<<
": require field "
<<
key
;
}
runtime
::
TVMArgValue
v
=
it
->
second
;
attrs
.
erase
(
it
);
return
v
;
}
}
};
};
...
...
src/pass/unroll_loop.cc
View file @
b4a6c0e7
...
@@ -29,14 +29,14 @@ class LoopUnroller : public IRMutator {
...
@@ -29,14 +29,14 @@ class LoopUnroller : public IRMutator {
Stmt
Mutate_
(
const
AttrStmt
*
op
,
const
Stmt
&
stmt
)
final
{
Stmt
Mutate_
(
const
AttrStmt
*
op
,
const
Stmt
&
stmt
)
final
{
if
(
op
->
attr_key
==
"pragma_auto_unroll_max_step"
)
{
if
(
op
->
attr_key
==
"pragma_auto_unroll_max_step"
)
{
int
value
;
int
value
=
0
;
CHECK
(
arith
::
GetConstInt
(
op
->
value
,
&
value
));
CHECK
(
arith
::
GetConstInt
(
op
->
value
,
&
value
));
std
::
swap
(
value
,
auto_max_step_
);
std
::
swap
(
value
,
auto_max_step_
);
Stmt
ret
=
this
->
Mutate
(
op
->
body
);
Stmt
ret
=
this
->
Mutate
(
op
->
body
);
std
::
swap
(
value
,
auto_max_step_
);
std
::
swap
(
value
,
auto_max_step_
);
return
ret
;
return
ret
;
}
else
if
(
op
->
attr_key
==
"pragma_unroll_explicit"
)
{
}
else
if
(
op
->
attr_key
==
"pragma_unroll_explicit"
)
{
int
value
;
int
value
=
0
;
CHECK
(
arith
::
GetConstInt
(
op
->
value
,
&
value
));
CHECK
(
arith
::
GetConstInt
(
op
->
value
,
&
value
));
bool
explicit_unroll
=
value
;
bool
explicit_unroll
=
value
;
std
::
swap
(
explicit_unroll
,
explicit_unroll_
);
std
::
swap
(
explicit_unroll
,
explicit_unroll_
);
...
...
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