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
588646f2
Commit
588646f2
authored
Nov 05, 2018
by
Paul
Browse files
Formatting
parent
e2f6771f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
test/memory_coloring_test.cpp
test/memory_coloring_test.cpp
+15
-16
No files found.
test/memory_coloring_test.cpp
View file @
588646f2
...
...
@@ -43,7 +43,6 @@ bool no_allocate(const migraph::program& p)
return
std
::
none_of
(
p
.
begin
(),
p
.
end
(),
[](
auto
&&
ins
)
{
return
ins
.
name
()
==
"allocate"
;
});
}
void
test1
()
{
migraph
::
program
p
;
...
...
@@ -410,10 +409,10 @@ void test28()
{
migraph
::
program
p
;
auto
output
=
p
.
add_parameter
(
"output"
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
a1
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
p1
=
p
.
add_instruction
(
pass_op
{},
a1
);
auto
a2
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
40
}});
auto
p2
=
p
.
add_instruction
(
pass_op
{},
a2
,
p1
);
auto
a1
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
p1
=
p
.
add_instruction
(
pass_op
{},
a1
);
auto
a2
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
40
}});
auto
p2
=
p
.
add_instruction
(
pass_op
{},
a2
,
p1
);
p
.
add_instruction
(
pass_op
{},
p2
,
output
);
p
.
compile
(
memory_coloring_target
{});
CHECK
(
p
.
get_parameter_shape
(
"scratch"
).
bytes
()
==
192
);
...
...
@@ -424,10 +423,10 @@ void test29()
{
migraph
::
program
p
;
auto
output
=
p
.
add_parameter
(
"output"
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
a1
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
p1
=
p
.
add_instruction
(
pass_op
{},
a1
);
auto
a2
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
40
}});
auto
p2
=
p
.
add_instruction
(
pass_op
{},
a2
,
p1
);
auto
a1
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
p1
=
p
.
add_instruction
(
pass_op
{},
a1
);
auto
a2
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
40
}});
auto
p2
=
p
.
add_instruction
(
pass_op
{},
a2
,
p1
);
p
.
move_instruction
(
output
,
p2
);
p
.
add_instruction
(
pass_op
{},
p2
,
output
);
p
.
compile
(
memory_coloring_target
{});
...
...
@@ -439,10 +438,10 @@ void test30()
{
migraph
::
program
p
;
auto
output
=
p
.
add_parameter
(
"x"
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
a1
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
p1
=
p
.
add_instruction
(
pass_op
{},
a1
);
auto
a2
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
40
}});
auto
p2
=
p
.
add_instruction
(
pass_op
{},
a2
,
p1
);
auto
a1
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
p1
=
p
.
add_instruction
(
pass_op
{},
a1
);
auto
a2
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
40
}});
auto
p2
=
p
.
add_instruction
(
pass_op
{},
a2
,
p1
);
p
.
move_instruction
(
output
,
p2
);
p
.
add_instruction
(
pass_op
{},
p2
,
output
);
p
.
compile
(
memory_coloring_target
{});
...
...
@@ -454,9 +453,9 @@ void test31()
{
migraph
::
program
p
;
auto
output
=
p
.
add_parameter
(
"output"
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
a1
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
p1
=
p
.
add_instruction
(
pass_op
{},
a1
);
auto
a2
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
40
}});
auto
a1
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
8
}});
auto
p1
=
p
.
add_instruction
(
pass_op
{},
a1
);
auto
a2
=
add_alloc
(
p
,
{
migraph
::
shape
::
float_type
,
{
40
}});
p
.
move_instruction
(
output
,
a2
);
p
.
add_instruction
(
pass_op
{},
a2
,
p1
);
p
.
compile
(
memory_coloring_target
{});
...
...
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