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
3b04798c
Commit
3b04798c
authored
Aug 28, 2018
by
Paul
Browse files
Formatting
parent
fbcb4570
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
19 deletions
+20
-19
src/include/migraph/generate.hpp
src/include/migraph/generate.hpp
+3
-3
src/targets/gpu/device/include/migraph/gpu/device/nary.hpp
src/targets/gpu/device/include/migraph/gpu/device/nary.hpp
+16
-15
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+1
-1
No files found.
src/include/migraph/generate.hpp
View file @
3b04798c
src/targets/gpu/device/include/migraph/gpu/device/nary.hpp
View file @
3b04798c
...
...
@@ -131,7 +131,7 @@ inline auto binary_broadcast(argument result, argument arg1, argument arg2)
{
buffer
[
bdim_vec_len
][
i
]
=
yp
[
bdim_vec_len
][
i
];
}
for
(
size_t
i
=
idx
.
local
;
i
<
(
vec_size
-
bdim_vec_rem
);
i
+=
nlocal
)
for
(
size_t
i
=
idx
.
local
;
i
<
(
vec_size
-
bdim_vec_rem
);
i
+=
nlocal
)
{
buffer
[
bdim_vec_len
][
i
]
=
yp
[
0
][
i
];
}
...
...
@@ -226,13 +226,14 @@ inline auto nary(argument result, argument arg1, argument arg2)
{
auto
not_zero
=
[](
auto
x
)
{
return
x
!=
0
;
};
const
auto
&
strides
=
arg2
.
get_shape
().
strides
();
auto
stride_it
=
std
::
find_if
(
strides
.
begin
(),
strides
.
end
(),
not_zero
);
auto
stride_it
=
std
::
find_if
(
strides
.
begin
(),
strides
.
end
(),
not_zero
);
auto
stride_idx
=
std
::
distance
(
strides
.
begin
(),
stride_it
);
auto
stride_len
=
arg2
.
get_shape
().
lens
()[
stride_idx
];
// TODO: Dont require disibility by 4
bool
divisible_by_4
=
(
stride_len
%
4
==
0
)
and
(
arg1
.
get_shape
().
elements
()
%
4
==
0
);
if
(
divisible_by_4
and
stride_len
<=
2048
and
std
::
none_of
(
std
::
next
(
stride_it
),
strides
.
end
(),
not_zero
))
{
if
(
divisible_by_4
and
stride_len
<=
2048
and
std
::
none_of
(
std
::
next
(
stride_it
),
strides
.
end
(),
not_zero
))
{
binary_broadcast
(
result
,
arg1
,
arg2
)(
f
);
return
;
}
...
...
test/gpu/miopen.cpp
View file @
3b04798c
...
...
@@ -77,7 +77,7 @@ struct auto_print
};
std
::
array
<
std
::
function
<
void
()
>
,
2
>
auto_print
::
handlers
=
{};
template
<
class
T
>
template
<
class
T
>
auto
get_hash
(
const
T
&
x
)
{
return
std
::
hash
<
T
>
{}(
x
);
...
...
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