Unverified Commit ba07b221 authored by Aaron Enye Shi's avatar Aaron Enye Shi Committed by GitHub
Browse files

Fix HIP-Clang GPU build issues (#384)



* Fix HIP-Clang GPU build issues

Add missing device attributes for GPU functions. GPU functions must be annotated with __device__ in HIP.

* Use HIP device function max and min

* Fix clang-format-5.0 issues

* Undo change that breaks on HIP-HCC
Co-authored-by: default avatarmvermeulen <5479696+mvermeulen@users.noreply.github.com>
parent a023ec19
......@@ -9,7 +9,7 @@ namespace device {
void sqrt(hipStream_t stream, const argument& result, const argument& arg)
{
nary(stream, result, arg)([](auto x) { return ::sqrt(to_hip_type(x)); });
nary(stream, result, arg)([](auto x) __device__ { return ::sqrt(to_hip_type(x)); });
}
} // namespace device
......
......@@ -8,7 +8,7 @@ namespace device {
void sub(hipStream_t stream, const argument& result, const argument& arg1, const argument& arg2)
{
nary(stream, result, arg1, arg2)([](auto x, auto y) { return x - y; });
nary(stream, result, arg1, arg2)([](auto x, auto y) __device__ { return x - y; });
}
} // namespace device
......
......@@ -9,7 +9,7 @@ namespace device {
void tan(hipStream_t stream, const argument& result, const argument& arg)
{
nary(stream, result, arg)([](auto x) { return ::tan(to_hip_type(x)); });
nary(stream, result, arg)([](auto x) __device__ { return ::tan(to_hip_type(x)); });
}
} // namespace device
......
......@@ -9,7 +9,7 @@ namespace device {
void tanh(hipStream_t stream, const argument& result, const argument& arg)
{
nary(stream, result, arg)([](auto x) { return ::tanh(to_hip_type(x)); });
nary(stream, result, arg)([](auto x) __device__ { return ::tanh(to_hip_type(x)); });
}
} // 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