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

Dramatically improve performance of CPU kernels on less sophisticated compilers #78

Merged
merged 6 commits into from
Jan 19, 2022

Conversation

zpzim
Copy link
Owner

@zpzim zpzim commented Jan 18, 2022

This PR does a couple of things:

  1. Significantly increases the chance that a compiler will be able to autovectorize the inner loops of SCAMP
  2. Adds compiler output for popular compilers (MSVC/clang/gcc) indicating which loops from the kernel were vectorized
  3. Only handles NaNs in the CPU kernel when needed, as processing the nans can cause signifigant slowdown on less sophisticated compilers (MSVC)

Overall CPU performance in situations where these benefits were not already observed is 2-4x. Further optimization may be possible (e.g. explicitly enabling AVX code generation on MSVC on platforms that support it).

Platform specific optimizations are also possible on MSVC, as it does not support -march=native which we use everywhere else. Enabling AVX on MSVC

@zpzim zpzim merged commit 0f8c54a into master Jan 19, 2022
@zpzim zpzim deleted the cpu-kernel-performance branch February 12, 2022 22:45
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.

1 participant