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 SSE / AVX detection at runtime #13

Open
glesica opened this issue Nov 21, 2019 · 0 comments
Open

Add SSE / AVX detection at runtime #13

glesica opened this issue Nov 21, 2019 · 0 comments
Assignees

Comments

@glesica
Copy link
Collaborator

glesica commented Nov 21, 2019

The makefile should be smart enough not to try to build the software with SSE or AVX if it is unsupported. Eventually it might be nice to make this a runtime check, but this is a reasonable substitute and likely to be simpler.

We want to do the right thing at runtime depending on whether the CPU supports SSE or AVX. The code below (from Sarah) allows us to check, in theory:

if (__builtin_cpu_supports ("avx2")){
    //use avx2
    //TODO: maybe set a global bool as an avx flag?
}
else if (__builtin_cpu_supports ("ssse3")){
    //use ssse3
    //TODO: set bool?getBitsDNA
}
else {
    //TODO: use sse2 - bool?
}
@glesica glesica added this to the 1.0.0 Release milestone Nov 21, 2019
@glesica glesica changed the title Add SSE / AVX detection to makefile Add SSE / AVX detection at runtime Nov 21, 2019
@glesica glesica self-assigned this Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant