Commit 644e42a8 authored by Paul's avatar Paul
Browse files

Workaround broken math functions newer hip

parent 952649c1
...@@ -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
......
...@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment