40 int *LRows,
int *LCols,
real *LVals,
41 int ASize,
real alpha)
43 for (
int I=threadIdx.x + blockIdx.x*blockDim.x; I<ASize; I += blockDim.x*gridDim.x)
47 AVals[I] = -alpha*LVals[I] + (LRows[I]==LCols[I])*MVals[LRows[I]];
79 int *LRows,
int *LCols,
real *LVals,
80 int ASize,
real alpha,
int *tags)
82 for(
int I=threadIdx.x + blockIdx.x*blockDim.x; I<ASize; I += blockDim.x*gridDim.x)
86 AVals[I] = (tags[LRows[I]] == -1)*(-alpha*LVals[I])
87 + (tags[LRows[I]] != -1)*(-LVals[I])
88 + (LRows[I]==LCols[I])*MVals[LRows[I]];
double real
Is a float or a double depending on the machine precision.
__global__ void generateADirectForcing(int *ARows, int *ACols, real *AVals, real *MVals, int *LRows, int *LCols, real *LVals, int ASize, real alpha, int *tags)
Generates a block of the matrix resulting from implicit terms in the momentum equation for the direct...
Contains all the custom-written CUDA kernels.
__global__ void generateA(int *ARows, int *ACols, real *AVals, real *MVals, int *LRows, int *LCols, real *LVals, int ASize, real alpha)
Generates a block of the matrix resulting from implicit terms in the momentum equation.
Declaration of the kernels to generate the matrix resulting from the implicit terms in the momentum e...