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
f0861b1a
Commit
f0861b1a
authored
Aug 16, 2018
by
Paul
Browse files
Reserve space
parent
cf3dda78
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
src/include/migraph/program.hpp
src/include/migraph/program.hpp
+1
-0
src/program.cpp
src/program.cpp
+5
-1
No files found.
src/include/migraph/program.hpp
View file @
f0861b1a
...
...
@@ -79,6 +79,7 @@ struct program
bool
has_instruction
(
instruction_ref
ins
)
const
;
std
::
size_t
size
()
const
;
instruction_ref
begin
()
const
;
instruction_ref
end
()
const
;
...
...
src/program.cpp
View file @
f0861b1a
...
...
@@ -220,6 +220,7 @@ bool program::has_instruction(instruction_ref ins) const
})
!=
impl
->
instructions
.
end
();
}
std
::
size_t
program
::
size
()
const
{
return
impl
->
instructions
.
size
();
}
instruction_ref
program
::
begin
()
const
{
return
impl
->
instructions
.
begin
();
}
instruction_ref
program
::
end
()
const
{
return
impl
->
instructions
.
end
();
}
...
...
@@ -276,7 +277,10 @@ argument generic_eval(const program& p,
{
assert
(
p
.
validate
()
==
p
.
end
());
std
::
unordered_map
<
const
instruction
*
,
argument
>
results
;
results
.
reserve
(
p
.
size
());
argument
result
;
std
::
vector
<
argument
>
values
;
values
.
reserve
(
16
);
for
(
auto
&
ins
:
p
)
{
if
(
ins
.
op
.
name
()
==
"@literal"
)
...
...
@@ -293,7 +297,7 @@ argument generic_eval(const program& p,
}
else
{
std
::
vector
<
argument
>
values
(
ins
.
arguments
.
size
());
values
.
resize
(
ins
.
arguments
.
size
());
std
::
transform
(
ins
.
arguments
.
begin
(),
ins
.
arguments
.
end
(),
values
.
begin
(),
...
...
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