Code Monkey home page Code Monkey logo

Comments (5)

victorshoup avatar victorshoup commented on July 22, 2024

from ntl.

orlitzky avatar orlitzky commented on July 22, 2024

I know that it would be annoying to implement, but for the sake of argument, a perfect solution for us would be to have build flags that allow the user to override the detection of each CPU feature. The correct flag values could then be determined by looking at the CPUID, as in https://github.com/projg2/cpuid2cpuflags/, and specified by the user -- relieving NTL of the responsibility to detect them.

So, for example, a new flag:

FMA=on|off|auto (default: auto)

If I don't specify it, the default (auto) would continue to work as it does now. But if I know that my CPU has FMA support and if NTL can't detect it (due to missing CXXFLAGS=-march or some other reason), then I could pass FMA=on to DoConfig.

I think that would work in most cases, but some refactoring would be required in any tests that check not only for the CPU feature, but also some additional stuff. Here I have AVX2 in mind, which checks not only for AVX2 support in the CPU, but also the size of int/long and the FP precision.

from ntl.

victorshoup avatar victorshoup commented on July 22, 2024

from ntl.

orlitzky avatar orlitzky commented on July 22, 2024

You're right. I thought there were fallbacks for the builtins but it's not for all of them. My CPUs are too old to test most but e.g. PCLMUL does fail without the right compiler flags.

I'll close this now since the description is misleading. But in light of that, my one remaining suggestion would be to have NTL_ENABLE_AVX_FFT=on ignored when the corresponding CPU features are unavailable. Right now, the build fails if NTL_ENABLE_AVX_FFT=on but NTL doesn't like the CPU, making it hard for us to determine if it's safe to turn such a feature on.

Thanks for clarifying.

from ntl.

victorshoup avatar victorshoup commented on July 22, 2024

from ntl.

Related Issues (17)

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.