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

Further optimization ideas (for faster calculation) #2485

Open
myungjoo opened this issue Feb 23, 2024 · 1 comment
Open

Further optimization ideas (for faster calculation) #2485

myungjoo opened this issue Feb 23, 2024 · 1 comment

Comments

@myungjoo
Copy link
Member

myungjoo commented Feb 23, 2024

This is to throw some ideas after the immenent release.

  1. add -ffast-math compiler option
  2. try SIMD-STL.
  3. Writing SIMD code in C++ STD (not so sure about its portability)
#include <iostream>
#include <experimental/simd>

using intV = std::experimental::fixed_size_simd<int, 8>;
using floatV = std::experimental::fixed_size_simd<float, 11>;


int main()
{
    int ia[] = {3, 1, -14, 1, 5, 9, -14, 9};
    float fa[] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0};
    intV iv {[ia](const auto i) { return ia[i]; }};
    floatV fv {[fa](const auto i) { return fa[i]; }};

    iv += 100;
    fv += 10.0f;

    std::cout<<iv[0]<<std::endl;
    std::cout<<fv[0]<<std::endl;
}
@taos-ci
Copy link
Collaborator

taos-ci commented Feb 23, 2024

:octocat: cibot: Thank you for posting issue #2485. The person in charge will reply soon.

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

2 participants