FS#63227 - [gcc] Add offloading support in GCC
Attached to Project:
Arch Linux
Opened by Anonymous (reallybmn) - Thursday, 18 July 2019, 23:46 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:23 GMT
Opened by Anonymous (reallybmn) - Thursday, 18 July 2019, 23:46 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:23 GMT
|
Details
Description:
GCC can offload C, C++, and Fortran code to an accelerator when using OpenACC or OpenMP where the code to offload is controlled by adding #pragma statements. How to build gcc for offloading is described in https://gcc.gnu.org/wiki/Offloading https://kristerw.blogspot.com/2017/04/building-gcc-with-support-for-nvidia.html This feature has been implemented in Debian and Ubuntu: https://packages.debian.org/sid/gcc-9-offload-nvptx |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:23 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/gcc/issues/2
Saturday, 25 November 2023, 20:23 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/gcc/issues/2
--enable-offload-targets=nvptx-none --without-cuda-driver
to configure should be enough for the host.
Notice that all offload compilers are optional and no extra dependency is needed for the main gcc package. GCC will work just as before if no offload compilers are installed.
If --enable-offload-targets simply tells gcc that it's allowed to look and see if an offload compiler exists then it seems like it would be reasonable to add this even if we don't package the offload compilers themselves.
On my side, I need only Nvidia PTX targets, but Intel MIC could also be provided using a similar recipe.
You need to provide target names. This is a list that will never satisfy everyone. We should not include it.
Even if we wanted to enable all the possible targets, there is only 3 targets available now (Nvidia PTX targets, AMD HSAIL and MIC). In a foreseeable future, the only addition will be AMD GCN. Even then, it is not a very long list that could potentially trigger a lot of requests.
The main use case is by far Nvidia PTX, this is the reason why Debian enabled only this one.
https://src.fedoraproject.org/rpms/gcc/blob/master/f/gcc.spec
There is a new dependency on nvptx-tools, which provide tools equivalent to binutils for the nvptx target.
Instructions for creating the nvptx-newlib tarball are in comments.