-1

I need hardware support (it might be FPGA) at compile time to speed up compile-time computations. To be more specific compile-time training of a neural network. This might use OpenCL to greatly speed up compilation.

Would a compiler provide such an ability?

The best would be ability to call custom dynamic library function at compile-time.

I prefer C++. I see LLVM is moving forward pretty fast.

Does it provide something similar to enable it in Clang?

Sergei Krivonos
  • 4,217
  • 3
  • 39
  • 54
  • 3
    Never heard of anything like that. Could precomputing the data work for your use case? – Vittorio Romeo Feb 27 '17 at 11:21
  • [What are ways of improving build/compile time?](http://stackoverflow.com/q/1539347/995714), [What techniques can be used to speed up C++ compilation times?](http://stackoverflow.com/q/373142/995714) – phuclv Feb 27 '17 at 11:24
  • 3
    You should explain what actual *compile-time computations* you need to speedup. Perhaps show some code. And certainly you should **edit your question** to improve it (probably by adding several paragraphs motivating your question). – Basile Starynkevitch Feb 27 '17 at 11:25
  • Sergei, please edit your question to improve it and motivate it. – Basile Starynkevitch Feb 27 '17 at 15:14

1 Answers1

3

I need hardware support (it might be FPGA) at compile time to speed up compile-time computations.

Compile-time computations are generally not that intensive. (and it is a quality of implementation issue). So it is unlikely you'll find that.

Perhaps you can use plugins for your compiler (e.g. plugins in C++ for GCC, or extensions using GCC MELT, or plugins in C++ for Clang), and add for example extra compiler builtins thru them.

Or simply, generate some C or C++ code thru some external tool.

(maybe you are looking for hardware support in your compiler to speed up the run time of your compiled program, so you want a compiler able to take advantage of your hardware for the generated code, but that is a very different question)

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547