GEOS
Macros
GeosxMacros.hpp File Reference
#include "common/GeosxConfig.hpp"
#include "LvArray/src/Macros.hpp"

Go to the source code of this file.

Macros

#define PRAGMA_OMP(clause)
 No-op version of PRAGMA_OMP.
 
#define GEOS_RESTRICT   LVARRAY_RESTRICT
 preprocessor variable for the C99 restrict keyword for use with pointers
 
#define GEOS_RESTRICT_THIS   LVARRAY_RESTRICT_THIS
 preprocessor variable for the C99 restrict keyword for use with the "this" pointer
 
#define GEOS_DECLTYPE_AUTO_RETURN   decltype( auto )
 Doxygen can't parse a decltype( auto ) return type, using this gets around that.
 
#define GEOS_CONCAT_IMPL(A, B)   A ## B
 Macro to concatenate two tokens (low level)
 
#define GEOS_CONCAT(A, B)   GEOS_CONCAT_IMPL( A, B )
 Macro to concatenate two tokens (user level)
 
#define GEOS_MAYBE_UNUSED
 [[maybe_unused]] when >= C++17, or compiler-specific implementations when < C++17
 
Host-device markers

These macros are used to denote host/device/inline functions in a compiler-specific way. They must be prepended to a function or lambda declaration/definition. They will be defined differently when compiled by e.g. a CUDA compiler.

#define GEOS_HOST
 Marks a host-only function.
 
#define GEOS_DEVICE
 Marks a device-only function.
 
#define GEOS_HOST_DEVICE
 Marks a host-device function.
 
#define GEOS_FORCE_INLINE   inline
 Marks a function or lambda for inlining.
 
#define PRAGMA_UNROLL
 Compiler directive specifying to unroll the loop.
 
Parameters processing internal macros

These internal macros allow to craft macros with multiple count of parameters.

#define GEOS_DETAIL_MORE_THAN_ONE_ARG_VALUE(_00, _01, _02, _03, _04, _05, _06, _07, _08, _09, _10, _11, _12, _13, _14, _15, _INDEX, ...)   _INDEX
 internal macro for GEOS_DETAIL_MORE_THAN_ONE_ARG
 
#define GEOS_DETAIL_MORE_THAN_ONE_ARG(...)
 
#define GEOS_DETAIL_FIRST_ARG(...)
 
#define GEOS_DETAIL_REST_ARGS(...)
 
#define GEOS_DETAIL_REST_PREP_ARGS(...)
 

Unused variable markers.

These macros are used to explicitly mark a variable/argument as unused and thus silence compiler warnings.

#define GEOS_UNUSED_PARAM(X)
 Mark an unused argument and silence compiler warnings.
 
#define GEOS_UNUSED_VAR(...)   i_g_n_o_r_e( __VA_ARGS__ )
 Mark an unused variable and silence compiler warnings.
 
#define GEOS_DEBUG_VAR(...)   GEOS_UNUSED_VAR( __VA_ARGS__ )
 Mark a debug variable and silence compiler warnings.
 
template<typename ... ARGS>
constexpr void i_g_n_o_r_e (ARGS const &...)
 Used to silence unused variable warnings, cuda doesn't respect casting to void. More...
 

Detailed Description

This file contains various macro definitions.

Definition in file GeosxMacros.hpp.

Macro Definition Documentation

◆ GEOS_DETAIL_FIRST_ARG

#define GEOS_DETAIL_FIRST_ARG (   ...)
Value:
GEOS_DETAIL_FIRST_ARG_DISPATCH( GEOS_DETAIL_MORE_THAN_ONE_ARG( __VA_ARGS__ ), \
__VA_ARGS__ )
#define GEOS_DETAIL_MORE_THAN_ONE_ARG(...)
Returns
Return the first parameter of the variadic parameters (VA_ARGS).
Note
Undefined behaviour if variadic argument has more that 16 elements.

Definition at line 183 of file GeosxMacros.hpp.

◆ GEOS_DETAIL_MORE_THAN_ONE_ARG

#define GEOS_DETAIL_MORE_THAN_ONE_ARG (   ...)
Value:
true, true, true, true, true, true, true, true, \
true, true, true, true, true, true, true, false, false )
#define GEOS_DETAIL_MORE_THAN_ONE_ARG_VALUE(_00, _01, _02, _03, _04, _05, _06, _07, _08, _09, _10, _11, _12, _13, _14, _15, _INDEX,...)
internal macro for GEOS_DETAIL_MORE_THAN_ONE_ARG
Returns
1 if variadic argument has more than 1 element, 0 otherwise.
Note
Undefined behaviour if variadic argument has more that 16 elements.

Definition at line 152 of file GeosxMacros.hpp.

◆ GEOS_DETAIL_REST_ARGS

#define GEOS_DETAIL_REST_ARGS (   ...)
Value:
GEOS_DETAIL_REST_ARGS_DISPATCH( GEOS_DETAIL_MORE_THAN_ONE_ARG( __VA_ARGS__ ), \
__VA_ARGS__ )
Returns
Return the parameters following the first of the variadic parameters (VA_ARGS).
Note
Undefined behaviour if variadic argument has more that 16 elements.

Definition at line 190 of file GeosxMacros.hpp.

◆ GEOS_DETAIL_REST_PREP_ARGS

#define GEOS_DETAIL_REST_PREP_ARGS (   ...)
Value:
GEOS_DETAIL_REST_PREP_ARGS_DISPATCH( GEOS_DETAIL_MORE_THAN_ONE_ARG( __VA_ARGS__ ), \
__VA_ARGS__ )
Returns
Return the parameters following the first of the variadic parameters (VA_ARGS), prepended with a comma when not empty.
Note
Undefined behaviour if variadic argument has more that 16 elements.

Definition at line 198 of file GeosxMacros.hpp.

Function Documentation

◆ i_g_n_o_r_e()

template<typename ... ARGS>
constexpr void i_g_n_o_r_e ( ARGS const &  ...)
inlineconstexpr

Used to silence unused variable warnings, cuda doesn't respect casting to void.

Template Parameters
ARGSargument types
Parameters
...

Definition at line 81 of file GeosxMacros.hpp.