%===============================================================================
\section{RAJA example problems}\label{s:ex_raja}
%===============================================================================


%-------------------------------------------------------------------------------

\subsection{An unpreconditioned Krylov example: cvAdvDiff\_kry\_raja}\label{ss:cvAdvDiff_raja}

The example program \id{cvAdvDiff\_kry\_raja.cu} solves the same 2-D 
advection-diffusion equation as in Sections \ref{ss:cvAdvDiff} and
\ref{ss:cvAdvDiff_cuda}.

The file \id{nvector\_raja.h} contains the definition of the {\raja}
\id{N\_Vector} type, and \id{RAJA.hpp} definition of the {\raja}
\id{forall} loops. The prototype vector in the main body of the program is created
using \id{N\_VNew\_Raja} function. 

In order to get a good performance and avoid moving data between host
and device at every iteration, it is recommended that user evaluates  
model at the device. In the example, user-supplied model right hand side 
and Jacobian-vector product functions, \id{f} and \id{jtv}, operate on 
the device data. Vector data on the device is accessed using 
\id{N\_VGetDeviceArrayPointer\_Raja} function. Looping over vector 
components is implemented using {\raja} \id{forall} loops.

The output generated by \id{cvAdvDiff\_kry\_raja} is shown below.

%%
\includeOutput{cvAdvDiff\_kry\_raja}{../../examples/cvode/raja/cvAdvDiff_kry_raja.out}
%%

%-------------------------------------------------------------------------------

