milupHPC documentation
Namespaces | Functions
CudaUtils Namespace Reference

Namespaces

namespace  Kernel
 

Functions

__device__ int sign (real x)
 Get sign of floating point variable. More...
 
__device__ int stressIndex (int particleIndex, int row, int col)
 map [i][j] to [i*DIM*DIM+j] for the tensors More...
 
__device__ void copyMatrix (real src[DIM][DIM], real dst[DIM][DIM])
 Deep copy of matrix. More...
 
__device__ void transposeMatrix (real m[DIM][DIM])
 Transpose matrix. More...
 
__device__ void multiplyMatrix (real A[DIM][DIM], real B[DIM][DIM], real C[DIM][DIM])
 
__device__ void multiply (real A[][DIM], real B[][DIM], real C[][DIM])
 
__device__ void identityMatrix (real A[DIM][DIM])
 Return identity matrix. More...
 
__device__ int maxMatrix (real M[DIM][DIM], int *e, int *f, real *elmax)
 Returns the indices of the greatest non-diagonal element of the matrix M. More...
 
__device__ void rotateMatrix (volatile real m[DIM][DIM], volatile real c, volatile real s, volatile int e, volatile int f)
 Rotate matrix. More...
 
__device__ int calculateAllEigenvalues (real M[DIM][DIM], real eigenvalues[DIM], real v[DIM][DIM])
 Computes all eigenvalues and eigenvectors of the symmetric matrix M. More...
 
__device__ real calculateMaxEigenvalue (real M[DIM][DIM])
 Computes the eigenvalues of the symmetric matrix M. More...
 
__device__ real det2x2 (real a, real b, real c, real d)
 Determinant of a 2x2 matrix. More...
 
__device__ int invertMatrix (real *m, real *inverted)
 Invert matrix. More...
 

Function Documentation

◆ calculateAllEigenvalues()

__device__ int CudaUtils::calculateAllEigenvalues ( real  M[DIM][DIM],
real  eigenvalues[DIM],
real  v[DIM][DIM] 
)

Computes all eigenvalues and eigenvectors of the symmetric matrix M.

using the jacobi method and stores them in eigenvals and the eigenvecs as columns in the transformation matrix v

Parameters
M
eigenvalues
v
Returns
number of iterations

Definition at line 159 of file linalg.cu.

+ Here is the call graph for this function:

◆ calculateMaxEigenvalue()

__device__ real CudaUtils::calculateMaxEigenvalue ( real  M[DIM][DIM])

Computes the eigenvalues of the symmetric matrix M.

Using the jacobi method.

Parameters
M
Returns
Greatest eigenvalue

Definition at line 224 of file linalg.cu.

+ Here is the call graph for this function:

◆ copyMatrix()

__device__ void CudaUtils::copyMatrix ( real  src[DIM][DIM],
real  dst[DIM][DIM] 
)

Deep copy of matrix.

Parameters
[in]srcSource matrix
[out]dstDestination matrix

Definition at line 16 of file linalg.cu.

◆ det2x2()

__device__ real CudaUtils::det2x2 ( real  a,
real  b,
real  c,
real  d 
)

Determinant of a 2x2 matrix.

Parameters
a
b
c
d
Returns

Definition at line 275 of file linalg.cu.

◆ identityMatrix()

__device__ void CudaUtils::identityMatrix ( real  A[DIM][DIM])

Return identity matrix.

Parameters
[in,out]AIdentity matrix.

Definition at line 80 of file linalg.cu.

◆ invertMatrix()

__device__ int CudaUtils::invertMatrix ( real *  m,
real *  inverted 
)

Invert matrix.

Parameters
[in]m
[out]inverted
Returns

Definition at line 279 of file linalg.cu.

+ Here is the call graph for this function:

◆ maxMatrix()

__device__ int CudaUtils::maxMatrix ( real  M[DIM][DIM],
int *  e,
int *  f,
real *  elmax 
)

Returns the indices of the greatest non-diagonal element of the matrix M.

Parameters
MRelevant matrix
e
f
elmax
Returns
error code

Definition at line 92 of file linalg.cu.

+ Here is the call graph for this function:

◆ multiply()

__device__ void CudaUtils::multiply ( real  A[][DIM],
real  B[][DIM],
real  C[][DIM] 
)

Multiply.

Parameters
[in]A
[in]B
[out]C

Definition at line 69 of file linalg.cu.

◆ multiplyMatrix()

__device__ void CudaUtils::multiplyMatrix ( real  A[DIM][DIM],
real  B[DIM][DIM],
real  C[DIM][DIM] 
)

Multiply two matrices.

Parameters
[in]AMatrix A
[in]BMatrix B
[out]CResult matrix

Definition at line 43 of file linalg.cu.

◆ rotateMatrix()

__device__ void CudaUtils::rotateMatrix ( volatile real  m[DIM][DIM],
volatile real  c,
volatile real  s,
volatile int  e,
volatile int  f 
)

Rotate matrix.

Returns: M' = A^T M A, and A_ef = s = -A_ef, A_ee = A_ff = c

Parameters
m
c
s
e
f

Definition at line 118 of file linalg.cu.

◆ sign()

__device__ int CudaUtils::sign ( real  x)

Get sign of floating point variable.

Parameters
xFloating point variable
Returns
Sign of floating point variable (-1, 0, 1)

Definition at line 5 of file linalg.cu.

◆ stressIndex()

__device__ int CudaUtils::stressIndex ( int  particleIndex,
int  row,
int  col 
)

map [i][j] to [i*DIM*DIM+j] for the tensors

Definition at line 11 of file linalg.cu.

◆ transposeMatrix()

__device__ void CudaUtils::transposeMatrix ( real  m[DIM][DIM])

Transpose matrix.

Parameters
[in,out]mMatrix to be transposed

Definition at line 27 of file linalg.cu.


milupHPC - CudaUtils Namespace Reference
Generated on Wed Aug 31 2022 12:16:53 by Doxygen 1.9.3