Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
93eae2df
Commit
93eae2df
authored
Jun 25, 2019
by
Shucai Xiao
Browse files
clang format
parent
9fc184e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
src/targets/gpu/include/migraphx/gpu/device/reduce_opers.hpp
src/targets/gpu/include/migraphx/gpu/device/reduce_opers.hpp
+5
-6
No files found.
src/targets/gpu/include/migraphx/gpu/device/reduce_opers.hpp
View file @
93eae2df
...
@@ -16,11 +16,10 @@ inline __device__ void reduce_max(T* data_ptr, size_t block_size, size_t thr_idx
...
@@ -16,11 +16,10 @@ inline __device__ void reduce_max(T* data_ptr, size_t block_size, size_t thr_idx
while
(
true
)
while
(
true
)
{
{
auto
stride
=
(
item_num
+
1
)
/
2
;
auto
stride
=
(
item_num
+
1
)
/
2
;
auto
size
=
item_num
/
2
;
auto
size
=
item_num
/
2
;
for
(
size_t
i
=
thr_idx
;
i
<
size
;
i
+=
block_size
)
for
(
size_t
i
=
thr_idx
;
i
<
size
;
i
+=
block_size
)
{
{
data_ptr
[
i
]
=
data_ptr
[
i
]
=
::
max
(
to_hip_type
(
data_ptr
[
i
]),
to_hip_type
(
data_ptr
[
i
+
stride
]));
::
max
(
to_hip_type
(
data_ptr
[
i
]),
to_hip_type
(
data_ptr
[
i
+
stride
]));
}
}
__syncthreads
();
__syncthreads
();
item_num
=
stride
;
item_num
=
stride
;
...
@@ -44,8 +43,8 @@ inline __device__ void reduce_sum(T* data_ptr, size_t block_size, size_t thr_idx
...
@@ -44,8 +43,8 @@ inline __device__ void reduce_sum(T* data_ptr, size_t block_size, size_t thr_idx
while
(
true
)
while
(
true
)
{
{
auto
stride
=
(
item_num
+
1
)
/
2
;
auto
stride
=
(
item_num
+
1
)
/
2
;
auto
size
=
item_num
/
2
;
auto
size
=
item_num
/
2
;
for
(
size_t
i
=
thr_idx
;
i
<
size
;
i
+=
block_size
)
for
(
size_t
i
=
thr_idx
;
i
<
size
;
i
+=
block_size
)
{
{
data_ptr
[
i
]
+=
data_ptr
[
i
+
stride
];
data_ptr
[
i
]
+=
data_ptr
[
i
+
stride
];
}
}
...
...
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