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
ce8139e5
Commit
ce8139e5
authored
Apr 22, 2019
by
Shucai Xiao
Browse files
clang format
parent
cced8ba3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
src/include/migraphx/op/binary.hpp
src/include/migraphx/op/binary.hpp
+1
-1
src/include/migraphx/op/unary.hpp
src/include/migraphx/op/unary.hpp
+1
-1
src/targets/cpu/lowering.cpp
src/targets/cpu/lowering.cpp
+5
-5
src/targets/gpu/include/migraphx/gpu/oper.hpp
src/targets/gpu/include/migraphx/gpu/oper.hpp
+2
-2
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+3
-3
No files found.
src/include/migraphx/op/binary.hpp
View file @
ce8139e5
...
...
@@ -21,7 +21,7 @@ struct binary
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
}.
has
(
2
).
same_type
().
same_dims
();
if
(
inputs
.
at
(
0
)
==
inputs
.
at
(
1
)
and
inputs
.
at
(
0
).
packed
()
and
inputs
.
at
(
1
).
packed
())
if
(
inputs
.
at
(
0
)
==
inputs
.
at
(
1
)
and
inputs
.
at
(
0
).
packed
()
and
inputs
.
at
(
1
).
packed
())
{
return
inputs
.
at
(
0
);
}
...
...
src/include/migraphx/op/unary.hpp
View file @
ce8139e5
...
...
@@ -21,7 +21,7 @@ struct unary
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
}.
has
(
1
);
if
(
inputs
.
front
().
packed
())
if
(
inputs
.
front
().
packed
())
{
return
inputs
.
at
(
0
);
}
...
...
src/targets/cpu/lowering.cpp
View file @
ce8139e5
...
...
@@ -593,9 +593,9 @@ struct cpu_unary
{
Op
op
;
std
::
string
name
()
const
{
return
op
.
name
();
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
{
if
(
inputs
.
at
(
0
).
packed
())
if
(
inputs
.
at
(
0
).
packed
())
{
return
inputs
.
at
(
0
);
}
...
...
@@ -793,9 +793,9 @@ struct cpu_binary
{
Op
op
;
std
::
string
name
()
const
{
return
op
.
name
();
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
{
if
(
inputs
.
at
(
0
)
==
inputs
.
at
(
1
)
and
inputs
.
at
(
0
).
packed
()
and
inputs
.
at
(
1
).
packed
())
if
(
inputs
.
at
(
0
)
==
inputs
.
at
(
1
)
and
inputs
.
at
(
0
).
packed
()
and
inputs
.
at
(
1
).
packed
())
{
return
inputs
.
at
(
0
);
}
...
...
@@ -804,7 +804,7 @@ struct cpu_binary
return
{
inputs
.
at
(
0
).
type
(),
inputs
.
at
(
0
).
lens
()};
}
}
argument
compute
(
context
&
,
const
shape
&
output_shape
,
std
::
vector
<
argument
>
args
)
const
{
argument
result
{
output_shape
};
...
...
src/targets/gpu/include/migraphx/gpu/oper.hpp
View file @
ce8139e5
...
...
@@ -45,7 +45,7 @@ struct unary_device : oper<Derived>
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
2
);
if
(
inputs
.
at
(
0
).
packed
())
if
(
inputs
.
at
(
0
).
packed
())
{
return
inputs
.
at
(
0
);
}
...
...
@@ -70,7 +70,7 @@ struct binary_device : oper<Derived>
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
3
);
if
(
inputs
.
at
(
0
)
==
inputs
.
at
(
1
)
and
inputs
.
at
(
0
).
packed
()
and
inputs
.
at
(
1
).
packed
())
if
(
inputs
.
at
(
0
)
==
inputs
.
at
(
1
)
and
inputs
.
at
(
0
).
packed
()
and
inputs
.
at
(
1
).
packed
())
{
return
inputs
.
at
(
0
);
}
...
...
test/gpu/miopen.cpp
View file @
ce8139e5
...
...
@@ -335,7 +335,7 @@ struct test_trans_tanh : verify_program<test_trans_tanh>
auto
x
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}});
auto
tx
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
1
,
3
,
2
}},
x
);
auto
tanhx
=
p
.
add_instruction
(
migraphx
::
op
::
tanh
{},
tx
);
auto
r
=
p
.
add_instruction
(
migraphx
::
op
::
add
{},
tanhx
,
tanhx
);
auto
r
=
p
.
add_instruction
(
migraphx
::
op
::
add
{},
tanhx
,
tanhx
);
p
.
add_instruction
(
migraphx
::
op
::
contiguous
{},
r
);
return
p
;
...
...
@@ -697,9 +697,9 @@ struct test_trans_abs : verify_program<test_trans_abs>
auto
x
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}});
auto
tx
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
1
,
3
,
2
}},
x
);
auto
absx
=
p
.
add_instruction
(
migraphx
::
op
::
abs
{},
tx
);
auto
r
=
p
.
add_instruction
(
migraphx
::
op
::
add
{},
absx
,
absx
);
auto
r
=
p
.
add_instruction
(
migraphx
::
op
::
add
{},
absx
,
absx
);
p
.
add_instruction
(
migraphx
::
op
::
contiguous
{},
r
);
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