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
fd491ac1
Commit
fd491ac1
authored
Jun 18, 2019
by
Khalique
Browse files
bugs in device pad
parent
877b8c44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
src/targets/gpu/device/pad.cpp
src/targets/gpu/device/pad.cpp
+17
-10
No files found.
src/targets/gpu/device/pad.cpp
View file @
fd491ac1
...
...
@@ -17,21 +17,28 @@ pad(hipStream_t stream, argument result, argument arg1, float value, std::vector
std
::
size_t
nelements
=
arg1
.
get_shape
().
elements
();
if
(
float_equal
(
value
,
std
::
numeric_limits
<
float
>::
lowest
()))
{
visit_all
(
result
)([
&
](
auto
output
)
{
auto
*
outptr
=
device_cast
(
output
.
data
());
auto
val
=
device_cast
(
std
::
numeric_limits
<
typename
decltype
(
output
)
::
value_type
>::
lowest
());
auto
val
=
device_cast
(
std
::
numeric_limits
<
decltype
(
value
)
>::
lowest
());
nary
(
stream
,
result
)([
=
]
{
return
val
;
});
// visit_all(result)([&](auto output) {
// auto* outptr = device_cast(output.data());
// auto val =
// device_cast(std::numeric_limits<typename decltype(output)::value_type>::lowest());
gs_launch
(
stream
,
nelements
)([
=
](
auto
i
)
{
outptr
[
i
]
=
val
;
});
});
//
gs_launch(stream, nelements)([=](auto i) { outptr[i] = val; });
//
});
}
else
{
visit_all
(
result
)([
&
](
auto
output
)
{
auto
*
outptr
=
device_cast
(
output
.
data
());
gs_launch
(
stream
,
nelements
)([
=
](
auto
i
)
{
outptr
[
i
]
=
value
;
});
});
// visit_all(result)([&](auto output) {
// auto* outptr = device_cast(output.data());
// auto val =
// device_cast(value);
// gs_launch(stream, nelements)([=](auto i) { outptr[i] = val; });
// });'
auto
val
=
device_cast
(
value
);
nary
(
stream
,
result
)([
=
]
{
return
val
;
});
}
// nary(stream, result)([=] { return value; });
...
...
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