Coder Social home page Coder Social logo

SIMD abstraction layers about flint HOT 5 CLOSED

edgarcosta avatar edgarcosta commented on July 18, 2024
SIMD abstraction layers

from flint.

Comments (5)

albinahlback avatar albinahlback commented on July 18, 2024

For most cases, compiler hints should be enough to generate close-to-optimal code utilizing SIMD. Say, nmod_vec_add or something. The important part is here that one compiles FLINT with the correct compiler flags to generate this.

For these "trivial" cases, it is my belief that we do not want to generate code that resembles some other architecture. For instance, say you want to utilize some AVX512 instruction for systems that has AVX512 instructions, but the system you only have register width of 128 bits (such as ARM NEON), you effectively unroll every instruction four times, which I think is something that we would like to avoid.

For cases where an algorithm's speed is highly dependent on the use of specific instruction sets/throughput/latency/number of ports in a CPU/whatever, I don't think this is very useful.

Moreover, I believe it would just reduce the readability of the code, and it may also introduce unwanted unrollings of loops on some architectures.

from flint.

edgarcosta avatar edgarcosta commented on July 18, 2024

Thanks for the explanation!

I will close the issue, given that you are the one writing most of the lower-level code.

from flint.

albinahlback avatar albinahlback commented on July 18, 2024

I wouldn't rule out any abstraction layers, but I would consider writing our own in that case so that we know exactly what is going on under the hood. However, thanks for bringing this to my attention, didn't know this existed.

from flint.

fredrik-johansson avatar fredrik-johansson commented on July 18, 2024

machine_vectors.h is a decent start, no?

from flint.

albinahlback avatar albinahlback commented on July 18, 2024

Indeed.

from flint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.