Search code examples
gccgpumingwopenmpnvidia

Can the GCC compiler use nVidia GPU to speed up compilation and/or linking?


I'm looking at GCC with NVPTX offloading (specifically on Windows/MinGW-w64), and I was wondering if GCC itself can take advantage of this, so it has more processing power to do faster compiling/linking?

Or does this question make little sense as these processes are not mathematical enough in nature?

There's also the fact that GCC has some dependencies that are mathematical in nature (mpfr, gmp, mpc, isl), so maybe they can take advantage of offloading to make GCC faster using GPU?


Solution

  • "Can ...?" : No, it can't; otherwise it would be in the manual :-)

    "Could ... ?": probably not; compilation is mostly walking over data-structures, not performing parallel arithmetic operations, and is not obviously parallel other than at a very high level. One pass requires the state which was created by a previous pass, so there is a strict ordering and you can't easily execute more than one pass in parallel. (Each pass is updating a single representation of the code).

    The current approach is to use make -j8 or similar to compile multiple files simultaneously, but even there you are unlikely to have anywhere near enough parallelism to keep a GPU busy.