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
41c6d737
Commit
41c6d737
authored
Jun 27, 2019
by
Shucai Xiao
Browse files
clang format
parent
2e7398f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
src/targets/gpu/device/argmax.cpp
src/targets/gpu/device/argmax.cpp
+7
-2
src/targets/gpu/device/argmin.cpp
src/targets/gpu/device/argmin.cpp
+7
-2
src/targets/gpu/include/migraphx/gpu/device/reduce_opers.hpp
src/targets/gpu/include/migraphx/gpu/device/reduce_opers.hpp
+4
-3
No files found.
src/targets/gpu/device/argmax.cpp
View file @
41c6d737
...
@@ -58,8 +58,13 @@ void argmax(hipStream_t stream, const argument& result, const argument& arg, int
...
@@ -58,8 +58,13 @@ void argmax(hipStream_t stream, const argument& result, const argument& arg, int
__syncthreads
();
__syncthreads
();
auto
item_num
=
(
remaining_item_num
>
block_size
)
?
block_size
:
remaining_item_num
;
auto
item_num
=
(
remaining_item_num
>
block_size
)
?
block_size
:
remaining_item_num
;
block_reduce_pair
<
type
,
pair_max_op
<
type
,
int64_t
>>
(
lds_data
,
lds_index
,
pair_max_op
<
type
,
int64_t
>
{},
block_reduce_pair
<
type
,
pair_max_op
<
type
,
int64_t
>>
(
lds_data
,
block_size
,
thr_idx
,
item_num
,
max_block_size
);
lds_index
,
pair_max_op
<
type
,
int64_t
>
{},
block_size
,
thr_idx
,
item_num
,
max_block_size
);
remaining_item_num
-=
block_size
;
remaining_item_num
-=
block_size
;
}
}
...
...
src/targets/gpu/device/argmin.cpp
View file @
41c6d737
...
@@ -58,8 +58,13 @@ void argmin(hipStream_t stream, const argument& result, const argument& arg, int
...
@@ -58,8 +58,13 @@ void argmin(hipStream_t stream, const argument& result, const argument& arg, int
__syncthreads
();
__syncthreads
();
auto
item_num
=
(
remaining_item_num
>
block_size
)
?
block_size
:
remaining_item_num
;
auto
item_num
=
(
remaining_item_num
>
block_size
)
?
block_size
:
remaining_item_num
;
block_reduce_pair
<
type
,
pair_min_op
<
type
,
int64_t
>>
(
lds_data
,
lds_index
,
pair_min_op
<
type
,
int64_t
>
{},
block_reduce_pair
<
type
,
pair_min_op
<
type
,
int64_t
>>
(
lds_data
,
block_size
,
thr_idx
,
item_num
,
max_block_size
);
lds_index
,
pair_min_op
<
type
,
int64_t
>
{},
block_size
,
thr_idx
,
item_num
,
max_block_size
);
remaining_item_num
-=
block_size
;
remaining_item_num
-=
block_size
;
}
}
...
...
src/targets/gpu/include/migraphx/gpu/device/reduce_opers.hpp
View file @
41c6d737
...
@@ -66,10 +66,11 @@ struct pair_max_op
...
@@ -66,10 +66,11 @@ struct pair_max_op
using
type
=
std
::
pair
<
T
,
F
>
;
using
type
=
std
::
pair
<
T
,
F
>
;
// This implementation is to ensure when multiple values
// This implementation is to ensure when multiple values
// are of max, the min index is returned
// are of max, the min index is returned
type
operator
()(
type
x
,
type
y
)
const
{
type
operator
()(
type
x
,
type
y
)
const
if
(
x
.
first
>
y
.
first
)
{
if
(
x
.
first
>
y
.
first
)
return
x
;
return
x
;
else
if
(
x
.
first
<
y
.
first
)
else
if
(
x
.
first
<
y
.
first
)
return
y
;
return
y
;
else
else
{
{
...
...
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