-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor thrust::complex
as a struct derived from cuda::std::complex
#454
Conversation
There are some notable differences though. thrust::complex has been a bit more lenient when determining the type of arithmetic operations. That said, I believe being more strict is actually a feature not a bug
This commit refactors the thrust::complex type to be a struct derived from cuda::std::complex, enabling reuse of existing implementation logic. However, to maintain backward compatibility, certain operators are reintroduced to allow type promotion between 'float' and 'double' for the underlying type.
/ok to test |
/ok to test |
So this is failing because I removed the long double overloads that are actually removed and static asserted that we should never use them. I believe we should also remove that test |
/ok to test |
/ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome 🎉
Thanks a lot for putting all the work in and improving our complex implementation.
Given that I had some part in writing some of the code I would want a second maintainers eyes before we merge though
@@ -1191,6 +1188,7 @@ arg(const complex<_Tp>& __c) | |||
return _CUDA_VSTD::atan2(__c.imag(), __c.real()); | |||
} | |||
|
|||
#ifdef _LIBCUDACXX_HAS_COMPLEX_LONG_DOUBLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@griwes This was preexisting in libcu++
I consider this a preexisting bug. Do you have any objections in disabling long double
when it is not defined?
/ok to test |
The complex files were under an old apache license we should clean the new files up given that we completely reimplemented it |
/ok to test |
…d::complex` (#454)" (#1286) Co-authored-by: Jake Hemstad <[email protected]>
…d::complex` (NVIDIA#454)" (NVIDIA#1286) We did not have any time to work on fixing the numerical issues with `cuda::std::complex` so punt on it for 2.4.x Co-authored-by: Jake Hemstad <[email protected]>
…d::complex` (NVIDIA#454)" This reverts commit 1f6e4bc. We face numerical issues with our cuda::std::complex implementation but did not have the capacity to work on it
…d::complex` (NVIDIA#454)" This reverts commit 1f6e4bc. We face numerical issues with our cuda::std::complex implementation but did not have the capacity to work on it
This commit refactors the thrust::complex type to be a struct derived
from
cuda::std::complex
, enabling reuse of existing implementationlogic. However, to maintain backward compatibility, certain
operators are reintroduced to allow type promotion between
float
and
double
for the underlying type.This PR is derived from #260 and has been rebased onto the current main branch
Checklist