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
733591e1
Commit
733591e1
authored
Sep 10, 2018
by
Paul
Browse files
Formatting
parent
117ae108
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/eliminate_allocation.cpp
src/eliminate_allocation.cpp
+1
-1
test/eliminate_allocation_test.cpp
test/eliminate_allocation_test.cpp
+7
-5
No files found.
src/eliminate_allocation.cpp
View file @
733591e1
test/eliminate_allocation_test.cpp
View file @
733591e1
...
@@ -24,7 +24,9 @@ struct allocate
...
@@ -24,7 +24,9 @@ struct allocate
migraph
::
check_shapes
{
inputs
}.
has
(
0
);
migraph
::
check_shapes
{
inputs
}.
has
(
0
);
return
s
;
return
s
;
}
}
migraph
::
argument
compute
(
migraph
::
context
&
,
const
migraph
::
shape
&
output_shape
,
const
std
::
vector
<
migraph
::
argument
>&
)
const
migraph
::
argument
compute
(
migraph
::
context
&
,
const
migraph
::
shape
&
output_shape
,
const
std
::
vector
<
migraph
::
argument
>&
)
const
{
{
return
{
output_shape
};
return
{
output_shape
};
}
}
...
@@ -44,7 +46,7 @@ void basic()
...
@@ -44,7 +46,7 @@ void basic()
p
.
compile
(
eliminate_allocation_target
{});
p
.
compile
(
eliminate_allocation_target
{});
EXPECT
(
p
.
get_shape
()
==
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
200
}});
EXPECT
(
p
.
get_shape
()
==
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
200
}});
EXPECT
(
p
.
get_parameter_shape
(
"memory"
).
bytes
()
==
(
8
*
4
+
40
*
4
+
200
*
4
));
EXPECT
(
p
.
get_parameter_shape
(
"memory"
).
bytes
()
==
(
8
*
4
+
40
*
4
+
200
*
4
));
}
}
void
aligned
()
void
aligned
()
...
@@ -61,7 +63,7 @@ void aligned()
...
@@ -61,7 +63,7 @@ void aligned()
p
.
compile
(
eliminate_allocation_target
{});
p
.
compile
(
eliminate_allocation_target
{});
EXPECT
(
p
.
get_shape
()
==
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
200
}});
EXPECT
(
p
.
get_shape
()
==
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
200
}});
EXPECT
(
p
.
get_parameter_shape
(
"memory"
).
bytes
()
==
(
32
+
32
+
200
*
4
));
EXPECT
(
p
.
get_parameter_shape
(
"memory"
).
bytes
()
==
(
32
+
32
+
200
*
4
));
}
}
void
unaligned
()
void
unaligned
()
...
@@ -78,7 +80,7 @@ void unaligned()
...
@@ -78,7 +80,7 @@ void unaligned()
p
.
compile
(
eliminate_allocation_target
{
1
});
p
.
compile
(
eliminate_allocation_target
{
1
});
EXPECT
(
p
.
get_shape
()
==
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
200
}});
EXPECT
(
p
.
get_shape
()
==
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
200
}});
EXPECT
(
p
.
get_parameter_shape
(
"memory"
).
bytes
()
==
(
1
*
4
+
2
*
4
+
200
*
4
));
EXPECT
(
p
.
get_parameter_shape
(
"memory"
).
bytes
()
==
(
1
*
4
+
2
*
4
+
200
*
4
));
}
}
void
float_aligned
()
void
float_aligned
()
...
@@ -95,7 +97,7 @@ void float_aligned()
...
@@ -95,7 +97,7 @@ void float_aligned()
p
.
compile
(
eliminate_allocation_target
{
4
});
p
.
compile
(
eliminate_allocation_target
{
4
});
EXPECT
(
p
.
get_shape
()
==
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
200
}});
EXPECT
(
p
.
get_shape
()
==
migraph
::
shape
{
migraph
::
shape
::
float_type
,
{
200
}});
EXPECT
(
p
.
get_parameter_shape
(
"memory"
).
bytes
()
==
(
1
*
4
+
2
*
4
+
200
*
4
));
EXPECT
(
p
.
get_parameter_shape
(
"memory"
).
bytes
()
==
(
1
*
4
+
2
*
4
+
200
*
4
));
}
}
int
main
()
int
main
()
...
...
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