[ was: Re: [PATCH, 0/4] Handle GOMP_OPENACC_NVPTX_{DISASM,SAVE_TEMPS,JIT} in libgomp nvptx plugin ] On 06/26/2017 01:24 PM, Tom de Vries wrote: > Hi, > > I've written a patch series to facilitate debugging libgomp openacc > testcase failures on the nvptx accelerator. > > > When running an openacc test-case on an nvptx accelerator, the following > happens: > - the plugin obtains the ptx assembly for the acceleration kernels > - it calls the cuda jit to compile and link the ptx into a module > - it loads the module > - it starts an acceleration kernel A typical scenario when developing the compiler is: - run gcc test.c -save-temps - run a.out - edit test.s to fix bug or make code faster or smaller - run gcc test.s - run a.out - edit compiler sources to make the compiler do the same as the .s edit With openacc test-cases, this scenario is currently not available for ptx assembly. Using -save-temps -foffload=-save-temps we can get a .s containing ptx. But to insert the edited .s back into the compilation flow is difficult. This patch facilitates such a scenario in the nvptx plugin. - we define GOMP_OPENACC_NVPTX_PTXRW == 'w', and the plugin writes the ptx assembly into a series of files - we edit one of those files - we define GOMP_OPENACC_NVPTX_PTXRW == 'r', and the plugin reads the ptx assembly back from those files, and uses that instead of the ptx in the executable. I've tested this patch series on top of gomp-4_0-branch, by running an openacc testcase from the command line and going through the write-edit-readscenario with an observable ptx edit. OK for trunk if bootstrap and reg-test on x86_64 with nvidia accelerator succeeds? Thanks, - Tom