Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
86b6fd69
"docs/vscode:/vscode.git/clone" did not exist on "dda6a126463b3d560f2525e8daea2f0c7be9f56f"
Commit
86b6fd69
authored
Oct 03, 2018
by
Paul
Browse files
Add missing load_literal operator
parent
3924f7ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
src/opt/memory_coloring_impl.cpp
src/opt/memory_coloring_impl.cpp
+1
-0
test/memory_coloring_test.cpp
test/memory_coloring_test.cpp
+13
-0
No files found.
src/opt/memory_coloring_impl.cpp
View file @
86b6fd69
...
...
@@ -185,6 +185,7 @@ void memory_coloring_impl::build()
void
memory_coloring_impl
::
register_operand_alias
()
{
operand_alias
[
"hip::allocate"
]
=
-
1
;
operand_alias
[
"hip::load_literal"
]
=
-
1
;
operand_alias
[
"@outline"
]
=
-
1
;
operand_alias
[
"check_context"
]
=
-
1
;
operand_alias
[
"@literal"
]
=
-
1
;
...
...
test/memory_coloring_test.cpp
View file @
86b6fd69
#include <migraph/memory_coloring.hpp>
#include <migraph/operators.hpp>
#include <migraph/generate.hpp>
#include <basic_ops.hpp>
#include <test.hpp>
...
...
@@ -112,10 +113,22 @@ void test4()
EXPECT
(
p
.
get_parameter_shape
(
"scratch"
).
bytes
()
==
672
);
}
void
literal_test
()
{
migraph
::
program
p
;
auto
lit
=
generate_literal
(
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}});
p
.
add_literal
(
lit
);
p
.
compile
(
memory_coloring_target
{});
auto
result
=
p
.
eval
({});
EXPECT
(
lit
==
result
);
}
int
main
()
{
test1
();
test2
();
test3
();
test4
();
literal_test
();
}
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