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
12a79223
"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "27c0fe358d6159ec3011f976a92d9f70a7fa26a4"
Commit
12a79223
authored
May 23, 2019
by
Khalique
Browse files
formatting
parent
2ebb3515
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
src/targets/gpu/device/softmax.cpp
src/targets/gpu/device/softmax.cpp
+7
-8
src/targets/gpu/include/migraphx/gpu/device/softmax.hpp
src/targets/gpu/include/migraphx/gpu/device/softmax.hpp
+3
-3
src/targets/gpu/softmax.cpp
src/targets/gpu/softmax.cpp
+2
-2
No files found.
src/targets/gpu/device/softmax.cpp
View file @
12a79223
...
...
@@ -13,9 +13,9 @@ namespace gpu {
namespace
device
{
argument
softmax
(
hipStream_t
stream
,
const
migraphx
::
shape
&
output_shape
,
std
::
vector
<
migraphx
::
argument
>
args
,
int
axis
)
const
migraphx
::
shape
&
output_shape
,
std
::
vector
<
migraphx
::
argument
>
args
,
int
axis
)
{
auto
lens
=
output_shape
.
lens
();
std
::
size_t
batch_size
=
std
::
accumulate
(
...
...
@@ -35,17 +35,17 @@ argument softmax(hipStream_t stream,
auto
batch_max
=
input_ptr
[
row_start
];
for
(
std
::
size_t
j
=
0
;
j
<
n_dims
;
++
j
)
{
auto
ind
=
row_start
+
j
;
auto
ind
=
row_start
+
j
;
auto
hip_type_input
=
to_hip_type
(
input_ptr
[
ind
]);
batch_max
=
std
::
max
(
to_hip_type
(
batch_max
),
hip_type_input
);
output_ptr
[
ind
]
=
::
exp
(
hip_type_input
);
batch_max
=
std
::
max
(
to_hip_type
(
batch_max
),
hip_type_input
);
output_ptr
[
ind
]
=
::
exp
(
hip_type_input
);
}
auto
batch_sum
=
output_ptr
[
row_start
];
for
(
std
::
size_t
j
=
1
;
j
<
n_dims
;
++
j
)
{
auto
ind
=
row_start
+
j
;
batch_sum
+=
output_ptr
[
ind
];
batch_sum
+=
output_ptr
[
ind
];
}
for
(
std
::
size_t
j
=
0
;
j
<
n_dims
;
++
j
)
...
...
@@ -59,7 +59,6 @@ argument softmax(hipStream_t stream,
return
args
.
back
();
}
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
...
...
src/targets/gpu/include/migraphx/gpu/device/softmax.hpp
View file @
12a79223
...
...
@@ -11,9 +11,9 @@ namespace gpu {
namespace
device
{
argument
softmax
(
hipStream_t
stream
,
const
migraphx
::
shape
&
output_shape
,
std
::
vector
<
migraphx
::
argument
>
args
,
int
axis
);
const
migraphx
::
shape
&
output_shape
,
std
::
vector
<
migraphx
::
argument
>
args
,
int
axis
);
}
// namespace device
}
// namespace gpu
...
...
src/targets/gpu/softmax.cpp
View file @
12a79223
...
...
@@ -12,8 +12,8 @@ shape hip_softmax::compute_shape(const std::vector<shape>& inputs) const
}
argument
hip_softmax
::
compute
(
context
&
ctx
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
{
return
device
::
softmax
(
ctx
.
get_stream
().
get
(),
output_shape
,
args
,
1
);
}
...
...
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