16 const double *
const __restrict__ V,
17 double *
const __restrict__ Av) {
19 for (
int i = 0; i < m; ++i) {
23 for (
int j = 1; j < m; ++j) {
32 const double *
const __restrict__ V,
double *
const __restrict__ Av)
35 for (
int i = 0; i < m; ++i) {
39 for (
int j = 1; j < m; ++j) {
49 const double *
const __restrict__ A,
50 const double *
const __restrict__ V,
51 double *
const __restrict__ Av) {
54 for (
int i = 0; i <
NSP; ++i) {
58 for (
int j = 1; j < m; ++j) {
68 const double * __restrict__ A,
69 double *
const __restrict__ * V,
70 double * __restrict__ * Av) {
73 for (
int i = 0; i <
NSP; ++i) {
79 for (
int j = 1; j < m; ++j) {
93 double*
const __restrict__ * V,
double* __restrict__ * Av) {
96 for (
int i = 0; i <
NSP; ++i) {
101 for (
int j = 1; j < m; ++j) {
115 const double* __restrict__ A,
const double* __restrict__ V,
116 double* __restrict__ Av,
const double* __restrict__ add) {
119 for (
int i = 0; i <
NSP; ++i) {
123 for (
int j = 1; j < m; ++j) {
135 const double* __restrict__ A,
const double* V,
136 double* __restrict__ Av,
const double* __restrict__ add,
137 const double* __restrict__ sub) {
140 for (
int i = 0; i <
NSP; ++i) {
145 for (
int j = 1; j < m; ++j) {
156 void scale (
const double* __restrict__ y0,
const double* __restrict__ y1,
double* __restrict__ sc) {
158 for (
int i = 0; i <
NSP; ++i) {
166 void scale_init (
const double* __restrict__ y0,
double* __restrict__ sc) {
168 for (
int i = 0; i <
NSP; ++i) {
176 double sc_norm (
const double* __restrict__ nums,
const double* __restrict__ sc) {
180 for (
int i = 0; i <
NSP; ++i) {
184 return sqrt(norm / ((
double)
NSP));
192 for (
int i = 0; i <
NSP; ++i) {
199 double normalize (
const double* __restrict__ v,
double* __restrict__ v_out) {
207 double m_norm = 1.0 / norm;
210 for (
int i = 0; i <
NSP; ++i) {
217 double dotproduct(
const double* __restrict__ w,
const double* __restrict__ Vm)
221 for(
int i = 0; i <
NSP; i++)
228 __device__
void scale_subtract(
const double s,
const double* __restrict__ Vm,
double* __restrict__ w)
231 for (
int i = 0; i <
NSP; i++)
237 __device__
void scale_mult(
const double s,
const double* __restrict__ w,
double* __restrict__ Vm)
240 for (
int i = 0; i <
NSP; i++)
__device__ double dotproduct(const double *__restrict__ w, const double *__restrict__ Vm)
Performs the dot product of the w (NSP x 1) vector with the given subspace vector (NSP x 1) ...
__device__ void scale_subtract(const double s, const double *__restrict__ Vm, double *__restrict__ w)
Subtracts Vm scaled by s from w.
__device__ void scale_init(const double *__restrict__ y0, double *__restrict__ sc)
Get scaling for weighted norm for the initial timestep (used in krylov process)
#define STRIDE
the matrix dimensions
__device__ void scale_mult(const double s, const double *__restrict__ w, double *__restrict__ Vm)
Sets Vm to s * w.
__device__ void matvec_n_by_m_scale_special2(const int m, const double *__restrict__ scale, const double *__restrict__ A, double *const __restrict__ *V, double *__restrict__ *Av)
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified f...
__device__ double normalize(const double *__restrict__ v, double *__restrict__ v_out)
Normalize the input vector using a 2-norm.
__device__ void matvec_n_by_m_scale_add(const int m, const double scale, const double *__restrict__ A, const double *__restrict__ V, double *__restrict__ Av, const double *__restrict__ add)
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified f...
Definitions of various linear algebra functions needed in the exponential integrators.
__device__ void matvec_n_by_m_scale_add_subtract(const int m, const double scale, const double *__restrict__ A, const double *V, double *__restrict__ Av, const double *__restrict__ add, const double *__restrict__ sub)
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified f...
__device__ void scale(const double *__restrict__ y0, const double *__restrict__ y1, double *__restrict__ sc)
Get scaling for weighted norm.
__device__ void matvec_m_by_m(const int m, const double *const __restrict__ A, const double *const __restrict__ V, double *const __restrict__ Av)
Matrix-vector multiplication of a matrix sized MxM and a vector Mx1.
__device__ void matvec_m_by_m_plusequal(const int m, const double *const __restrict__ A, const double *const __restrict__ V, double *const __restrict__ Av)
Matrix-vector plus equals for a matrix of size MxM and vector of size Mx1. That is, it returns (A + I) * v.
__device__ void matvec_n_by_m_scale_special(const int m, const double *__restrict__ scale, const double *__restrict__ A, double *const __restrict__ *V, double *__restrict__ *Av)
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified f...
__device__ double sc_norm(const double *__restrict__ nums, const double *__restrict__ sc)
Perform weighted norm.
__device__ void matvec_n_by_m_scale(const int m, const double scale, const double *const __restrict__ A, const double *const __restrict__ V, double *const __restrict__ Av)
Matrix-vector multiplication of a matrix sized NSPxM and a vector of size Mx1 scaled by a specified f...
#define INDEX(i)
Convenience macro to get the value of a vector at index i, calculated as i * GRID_DIM + T_ID...
__device__ double two_norm(const double *__restrict__ v)
Computes and returns the two norm of a vector.