Repository navigation
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 |
miscco
left a comment
There was a problem hiding this comment.
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
| return _CUDA_VSTD::atan2(__c.imag(), __c.real()); | ||
| } | ||
|
|
||
| #ifdef _LIBCUDACXX_HAS_COMPLEX_LONG_DOUBLE |
There was a problem hiding this comment.
@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
floatand
doublefor the underlying type.This PR is derived from #260 and has been rebased onto the current main branch
Checklist