Skip to content

Conversation

@jzmaddock
Copy link
Collaborator

Also adds better error checking.
Fixes #1348

Also adds better error checking.
Fixes #1348
Comment on lines 363 to +366
// PowerPC extended double precision format (128 bits)

static_assert(LDBL_MANT_DIG == 113, "Oops, assumption that long double is a 128-bit quantity is incorrect!!");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the PowerPC case should we check both 106 and 113 for LDBL_MANT_DIG? I assume the original code is old enough that 106 was the only option at the time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in the same branch, everything has to go to the correct #if branch otherwise we don't get the correct bits.

@jzmaddock
Copy link
Collaborator Author

@mborland I can't seem to get CUDA/SYCL correct: am I correct in thinking that long double is 64 bit on the device and 80-bit on the host? If so is there a good way to configure that?

@mborland
Copy link
Member

@mborland I can't seem to get CUDA/SYCL correct: am I correct in thinking that long double is 64 bit on the device and 80-bit on the host?

That is correct.

If so is there a good way to configure that?

I think we'd need to have one set of functions marked host and one set marked device and then let the compiler pick the right one. I'm out of town for the long weekend (MLK day), but I can add those on Tuesday if you'd like.

@jzmaddock
Copy link
Collaborator Author

I think we'd need to have one set of functions marked host and one set marked device and then let the compiler pick the right one. I'm out of town for the long weekend (MLK day), but I can add those on Tuesday if you'd like.

Hmm, I suspect that since the functions aren't dependent on any template parameter, the static_assert will be triggered irrespective of whether the function is called or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix for buffer overflow in fp_traits.hpp on aarch64 / mingw

3 participants