AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
types.h File Reference

Generic types definition file. More...

Include dependency graph for types.h:

Go to the source code of this file.

Macros

#define INFINITY   FLT_MAX
#define vec2   float2
#define vec3   float3
#define vec4   float4
#define vec8   float8
#define dvec2   double2
#define dvec3   double3
#define dvec4   double4
#define dvec8   double8
#define ivec2   int2
#define ivec3   int3
#define ivec4   int4
#define ivec8   int8
#define lvec2   long2
#define lvec3   long3
#define lvec4   long4
#define lvec8   long8
#define uivec2   uint2
#define uivec3   uint3
#define uivec4   uint4
#define uivec8   uint8
#define ulvec2   ulong2
#define ulvec3   ulong3
#define ulvec4   ulong4
#define ulvec8   ulong8
#define svec2   usize2
#define svec3   usize3
#define svec4   usize4
#define svec8   usize8
#define ssvec2   ssize2
#define ssvec3   ssize3
#define ssvec4   ssize4
#define ssvec8   ssize8
#define _CONVERT(TYPE)
 Helper function for CONVERT.
#define CONVERT(TYPE, v)
 Conversor between complex types.
#define C_I()
 Utility to can redefine the cell of the particle to be computed.
#define LINKLIST_LOCAL_PARAMS
 Macro to easily add the parameters to run BEGIN_NEIGHS macro, interacting with the local set of particles, i.e. the particles handled by this process.
#define LINKLIST_REMOTE_PARAMS
 Macro to easily add the parameters to run BEGIN_NEIGHS macro, interacting with the local set of particles, i.e. the particles handled by this process.

Detailed Description

Generic types definition file.

This file is redirecting to either 2D.hcl or 3D.hcl, depending on #HAVE_3D

Macro Definition Documentation

◆ _CONVERT

#define _CONVERT ( TYPE)
Value:
convert_ ## TYPE

Helper function for CONVERT.

The helper is required because the preprocessor is only recursively expanding macros if the definition is not affected by # nor ## string operators. Then, this inner function is concatenating the unexpanded words, while CONVERT is effectively expanding the type name.

◆ C_I

#define C_I ( )
Value:
const usize c_i = icell[i]

Utility to can redefine the cell of the particle to be computed.

It can be used for mirrrored particles, which are temporary associated to a different cell.

See also
BEGIN_LOOP_OVER_NEIGHS

◆ CONVERT

#define CONVERT ( TYPE,
v )
Value:
_CONVERT(TYPE)(v)
#define _CONVERT(TYPE)
Helper function for CONVERT.
Definition types.h:69

Conversor between complex types.

In OpenCL, to convert between complex types the functions convert_TYPEN should be used. Otherwise casting errors will be received.

This definition provides a convenient function to become used with the overloaded types vec, ivec and uivec.

For instance, to convert a vec variable, v, to an ivec variable, you can call CONVERT(ivec, v);

◆ dvec2

#define dvec2   double2

◆ dvec3

#define dvec3   double3

◆ dvec4

#define dvec4   double4

◆ dvec8

#define dvec8   double8

◆ INFINITY

#define INFINITY   FLT_MAX

◆ ivec2

#define ivec2   int2

◆ ivec3

#define ivec3   int3

◆ ivec4

#define ivec4   int4

◆ ivec8

#define ivec8   int8

◆ LINKLIST_LOCAL_PARAMS

#define LINKLIST_LOCAL_PARAMS
Value:
const __global usize * icell, \
const __global usize * ihoc, \
svec4 n_cells

Macro to easily add the parameters to run BEGIN_NEIGHS macro, interacting with the local set of particles, i.e. the particles handled by this process.

See also
BEGIN_NEIGHS
Note
The number of particles, N, is not included

◆ LINKLIST_REMOTE_PARAMS

#define LINKLIST_REMOTE_PARAMS
Value:
const __global usize * icell, \
const __global usize * mpi_icell, \
const __global usize * mpi_ihoc, \
svec4 n_cells

Macro to easily add the parameters to run BEGIN_NEIGHS macro, interacting with the local set of particles, i.e. the particles handled by this process.

See also
BEGIN_NEIGHS
Note
The number of particles, N, is not included

◆ lvec2

#define lvec2   long2

◆ lvec3

#define lvec3   long3

◆ lvec4

#define lvec4   long4

◆ lvec8

#define lvec8   long8

◆ ssvec2

#define ssvec2   ssize2

◆ ssvec3

#define ssvec3   ssize3

◆ ssvec4

#define ssvec4   ssize4

◆ ssvec8

#define ssvec8   ssize8

◆ svec2

#define svec2   usize2

◆ svec3

#define svec3   usize3

◆ svec4

#define svec4   usize4

◆ svec8

#define svec8   usize8

◆ uivec2

#define uivec2   uint2

◆ uivec3

#define uivec3   uint3

◆ uivec4

#define uivec4   uint4

◆ uivec8

#define uivec8   uint8

◆ ulvec2

#define ulvec2   ulong2

◆ ulvec3

#define ulvec3   ulong3

◆ ulvec4

#define ulvec4   ulong4

◆ ulvec8

#define ulvec8   ulong8

◆ vec2

#define vec2   float2

◆ vec3

#define vec3   float3

◆ vec4

#define vec4   float4

◆ vec8

#define vec8   float8