Replies: 0 comments 6 replies
-
@griwes @wmaxey @gonzalobg @brycelelbach Can any of you shine some light on this? |
Beta Was this translation helpful? Give feedback.
-
This implementation appears to be inherited from the C99 Standard Annex G Given that the C++ Standard does not implicitly inherit everything from the C Standard and https://eel.is/c++draft/complex.numbers#general-3 makes no mention of any requirement about anything like this, I am convinced that we can remove this from our implementation and remain conforming to the C++ Standard. |
Beta Was this translation helpful? Give feedback.
-
Ran a quick experiment where I modified 11.5 libcu++. Modifications were to fix double cast and comment out isnan checks. This data indicates the isnan checks are still very expensive on performance. 65us vs 110us. The benchmark is found here: https://github.com/NVIDIA/MatX/blob/main/bench/00_transform/conv.cu A100 isnan checks, double fix
A100 NO isnan checks, double fix
|
Beta Was this translation helpful? Give feedback.
-
I am wary of changing the current implementation because of non subtle runtime differences it would introduce. Those would only happen in a denormal case but still could potentially silently break user code. Given that the chance of breaking something is rather slim and users might prefer the performance I would propose to add a feature macro that removes the sanitation of denormals. Something in the direction Obviously I would like to tackle this in #338 |
Beta Was this translation helpful? Give feedback.
-
#338 because editing a comment does not link the issue / PR |
Beta Was this translation helpful? Give feedback.
-
The
operator*(cuda::std::complex<T>, cuda::std::complex<T>)
does anisnan
check on the resulting real and imaginary parts of the operation before returning the resultingcomplex<T>
.Is this required by the C++ Standard?
At first glance, it would seem this is not required:
https://eel.is/c++draft/complex.numbers#general-3
If it is not required, can we remove these checks?
Beta Was this translation helpful? Give feedback.
All reactions