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

Add detection of function multi-versioning in the compiler #234

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

bmerry
Copy link
Contributor

@bmerry bmerry commented Aug 7, 2023

This support is used so that the SSE2 version of memcpy_nontemporal is selected only if the CPU supports SSE2 at runtime.

On x86-64 there is guaranteed to be runtime support, so this only affects i386. Note that i386 is not currently tested. The real motivation is that it lays the groundwork for adding more specialised variants e.g. AVX, AVX-512, MOVDIR64B etc.

This support is used so that the SSE2 version of memcpy_nontemporal is
selected only if the CPU supports SSE2 at runtime.

On x86-64 there is guaranteed to be runtime support, so this only
affects i386. Note that i386 is not currently tested. The real
motivation is that it lays the groundwork for adding more specialised
variants e.g. AVX, AVX-512, MOVDIR64B etc.
@bmerry
Copy link
Contributor Author

bmerry commented Aug 7, 2023

@james-smith-za I think hold off the reviewing for now - it's going to need some tweaks to make it play nice with MacOS's universal binaries.

@james-smith-za
Copy link
Contributor

@james-smith-za I think hold off the reviewing for now - it's going to need some tweaks to make it play nice with MacOS's universal binaries.

Why we are bothering to support macOS is still beyond me...

Does the Apple silicon even support SSE2?

@bmerry
Copy link
Contributor Author

bmerry commented Aug 7, 2023

Why we are bothering to support macOS is still beyond me...

Some applications that use spead2 are developed by people who have Macs (like @ludwigschwardt).

Does the Apple silicon even support SSE2?

It doesn't. But the Python builder tries to build universal binaries that have code for both x86-64 and ARM64, which confuses things.

Never use it on non-x86 architectures. This is a workaround for MacOS
universal binary Python builds, where detection happens on x86 but the
ARM branch of the build fails because it's not supported there.
@bmerry
Copy link
Contributor Author

bmerry commented Aug 7, 2023

@james-smith-za looks like I've got the MacOS support fixed.

@rtobar
Copy link
Contributor

rtobar commented Aug 7, 2023

Why we are bothering to support macOS is still beyond me...

Some applications that use spead2 are developed by people who have Macs (like @ludwigschwardt).

To further support this point: in SKA there are several developers that use Macs and either indirectly use spead2, or actually develop applications on top of it.

@bmerry bmerry merged commit 5cde973 into master Aug 7, 2023
21 of 22 checks passed
@bmerry bmerry deleted the runtime-cpu-features branch August 7, 2023 19:15
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.

None yet

3 participants