Skip to content
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

Fix bfloat16_bits union so that it always the sizeof unsigned short for AIX. #4256

Merged
merged 3 commits into from
Oct 12, 2023

Conversation

ChipKerchner
Copy link
Contributor

@ChipKerchner ChipKerchner commented Oct 11, 2023

Fix bfloat16_bits union so that it always the sizeof unsigned short for AIX.

@ChipKerchner
Copy link
Contributor Author

Unless we packed the bfloat16_bits structure, it can be something besides the sizeof unsigned short (AKA 2). On AIX with OpenXLC, without this change the size is 4.

@ChipKerchner
Copy link
Contributor Author

Also ensure that the sizeof float32_bits is the sizeof float (AKA 4)

@martin-frbg
Copy link
Collaborator

I wonder how portable this attribute is ?

@RajalakshmiSR
Copy link

I wonder how portable this attribute is ?

This is is tested on powerpc Linux and AIX with gcc and Open XL C. We can protect this with ifdef AIX, if needed.

@martin-frbg
Copy link
Collaborator

Thanks. Either ifdef AIX or (I guess) ifndef MSVC would do then - bet Microsoft wants some #pragma here instead

@ChipKerchner ChipKerchner changed the title Fix bfloat16_bits union so that it always the sizeof unsigned short. Fix bfloat16_bits union so that it always the sizeof unsigned short for AIX. Oct 12, 2023
@martin-frbg martin-frbg added this to the 0.3.25 milestone Oct 12, 2023
@martin-frbg martin-frbg merged commit 425bcc1 into OpenMathLib:develop Oct 12, 2023
58 of 62 checks passed
@ChipKerchner ChipKerchner deleted the fixBfloat16BitsStruct branch August 1, 2024 20:01
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.

3 participants