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
1da2689b
"vscode:/vscode.git/clone" did not exist on "25d4afbc4513b12ebb615315fa1d36efd3efae38"
Commit
1da2689b
authored
Jun 21, 2019
by
Shucai Xiao
Browse files
clang format
parent
f2726514
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
src/targets/gpu/device/logsoftmax.cpp
src/targets/gpu/device/logsoftmax.cpp
+20
-16
No files found.
src/targets/gpu/device/logsoftmax.cpp
View file @
1da2689b
...
@@ -57,23 +57,26 @@ argument logsoftmax(hipStream_t stream,
...
@@ -57,23 +57,26 @@ argument logsoftmax(hipStream_t stream,
auto
size
=
(
item_num
>
block_size
)
?
block_size
:
item_num
;
auto
size
=
(
item_num
>
block_size
)
?
block_size
:
item_num
;
auto
stride
=
(
size
+
1
)
/
2
;
auto
stride
=
(
size
+
1
)
/
2
;
while
(
true
)
while
(
true
)
{
{
if
(
thr_idx
+
stride
<
size
)
if
(
thr_idx
+
stride
<
size
)
{
{
lds_data
[
thr_idx
]
=
lds_data
[
thr_idx
]
=
::
max
(
to_hip_type
(
lds_data
[
thr_idx
]),
::
max
(
to_hip_type
(
lds_data
[
thr_idx
]),
to_hip_type
(
lds_data
[
thr_idx
+
stride
]));
to_hip_type
(
lds_data
[
thr_idx
+
stride
]));
}
}
__syncthreads
();
__syncthreads
();
size
=
stride
;
size
=
stride
;
stride
=
(
stride
+
1
)
/
2
;
stride
=
(
stride
+
1
)
/
2
;
if
(
size
==
1
)
break
;
if
(
size
==
1
)
break
;
}
}
if
(
thr_idx
==
0
)
if
(
thr_idx
==
0
)
{
{
lds_data
[
block_size
]
=
(
lds_data
[
0
]
<
lds_data
[
block_size
])
?
lds_data
[
block_size
]
:
lds_data
[
0
];
lds_data
[
block_size
]
=
(
lds_data
[
0
]
<
lds_data
[
block_size
])
?
lds_data
[
block_size
]
:
lds_data
[
0
];
}
}
__syncthreads
();
__syncthreads
();
...
@@ -93,19 +96,20 @@ argument logsoftmax(hipStream_t stream,
...
@@ -93,19 +96,20 @@ argument logsoftmax(hipStream_t stream,
auto
size
=
(
item_num
>
block_size
)
?
block_size
:
item_num
;
auto
size
=
(
item_num
>
block_size
)
?
block_size
:
item_num
;
auto
stride
=
(
size
+
1
)
/
2
;
auto
stride
=
(
size
+
1
)
/
2
;
while
(
true
)
while
(
true
)
{
{
if
(
thr_idx
+
stride
<
size
)
if
(
thr_idx
+
stride
<
size
)
{
{
lds_data
[
thr_idx
]
+=
lds_data
[
thr_idx
+
stride
];
lds_data
[
thr_idx
]
+=
lds_data
[
thr_idx
+
stride
];
}
}
__syncthreads
();
__syncthreads
();
size
=
stride
;
size
=
stride
;
stride
=
(
stride
+
1
)
/
2
;
stride
=
(
stride
+
1
)
/
2
;
if
(
size
==
1
)
break
;
if
(
size
==
1
)
break
;
}
}
if
(
thr_idx
==
0
)
if
(
thr_idx
==
0
)
{
{
lds_data
[
block_size1
]
+=
lds_data
[
0
];
lds_data
[
block_size1
]
+=
lds_data
[
0
];
}
}
...
...
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