nnstreamer / nntrainer

NNtrainer is Software Framework for Training Neural Network Models on Devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Further optimization ideas (for faster calculation)

myungjoo opened this issue · comments

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;
}

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