mirror of
https://github.com/sfilippone/amg4psblas.git
synced 2026-10-06 22:55:12 +00:00
New GPU example
This commit is contained in:
@@ -422,24 +422,21 @@ call P%build(A,desc_A,info)
|
||||
The code discussed here shows how to set up a
|
||||
program exploiting the combined GPU capabilities of PSBLAS and
|
||||
AMG4PSBLAS. The code example is available in the source distribution
|
||||
directory \verb|amg4psblas/tests/gpu|.
|
||||
directory \verb|amg4psblas/examples/gpu|.
|
||||
|
||||
First of all, we need to include the appropriate modules and
|
||||
declare some auxiliary variables:
|
||||
\begin{listing}[h!]
|
||||
\ifpdf
|
||||
\begin{minted}[breaklines=true,bgcolor=bg,fontsize=\small]{fortran}
|
||||
program amg_d_pde3d
|
||||
program amg_dexample_gpu
|
||||
use psb_base_mod
|
||||
use amg_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_util_mod
|
||||
use psb_gpu_mod
|
||||
use data_input
|
||||
use amg_d_pde3d_base_mod
|
||||
use amg_d_pde3d_exp_mod
|
||||
use amg_d_pde3d_gauss_mod
|
||||
use amg_d_genpde_mod
|
||||
use amg_d_pde_mod
|
||||
implicit none
|
||||
.......
|
||||
! GPU variables
|
||||
@@ -452,17 +449,14 @@ program amg_d_pde3d
|
||||
\begin{minipage}{.90\textwidth}
|
||||
{\small
|
||||
\begin{verbatim}
|
||||
program amg_d_pde3d
|
||||
program amg_dexample_gpu
|
||||
use psb_base_mod
|
||||
use amg_prec_mod
|
||||
use psb_krylov_mod
|
||||
use psb_util_mod
|
||||
use psb_gpu_mod
|
||||
use data_input
|
||||
use amg_d_pde3d_base_mod
|
||||
use amg_d_pde3d_exp_mod
|
||||
use amg_d_pde3d_gauss_mod
|
||||
use amg_d_genpde_mod
|
||||
use amg_d_pde_mod
|
||||
implicit none
|
||||
.......
|
||||
! GPU variables
|
||||
@@ -477,6 +471,9 @@ program amg_d_pde3d
|
||||
\fi
|
||||
\caption{setup of a GPU-enabled test program part one.\label{fig:gpu-ex1}}
|
||||
\end{listing}
|
||||
In this particular example we are choosing to employ a \verb|HLG| data
|
||||
structure for sparse matrices on GPUs; for more information please
|
||||
refer to the PSBLAS-EXT users' guide.
|
||||
|
||||
We then have to initialize the GPU environment, and pass the
|
||||
appropriate MOLD variables to the build methods (see also the PSBLAS
|
||||
|
||||
Reference in New Issue
Block a user