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
168584b7
Commit
168584b7
authored
Jul 10, 2019
by
Shucai Xiao
Browse files
merge changes from gpu_div branch
parents
6c9f9277
8d059502
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
src/propagate_constant.cpp
src/propagate_constant.cpp
+3
-3
src/targets/gpu/device/div.cpp
src/targets/gpu/device/div.cpp
+1
-1
src/targets/gpu/device/pow.cpp
src/targets/gpu/device/pow.cpp
+1
-1
src/targets/gpu/device/sub.cpp
src/targets/gpu/device/sub.cpp
+1
-1
src/targets/gpu/include/migraphx/gpu/oper.hpp
src/targets/gpu/include/migraphx/gpu/oper.hpp
+1
-1
No files found.
src/propagate_constant.cpp
View file @
168584b7
...
@@ -10,8 +10,8 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -10,8 +10,8 @@ inline namespace MIGRAPHX_INLINE_NS {
bool
skip_propogate
(
instruction_ref
ins
)
bool
skip_propogate
(
instruction_ref
ins
)
{
{
if
(
ins
->
name
()
==
"
@literal
"
)
if
(
ins
->
name
()
==
"
contiguous
"
)
return
true
;
return
skip_propogate
(
ins
->
inputs
().
front
())
;
auto
&&
s
=
ins
->
get_shape
();
auto
&&
s
=
ins
->
get_shape
();
if
(
s
.
broadcasted
()
and
not
s
.
scalar
())
if
(
s
.
broadcasted
()
and
not
s
.
scalar
())
return
true
;
return
true
;
...
@@ -33,7 +33,7 @@ void propagate_constant::apply(program& p) const
...
@@ -33,7 +33,7 @@ void propagate_constant::apply(program& p) const
ins
->
outputs
().
end
());
ins
->
outputs
().
end
());
for
(
auto
child
:
children
)
for
(
auto
child
:
children
)
{
{
if
(
skip_propogate
(
child
))
if
(
child
->
name
()
==
"@literal"
or
skip_propogate
(
child
))
{
{
self
(
child
);
self
(
child
);
continue
;
continue
;
...
...
src/targets/gpu/device/div.cpp
View file @
168584b7
...
@@ -8,7 +8,7 @@ namespace device {
...
@@ -8,7 +8,7 @@ namespace device {
void
div
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg2
)
void
div
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg2
)
{
{
nary
(
stream
,
result
,
arg1
,
arg2
)([](
auto
x
,
auto
y
)
{
return
y
/
x
;
});
nary
(
stream
,
result
,
arg1
,
arg2
)([](
auto
x
,
auto
y
)
{
return
x
/
y
;
});
}
}
}
// namespace device
}
// namespace device
...
...
src/targets/gpu/device/pow.cpp
View file @
168584b7
...
@@ -9,7 +9,7 @@ namespace device {
...
@@ -9,7 +9,7 @@ namespace device {
void
pow
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg2
)
void
pow
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg2
)
{
{
nary
(
stream
,
result
,
arg1
,
arg2
)(
nary
(
stream
,
result
,
arg1
,
arg2
)(
[](
auto
e
,
auto
b
)
{
return
::
pow
(
to_hip_type
(
b
),
to_hip_type
(
e
));
});
[](
auto
b
,
auto
e
)
{
return
::
pow
(
to_hip_type
(
b
),
to_hip_type
(
e
));
});
}
}
}
// namespace device
}
// namespace device
...
...
src/targets/gpu/device/sub.cpp
View file @
168584b7
...
@@ -8,7 +8,7 @@ namespace device {
...
@@ -8,7 +8,7 @@ namespace device {
void
sub
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg2
)
void
sub
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg2
)
{
{
nary
(
stream
,
result
,
arg1
,
arg2
)([](
auto
x
,
auto
y
)
{
return
y
-
x
;
});
nary
(
stream
,
result
,
arg1
,
arg2
)([](
auto
x
,
auto
y
)
{
return
x
-
y
;
});
}
}
}
// namespace device
}
// namespace device
...
...
src/targets/gpu/include/migraphx/gpu/oper.hpp
View file @
168584b7
...
@@ -88,7 +88,7 @@ struct binary_device : oper<Derived>
...
@@ -88,7 +88,7 @@ struct binary_device : oper<Derived>
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
{
{
F
(
ctx
.
get_stream
().
get
(),
args
[
2
],
args
[
1
],
args
[
0
]);
F
(
ctx
.
get_stream
().
get
(),
args
[
2
],
args
[
0
],
args
[
1
]);
return
args
[
2
];
return
args
[
2
];
}
}
...
...
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