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
644e42a8
Commit
644e42a8
authored
Nov 19, 2018
by
Paul
Browse files
Workaround broken math functions newer hip
parent
952649c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
src/targets/gpu/device/include/migraphx/gpu/device/types.hpp
src/targets/gpu/device/include/migraphx/gpu/device/types.hpp
+12
-0
src/targets/gpu/device/sin.cpp
src/targets/gpu/device/sin.cpp
+1
-1
No files found.
src/targets/gpu/device/include/migraphx/gpu/device/types.hpp
View file @
644e42a8
...
@@ -75,6 +75,18 @@ device_type<T>* device_cast(T* x)
...
@@ -75,6 +75,18 @@ device_type<T>* device_cast(T* x)
return
reinterpret_cast
<
device_type
<
T
>*>
(
x
);
return
reinterpret_cast
<
device_type
<
T
>*>
(
x
);
}
}
template
<
class
T
>
T
to_hip_type
(
T
x
)
{
return
x
;
}
// Hip doens't support __fp16
inline
float
to_hip_type
(
gpu_half
x
)
{
return
x
;
}
}
// namespace device
}
// namespace device
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH_INLINE_NS
...
...
src/targets/gpu/device/sin.cpp
View file @
644e42a8
...
@@ -9,7 +9,7 @@ namespace device {
...
@@ -9,7 +9,7 @@ namespace device {
void
sin
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg
)
void
sin
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg
)
{
{
nary
(
stream
,
result
,
arg
)([](
auto
x
)
{
return
::
sin
(
x
);
});
nary
(
stream
,
result
,
arg
)([](
auto
x
)
{
return
::
sin
(
to_hip_type
(
x
)
);
});
}
}
}
// namespace device
}
// namespace device
...
...
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