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
c40d667e
"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "e83034cf08ac40aed277416cbcc3967c1fdc238e"
Commit
c40d667e
authored
May 01, 2019
by
Shucai Xiao
Browse files
clang format
parent
140fde0a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
12 deletions
+10
-12
src/include/migraphx/op/binary.hpp
src/include/migraphx/op/binary.hpp
+1
-1
src/include/migraphx/op/convert.hpp
src/include/migraphx/op/convert.hpp
+3
-3
src/include/migraphx/op/unary.hpp
src/include/migraphx/op/unary.hpp
+3
-3
test/type_conversion.cpp
test/type_conversion.cpp
+3
-5
No files found.
src/include/migraphx/op/binary.hpp
View file @
c40d667e
...
...
@@ -18,7 +18,7 @@ struct binary : op_name<Derived>
return
{
s
.
type
()};
return
{
s
.
type
(),
s
.
lens
()};
}
argument
compute
(
const
shape
&
output_shape
,
std
::
vector
<
argument
>
args
)
const
{
argument
result
{
output_shape
};
...
...
src/include/migraphx/op/convert.hpp
View file @
c40d667e
...
...
@@ -30,7 +30,7 @@ struct convert : unary<convert>
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
1
);
if
(
inputs
.
at
(
0
).
packed
())
if
(
inputs
.
at
(
0
).
packed
())
{
return
{
target_type
,
inputs
.
at
(
0
).
lens
(),
inputs
.
at
(
0
).
strides
()};
}
...
...
@@ -45,8 +45,8 @@ struct convert : unary<convert>
return
[](
auto
x
)
{
return
x
;
};
}
convert
(
shape
::
type_t
t
)
:
target_type
{
t
}
{
}
convert
()
{
}
convert
(
shape
::
type_t
t
)
:
target_type
{
t
}
{}
convert
()
{}
};
}
// namespace op
...
...
src/include/migraphx/op/unary.hpp
View file @
c40d667e
...
...
@@ -24,9 +24,9 @@ struct unary : op_name<Derived>
if
(
input
.
get_shape
().
packed
())
{
std
::
transform
(
input
.
begin
(),
input
.
end
(),
output
.
begin
(),
static_cast
<
const
Derived
&>
(
*
this
).
apply
());
input
.
end
(),
output
.
begin
(),
static_cast
<
const
Derived
&>
(
*
this
).
apply
());
return
result
;
}
...
...
test/type_conversion.cpp
View file @
c40d667e
...
...
@@ -28,12 +28,10 @@ TEST_CASE(param_add)
migraphx
::
program
p
;
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
2
,
3
}};
auto
p1
=
p
.
add_parameter
(
"x"
,
s
);
auto
hp1
=
p
.
insert_instruction
(
std
::
next
(
p1
),
migraphx
::
op
::
convert
{},
p1
);
auto
hp1
=
p
.
insert_instruction
(
std
::
next
(
p1
),
migraphx
::
op
::
convert
{},
p1
);
auto
p2
=
p
.
add_parameter
(
"y"
,
s
);
auto
hp2
=
p
.
insert_instruction
(
std
::
next
(
p2
),
migraphx
::
op
::
convert
{},
p2
);
auto
hs
=
p
.
add_instruction
(
migraphx
::
op
::
add
{},
hp1
,
hp2
);
auto
hp2
=
p
.
insert_instruction
(
std
::
next
(
p2
),
migraphx
::
op
::
convert
{},
p2
);
auto
hs
=
p
.
add_instruction
(
migraphx
::
op
::
add
{},
hp1
,
hp2
);
p
.
add_instruction
(
migraphx
::
op
::
convert
{
migraphx
::
shape
::
float_type
},
hs
);
return
p
;
...
...
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