https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81377
Bug ID: 81377 Summary: [nvptx] Add possibility for libgomp nvptx plugin to use ptxas Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- An openacc executable contains ptx code, and uses the libgomp plugin to: - compile the code using the JIT compiler into a cubin module - load the cubin module - execute one or more kernels in the cubin module [ Context: There is a number of patches pending ( https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00167.html ) which add environment variables to control this process: - GOMP_NVPTX_PTXRW=w: Write the embedded ptx to files - GOMP_NVPTX_PTXRW=r: Ignore the embedded ptx, and read from files instead - GOMP_NVPTX_JIT: Add opions to JIT command line - GOMP_NVPTX_SAVE_TEMPS: save the generated cubin module to file - GOMP_NVPTX_DISASM: disassemble the generated cubin module to stdout ] Instead of using the JIT compiler, we could use ptxas instead. That way, we can see if a JIT bug also reproduces with ptxas. Furthermore, it's easier to try out multiple versions of ptxas, since we don't have to install another driver version. We could redefine GOMP_NVPTX_SAVE_TEMPS into GOMP_NVPTX_CUBINRW=w, then add GOMP_NVPTX_CUBINRW=r and do: - GOMP_NVPTX_PTRXRW=w - call ptxas to produce cubin - GOMP_NVPTX_CUBINRW=r But it would be easier from user perspective to add handling of a variable GOMP_NVPTX_PTXAS, f.i. set to "/usr/local/cuda-8.0/bin/ptxas --return-at-end -O2".