[gomp4] Extend libgomp's fortran test coverage of host_data

Cesar Philippidis cesar@codesourcery.com
Fri Aug 12 19:39:00 GMT 2016


On 08/11/2016 03:38 PM, Cesar Philippidis wrote:
> This patch ports libgomp.oacc-c-c++-common/host_data-1.c to fortran.
> Fortunately, the existing fortran host_data infrastructure was already
> in place, so I had to do was port over the calls to Nvidia's CUDA BLAS
> library.
> 
> There are a couple of details that one needs to consider when using CUDA
> BLAS in gfortran. First, if you want to use Nvidia's wrapper functions
> written in C to set up the appropriate cuda device contexts, then use
> the thunking variants of the functions described here
> <http://docs.nvidia.com/cuda/cublas/#appendix-b-cublas-fortran-bindings>.
> Otherwise, it's much easier to let gfortran's OpenACC runtime manage the
> data mappings and use the host_data clause to pass those data pointers
> to the CUDA BLAS library calls.
> 
> In terms of calling the actual CUDA BLAS functions, there's already good
> documentation for that here
> <https://gcc.gnu.org/onlinedocs/gfortran/Interoperability-with-C.html>.
> Basically, those library calls need a function interface with a special
> C binding. The function I tested in host_data-2.f90 is cublasSaxpy.
> Other function interfaces will need to be created as necessary.
> 
> I've applied this patch to gomp-4_0-branch.

I've added some additional test coverage in this patch. Specifically,
I've included both a module and fixed-mode test. I also corrected some
problems when host_data-2.f90 and host_data-1.c are built with -Wall
-Wextra.

This patch has been applied to gomp-4_0-branch.

Cesar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gomp4-more-host_data-tests.diff
Type: text/x-patch
Size: 11214 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160812/74dfeedb/attachment.bin>


More information about the Gcc-patches mailing list