Skip to content

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
@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