AQUAgpusph 5.0.4
|
Type definitions for the OpenCL kernels (3D version). More...
Go to the source code of this file.
Macros | |
#define | vec float4 |
#define | dvec double4 |
#define | ivec int4 |
#define | lvec long4 |
#define | uivec uint4 |
#define | ulvec ulong4 |
#define | svec usize4 |
#define | ssvec ssize4 |
#define | matrix float16 |
#define | VEC_ZERO ((float4)(0.f,0.f,0.f,0.f)) |
Null vec, i.e. filled with zero components. | |
#define | VEC_ONE ((float4)(1.f, 1.f, 1.f, 0.f)) |
Ones vec, i.e. filled with one components (except the w component). | |
#define | VEC_ALL_ONE ((float4)(1.f, 1.f, 1.f, 1.f)) |
Ones vec, i.e. filled with one components. | |
#define | VEC_INFINITY ((float4)(INFINITY, INFINITY, INFINITY, 0.f)) |
Infinity vec, i.e. filled with infinity components (except the w component). | |
#define | VEC_ALL_INFINITY ((float4)(INFINITY, INFINITY, INFINITY, INFINITY)) |
Infinity vec, i.e. filled with infinity components. | |
#define | VEC_NEG_INFINITY (-VEC_INFINITY) |
-Infinity vec, i.e. filled with -infinity components (except the w component). | |
#define | VEC_ALL_NEG_INFINITY (-VEC_ALL_INFINITY) |
-Infinity vec, i.e. filled with -infinity components. | |
#define | MAT_ZERO |
Null matrix, i.e. filled with zero components. | |
#define | MAT_ONE |
Ones matrix, i.e. filled with one components, except the last row and column. | |
#define | MAT_ALL_ONE |
Ones matrix, i.e. filled with one components. | |
#define | MAT_EYE |
Eye matrix , except the south-east component, which is filled with a zero. | |
#define | MAT_ALL_EYE |
Eye matrix. | |
#define | XYZ xyz |
Convenient access to the vector components. | |
#define | BEGIN_LOOP_OVER_NEIGHS() |
Loop over the neighs to compute the interactions. | |
#define | END_LOOP_OVER_NEIGHS() |
End of the loop over the neighs to compute the interactions. | |
#define | BEGIN_NEIGHS(CELL, NPARTS, NCELLS, ICELL, IHOC) |
Loop over the neighbours to compute the interactions. | |
#define | END_NEIGHS() |
End of the loop over the neighs to compute the interactions. | |
#define | MATRIX_DOT(_M, _V) |
Multiply a matrix by a vector (inner product) | |
#define | MATRIX_DOT_ALL(_M, _V) |
Multiply a matrix by a vector (inner product) | |
#define | MATRIX_MUL(_M1, _M2) |
Multiply a matrix by a matrix (inner product) | |
#define | MATRIX_MUL_ALL(_M1, _M2) |
Multiply a matrix by a matrix (inner product) | |
#define | TRANSPOSE s048C159D26AE37BF |
Transpose a matrix. | |
#define | DIAG s05A |
The matrix diagonal (as vector) | |
#define | MATRIX_FROM_DIAG(_V) |
Build up a matrix from the diagonal information (as vector) | |
#define | MATRIX_TRACE(_M) |
Trace of the matrix. | |
#define | MATRIX_INV(_M) |
Pseudo-inverse of a matrix. | |
#define | vec_xyz vec3 |
Vectors with the minimum number of components. | |
#define | dvec_xyz dvec3 |
#define | ivec_xyz ivec3 |
#define | lvec_xyz lvec3 |
#define | uivec_xyz uivec3 |
#define | ulvec_xyz ulvec3 |
#define | svec_xyz svec3 |
#define | ssvec_xyz ssvec3 |
Functions | |
matrix | outer (const vec3 v1, const vec3 v2) |
Perform the outer product of two vectors. | |
float | det (const matrix m) |
Determinant of a matrix. | |
matrix | inv (const matrix m) |
Inverse of a matrix. |
Type definitions for the OpenCL kernels (3D version).
#define BEGIN_LOOP_OVER_NEIGHS | ( | ) |
Loop over the neighs to compute the interactions.
All the code between this macro and END_LOOP_OVER_NEIGHS will be executed for all the neighbours.
To use this macro, the main particle (the one which the interactions are intended to be computed) should be identified by an unsigned integer variable i, while the resulting neighs will be automatically identified by the unsigned integer variable j. To discard a neighbour particle, remember calling
before
The following variables will be declared, and therefore cannot be used elsewhere:
#define BEGIN_NEIGHS | ( | CELL, | |
NPARTS, | |||
NCELLS, | |||
ICELL, | |||
IHOC ) |
Loop over the neighbours to compute the interactions.
All the code between this macro and END_NEIGHS will be executed for all the neighbours.
The resulting neighs will be automatically identified by the unsigned integer variable j. To discard a neighbour particle, remember calling
followed by
The following variables will be declared, and therefore cannot be used within the loop scope:
CELL | Cell of the main particle (usually icell[i]
|
NPARTS | Number of particles (usually N
|
NCELLS | Number of cells at each direction (usually n_cells
|
ICELL | Array of cells for each particle (usually icell
|
IHOC | Array of head of cells (usually ihoc
|
#define DIAG s05A |
The matrix diagonal (as vector)
#define dvec double4 |
#define dvec_xyz dvec3 |
#define END_LOOP_OVER_NEIGHS | ( | ) |
End of the loop over the neighs to compute the interactions.
#define END_NEIGHS | ( | ) |
End of the loop over the neighs to compute the interactions.
#define ivec int4 |
#define ivec_xyz ivec3 |
#define lvec long4 |
#define lvec_xyz lvec3 |
#define MAT_ALL_EYE |
Eye matrix.
\( m_{ii} = 1; m_{ij} = 1 \leftrightarrow i \neq j \)
#define MAT_ALL_ONE |
Ones matrix, i.e. filled with one components.
#define MAT_EYE |
Eye matrix , except the south-east component, which is filled with a zero.
\( m_{ii} = 1 \leftrightarrow i \neq 4; m_{ii} = 0 \leftrightarrow i = 4; m_{ij} = 0 \leftrightarrow i \neq j \)
#define MAT_ONE |
Ones matrix, i.e. filled with one components, except the last row and column.
#define MAT_ZERO |
Null matrix, i.e. filled with zero components.
#define matrix float16 |
#define MATRIX_DOT | ( | _M, | |
_V ) |
Multiply a matrix by a vector (inner product)
#define MATRIX_DOT_ALL | ( | _M, | |
_V ) |
Multiply a matrix by a vector (inner product)
#define MATRIX_FROM_DIAG | ( | _V | ) |
Build up a matrix from the diagonal information (as vector)
#define MATRIX_INV | ( | _M | ) |
Pseudo-inverse of a matrix.
The SVD Moore-Penrose method is applied:
\[ A^{\dag} = \left( A^T A \right)^{-1} A^T \]
#define MATRIX_MUL | ( | _M1, | |
_M2 ) |
Multiply a matrix by a matrix (inner product)
#define MATRIX_MUL_ALL | ( | _M1, | |
_M2 ) |
Multiply a matrix by a matrix (inner product)
#define MATRIX_TRACE | ( | _M | ) |
Trace of the matrix.
i.e. The sum of the diagonal elements of the matrix.
#define ssvec ssize4 |
#define ssvec_xyz ssvec3 |
#define svec usize4 |
#define svec_xyz svec3 |
#define TRANSPOSE s048C159D26AE37BF |
Transpose a matrix.
#define uivec uint4 |
#define uivec_xyz uivec3 |
#define ulvec ulong4 |
#define ulvec_xyz ulvec3 |
#define vec float4 |
Infinity vec, i.e. filled with infinity components.
#define VEC_ALL_NEG_INFINITY (-VEC_ALL_INFINITY) |
-Infinity vec, i.e. filled with -infinity components.
#define VEC_ALL_ONE ((float4)(1.f, 1.f, 1.f, 1.f)) |
Ones vec, i.e. filled with one components.
Infinity vec, i.e. filled with infinity components (except the w component).
#define VEC_NEG_INFINITY (-VEC_INFINITY) |
-Infinity vec, i.e. filled with -infinity components (except the w component).
#define VEC_ONE ((float4)(1.f, 1.f, 1.f, 0.f)) |
Ones vec, i.e. filled with one components (except the w component).
#define vec_xyz vec3 |
Vectors with the minimum number of components.
The number of components depends on weather the 2D version or 3D version is compiled:
This type can be used for the local variables to reduce the VGPRs.
#define VEC_ZERO ((float4)(0.f,0.f,0.f,0.f)) |
Null vec, i.e. filled with zero components.
#define XYZ xyz |
Determinant of a matrix.
m | Matrix to invert |
Inverse of a matrix.
m | Matrix to invert |