Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
b1ba0937
Commit
b1ba0937
authored
Sep 16, 2018
by
Paul
Browse files
Rename lit field
parent
62970436
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+1
-1
src/onnx/verify_onnx.cpp
src/onnx/verify_onnx.cpp
+1
-1
src/program.cpp
src/program.cpp
+3
-3
src/targets/gpu/write_literals.cpp
src/targets/gpu/write_literals.cpp
+1
-1
No files found.
src/onnx/onnx.cpp
View file @
b1ba0937
...
@@ -160,7 +160,7 @@ struct onnx_parser
...
@@ -160,7 +160,7 @@ struct onnx_parser
}
}
if
(
args
.
size
()
==
2
)
if
(
args
.
size
()
==
2
)
{
{
literal
s
=
args
[
1
]
->
lit
;
literal
s
=
args
[
1
]
->
get_literal
()
;
s
.
visit
([
&
](
auto
v
)
{
copy
(
v
,
std
::
back_inserter
(
op
.
dims
));
});
s
.
visit
([
&
](
auto
v
)
{
copy
(
v
,
std
::
back_inserter
(
op
.
dims
));
});
}
}
return
prog
.
add_instruction
(
op
,
args
[
0
]);
return
prog
.
add_instruction
(
op
,
args
[
0
]);
...
...
src/onnx/verify_onnx.cpp
View file @
b1ba0937
...
@@ -71,7 +71,7 @@ void verify_instructions(const migraph::program& prog, double tolerance = 80)
...
@@ -71,7 +71,7 @@ void verify_instructions(const migraph::program& prog, double tolerance = 80)
for
(
auto
&&
arg
:
ins
.
inputs
())
for
(
auto
&&
arg
:
ins
.
inputs
())
{
{
if
(
arg
->
name
()
==
"@literal"
)
if
(
arg
->
name
()
==
"@literal"
)
inputs
.
push_back
(
p
.
add_literal
(
arg
->
lit
));
inputs
.
push_back
(
p
.
add_literal
(
arg
->
get_literal
()
));
else
else
inputs
.
push_back
(
inputs
.
push_back
(
p
.
add_parameter
(
std
::
to_string
(
inputs
.
size
()),
arg
->
get_shape
()));
p
.
add_parameter
(
std
::
to_string
(
inputs
.
size
()),
arg
->
get_shape
()));
...
...
src/program.cpp
View file @
b1ba0937
...
@@ -42,10 +42,10 @@ static void print_program(std::ostream& os, const program& p, F annonate)
...
@@ -42,10 +42,10 @@ static void print_program(std::ostream& os, const program& p, F annonate)
if
(
ins
->
name
()
==
"@literal"
)
if
(
ins
->
name
()
==
"@literal"
)
{
{
if
(
ins
->
lit
.
get_shape
().
elements
()
>
10
)
if
(
ins
->
get_literal
()
.
get_shape
().
elements
()
>
10
)
os
<<
"{ ... }"
;
os
<<
"{ ... }"
;
else
else
os
<<
"{"
<<
ins
->
lit
<<
"}"
;
os
<<
"{"
<<
ins
->
get_literal
()
<<
"}"
;
}
}
if
(
!
ins
->
inputs
().
empty
())
if
(
!
ins
->
inputs
().
empty
())
...
@@ -286,7 +286,7 @@ argument generic_eval(const program& p,
...
@@ -286,7 +286,7 @@ argument generic_eval(const program& p,
{
{
if
(
ins
->
name
()
==
"@literal"
)
if
(
ins
->
name
()
==
"@literal"
)
{
{
results
.
emplace
(
ins
,
trace
(
ins
,
[
&
]
{
return
ins
->
lit
.
get_argument
();
}));
results
.
emplace
(
ins
,
trace
(
ins
,
[
&
]
{
return
ins
->
get_literal
()
.
get_argument
();
}));
}
}
else
if
(
ins
->
name
()
==
"@param"
)
else
if
(
ins
->
name
()
==
"@param"
)
{
{
...
...
src/targets/gpu/write_literals.cpp
View file @
b1ba0937
...
@@ -30,7 +30,7 @@ void write_literals::apply(program& p) const
...
@@ -30,7 +30,7 @@ void write_literals::apply(program& p) const
{
{
if
(
ins
->
name
()
==
"@literal"
)
if
(
ins
->
name
()
==
"@literal"
)
{
{
argument
a
=
to_gpu
(
ins
->
lit
.
get_argument
());
argument
a
=
to_gpu
(
ins
->
get_literal
()
.
get_argument
());
std
::
size_t
n
=
ctx
->
literals
.
size
();
std
::
size_t
n
=
ctx
->
literals
.
size
();
ctx
->
literals
.
push_back
(
a
);
ctx
->
literals
.
push_back
(
a
);
p
.
replace_instruction
(
ins
,
hip_load_literal
{
a
.
get_shape
(),
n
});
p
.
replace_instruction
(
ins
,
hip_load_literal
{
a
.
get_shape
(),
n
});
...
...
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