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
1347cb14
Commit
1347cb14
authored
Jul 26, 2018
by
Paul
Browse files
Formatting
parent
6d8d7d41
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
16 deletions
+7
-16
src/include/migraph/program.hpp
src/include/migraph/program.hpp
+1
-4
src/include/migraph/stringutils.hpp
src/include/migraph/stringutils.hpp
+1
-1
src/program.cpp
src/program.cpp
+1
-4
test/include/test.hpp
test/include/test.hpp
+1
-2
test/program_test.cpp
test/program_test.cpp
+3
-5
No files found.
src/include/migraph/program.hpp
View file @
1347cb14
...
@@ -84,10 +84,7 @@ struct program
...
@@ -84,10 +84,7 @@ struct program
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
program
&
p
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
program
&
p
);
friend
bool
operator
==
(
const
program
&
x
,
const
program
&
y
);
friend
bool
operator
==
(
const
program
&
x
,
const
program
&
y
);
friend
bool
operator
!=
(
const
program
&
x
,
const
program
&
y
)
friend
bool
operator
!=
(
const
program
&
x
,
const
program
&
y
)
{
return
!
(
x
==
y
);
}
{
return
!
(
x
==
y
);
}
private:
private:
std
::
unique_ptr
<
program_impl
>
impl
;
std
::
unique_ptr
<
program_impl
>
impl
;
...
...
src/include/migraph/stringutils.hpp
View file @
1347cb14
...
@@ -77,7 +77,7 @@ inline std::string to_string_range(const Range& r)
...
@@ -77,7 +77,7 @@ inline std::string to_string_range(const Range& r)
return
ss
.
str
();
return
ss
.
str
();
}
}
template
<
class
T
>
template
<
class
T
>
inline
std
::
string
to_string
(
const
T
&
x
)
inline
std
::
string
to_string
(
const
T
&
x
)
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
...
...
src/program.cpp
View file @
1347cb14
...
@@ -191,10 +191,7 @@ argument program::eval(std::unordered_map<std::string, argument> params) const
...
@@ -191,10 +191,7 @@ argument program::eval(std::unordered_map<std::string, argument> params) const
return
result
;
return
result
;
}
}
bool
operator
==
(
const
program
&
x
,
const
program
&
y
)
bool
operator
==
(
const
program
&
x
,
const
program
&
y
)
{
return
to_string
(
x
)
==
to_string
(
y
);
}
{
return
to_string
(
x
)
==
to_string
(
y
);
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
program
&
p
)
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
program
&
p
)
{
{
...
...
test/include/test.hpp
View file @
1347cb14
...
@@ -50,8 +50,7 @@ struct expression
...
@@ -50,8 +50,7 @@ struct expression
// TODO: Remove rvalue references
// TODO: Remove rvalue references
template
<
class
T
,
class
U
,
class
Operator
>
template
<
class
T
,
class
U
,
class
Operator
>
expression
<
T
,
U
,
Operator
>
expression
<
T
,
U
,
Operator
>
make_expression
(
T
&&
rhs
,
U
&&
lhs
,
Operator
)
make_expression
(
T
&&
rhs
,
U
&&
lhs
,
Operator
)
{
{
return
{
std
::
forward
<
T
>
(
rhs
),
std
::
forward
<
U
>
(
lhs
)};
return
{
std
::
forward
<
T
>
(
rhs
),
std
::
forward
<
U
>
(
lhs
)};
}
}
...
...
test/program_test.cpp
View file @
1347cb14
...
@@ -14,19 +14,17 @@ migraph::program create_program()
...
@@ -14,19 +14,17 @@ migraph::program create_program()
auto
y
=
p
.
add_parameter
(
"y"
,
{
migraph
::
shape
::
int64_type
});
auto
y
=
p
.
add_parameter
(
"y"
,
{
migraph
::
shape
::
int64_type
});
auto
sum
=
p
.
add_instruction
(
sum_op
{},
x
,
y
);
auto
sum
=
p
.
add_instruction
(
sum_op
{},
x
,
y
);
auto
one
=
p
.
add_literal
(
1
);
auto
one
=
p
.
add_literal
(
1
);
p
.
add_instruction
(
sum_op
{},
sum
,
one
);
p
.
add_instruction
(
sum_op
{},
sum
,
one
);
return
p
;
return
p
;
}
}
void
program_equality
()
void
program_equality
()
{
{
migraph
::
program
x
=
create_program
();
migraph
::
program
x
=
create_program
();
migraph
::
program
y
=
create_program
();
migraph
::
program
y
=
create_program
();
EXPECT
(
x
==
y
);
EXPECT
(
x
==
y
);
}
}
int
main
()
{
int
main
()
{
program_equality
();
}
program_equality
();
}
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