GEOSX
|
Contains a bunch of macro definitions. More...
#include "LvArrayConfig.hpp"
#include "system.hpp"
#include <fstream>
#include <sstream>
#include <iostream>
#include <type_traits>
Go to the source code of this file.
Macros | |
#define | STRINGIZE_NX(A) #A |
Convert A into a string. More... | |
#define | STRINGIZE(A) STRINGIZE_NX( A ) |
Convert the macro expansion of A into a string. More... | |
#define | LVARRAY_UNUSED_ARG(X) |
Mark X as an unused argument, used to silence compiler warnings. More... | |
#define | LVARRAY_UNUSED_VARIABLE(X) ( ( void ) X ) |
Mark X as an unused variable, used to silence compiler warnings. More... | |
#define | LVARRAY_DEBUG_VAR(X) LVARRAY_UNUSED_VARIABLE( X ) |
Mark X as an debug variable, used to silence compiler warnings. More... | |
#define | LOCATION __FILE__ ":" STRINGIZE( __LINE__ ) |
Expands to a string representing the current file and line. | |
#define | TYPEOFPTR(X) std::remove_pointer_t< decltype( X ) > |
Given an expression X that evaluates to a pointer, expands to the type pointed to. More... | |
#define | TYPEOFREF(X) std::remove_reference_t< decltype( X ) > |
Given an expression X that evaluates to a reference, expands to the type referred to. More... | |
#define | LVARRAY_LOG(...) std::cout << __VA_ARGS__ << std::endl |
Print the expression. | |
#define | LVARRAY_LOG_VAR(...) LVARRAY_LOG( STRINGIZE( __VA_ARGS__ ) << " = " << __VA_ARGS__ ) |
Print the expression string along with its value. | |
#define | LVARRAY_ERROR_IF(EXP, MSG) |
Abort execution if EXP is true. More... | |
#define | LVARRAY_ERROR(MSG) LVARRAY_ERROR_IF( true, MSG ) |
Abort execution. More... | |
#define | LVARRAY_ASSERT_MSG(EXP, MSG) LVARRAY_ERROR_IF( !(EXP), MSG ) |
Abort execution if EXP is false but only when NDEBUG is not defined.. More... | |
#define | LVARRAY_ASSERT(EXP) LVARRAY_ASSERT_MSG( EXP, "" ) |
Assert EXP is true with no message. | |
#define | LVARRAY_WARNING_IF(EXP, MSG) |
Print a warning if EXP is true. More... | |
#define | LVARRAY_WARNING(MSG) LVARRAY_WARNING_IF( true, MSG ) |
Print a warning with a message. More... | |
#define | LVARRAY_INFO_IF(EXP, MSG) |
Print msg along with the location if EXP is true. More... | |
#define | LVARRAY_INFO(msg) LVARRAY_INFO_IF( true, msg ) |
Print msg along with the location. More... | |
#define | LVARRAY_ERROR_IF_OP_MSG(lhs, OP, NOP, rhs, msg) |
Abort execution if lhs OP rhs . More... | |
#define | LVARRAY_ERROR_IF_EQ_MSG(lhs, rhs, msg) LVARRAY_ERROR_IF_OP_MSG( lhs, ==, !=, rhs, msg ) |
Raise a hard error if two values are equal. More... | |
#define | LVARRAY_ERROR_IF_EQ(lhs, rhs) LVARRAY_ERROR_IF_EQ_MSG( lhs, rhs, "" ) |
Raise a hard error if two values are equal. More... | |
#define | LVARRAY_ERROR_IF_NE_MSG(lhs, rhs, msg) LVARRAY_ERROR_IF_OP_MSG( lhs, !=, ==, rhs, msg ) |
Raise a hard error if two values are not equal. More... | |
#define | LVARRAY_ERROR_IF_NE(lhs, rhs) LVARRAY_ERROR_IF_NE_MSG( lhs, rhs, "" ) |
Raise a hard error if two values are not equal. More... | |
#define | LVARRAY_ERROR_IF_GT_MSG(lhs, rhs, msg) LVARRAY_ERROR_IF_OP_MSG( lhs, >, <=, rhs, msg ) |
Raise a hard error if one value compares greater than the other. More... | |
#define | LVARRAY_ERROR_IF_GT(lhs, rhs) LVARRAY_ERROR_IF_GT_MSG( lhs, rhs, "" ) |
Raise a hard error if one value compares greater than the other. More... | |
#define | LVARRAY_ERROR_IF_GE_MSG(lhs, rhs, msg) LVARRAY_ERROR_IF_OP_MSG( lhs, >=, <, rhs, msg ) |
Raise a hard error if one value compares greater than or equal to the other. More... | |
#define | LVARRAY_ERROR_IF_GE(lhs, rhs) LVARRAY_ERROR_IF_GE_MSG( lhs, rhs, "" ) |
Raise a hard error if one value compares greater than or equal to the other. More... | |
#define | LVARRAY_ERROR_IF_LT_MSG(lhs, rhs, msg) LVARRAY_ERROR_IF_OP_MSG( lhs, <, >=, rhs, msg ) |
Raise a hard error if one value compares less than the other. More... | |
#define | LVARRAY_ERROR_IF_LT(lhs, rhs) LVARRAY_ERROR_IF_LT_MSG( lhs, rhs, "" ) |
Raise a hard error if one value compares less than the other. More... | |
#define | LVARRAY_ERROR_IF_LE_MSG(lhs, rhs, msg) LVARRAY_ERROR_IF_OP_MSG( lhs, <=, >, rhs, msg ) |
Raise a hard error if one value compares less than or equal to the other. More... | |
#define | LVARRAY_ERROR_IF_LE(lhs, rhs) LVARRAY_ERROR_IF_GE_MSG( lhs, rhs, "" ) |
Raise a hard error if one value compares less than or equal to the other. More... | |
#define | LVARRAY_ASSERT_OP_MSG(lhs, OP, rhs, msg) |
Abort execution if lhs OP rhs is false. More... | |
#define | LVARRAY_ASSERT_EQ_MSG(lhs, rhs, msg) LVARRAY_ASSERT_OP_MSG( lhs, ==, rhs, msg ) |
Assert that two values compare equal in debug builds. More... | |
#define | LVARRAY_ASSERT_EQ(lhs, rhs) LVARRAY_ASSERT_EQ_MSG( lhs, rhs, "" ) |
Assert that two values compare equal in debug builds. More... | |
#define | LVARRAY_ASSERT_NE_MSG(lhs, rhs, msg) LVARRAY_ASSERT_OP_MSG( lhs, !=, rhs, msg ) |
Assert that two values compare not equal in debug builds. More... | |
#define | LVARRAY_ASSERT_NE(lhs, rhs) LVARRAY_ASSERT_NE_MSG( lhs, rhs, "" ) |
Assert that two values compare not equal in debug builds. More... | |
#define | LVARRAY_ASSERT_GT_MSG(lhs, rhs, msg) LVARRAY_ASSERT_OP_MSG( lhs, >, rhs, msg ) |
Assert that one value compares greater than the other in debug builds. More... | |
#define | LVARRAY_ASSERT_GT(lhs, rhs) LVARRAY_ASSERT_GT_MSG( lhs, rhs, "" ) |
Assert that one value compares greater than the other in debug builds. More... | |
#define | LVARRAY_ASSERT_GE_MSG(lhs, rhs, msg) LVARRAY_ASSERT_OP_MSG( lhs, >=, rhs, msg ) |
Assert that one value compares greater than or equal to the other in debug builds. More... | |
#define | LVARRAY_ASSERT_GE(lhs, rhs) LVARRAY_ASSERT_GE_MSG( lhs, rhs, "" ) |
Assert that one value compares greater than or equal to the other in debug builds. More... | |
#define | LVARRAY_HOST_DEVICE |
Mark a function for both host and device usage. | |
#define | LVARRAY_DEVICE |
Mark a function for only device usage. | |
#define | DISABLE_HD_WARNING |
Disable host device warnings. More... | |
#define | CONSTEXPR_WITHOUT_BOUNDS_CHECK constexpr |
Expands to constexpr when array bound checking is disabled. | |
#define | CONSTEXPR_WITH_NDEBUG |
Expands to constexpr in release builds (when NDEBUG is defined). | |
#define | CONSTEXPR_WITHOUT_BOUNDS_CHECK constexpr |
Expands to constexpr when array bound checking is disabled. | |
#define | CONSTEXPR_WITH_NDEBUG |
Expands to constexpr in release builds (when NDEBUG is defined). | |
Contains a bunch of macro definitions.
Definition in file Macros.hpp.
#define DISABLE_HD_WARNING |
Disable host device warnings.
This pragma disables nvcc warnings about calling a host function from a host-device function. This is used on templated host-device functions where some template instantiations call host only code. This is safe as long as the host only instantiations are only called on the host. To use place directly above a the template.
Definition at line 401 of file Macros.hpp.
#define LVARRAY_ASSERT_EQ | ( | lhs, | |
rhs | |||
) | LVARRAY_ASSERT_EQ_MSG( lhs, rhs, "" ) |
Assert that two values compare equal in debug builds.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 325 of file Macros.hpp.
#define LVARRAY_ASSERT_EQ_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ASSERT_OP_MSG( lhs, ==, rhs, msg ) |
Assert that two values compare equal in debug builds.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 318 of file Macros.hpp.
#define LVARRAY_ASSERT_GE | ( | lhs, | |
rhs | |||
) | LVARRAY_ASSERT_GE_MSG( lhs, rhs, "" ) |
Assert that one value compares greater than or equal to the other in debug builds.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 370 of file Macros.hpp.
#define LVARRAY_ASSERT_GE_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ASSERT_OP_MSG( lhs, >=, rhs, msg ) |
Assert that one value compares greater than or equal to the other in debug builds.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 363 of file Macros.hpp.
#define LVARRAY_ASSERT_GT | ( | lhs, | |
rhs | |||
) | LVARRAY_ASSERT_GT_MSG( lhs, rhs, "" ) |
Assert that one value compares greater than the other in debug builds.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 355 of file Macros.hpp.
#define LVARRAY_ASSERT_GT_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ASSERT_OP_MSG( lhs, >, rhs, msg ) |
Assert that one value compares greater than the other in debug builds.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 348 of file Macros.hpp.
#define LVARRAY_ASSERT_MSG | ( | EXP, | |
MSG | |||
) | LVARRAY_ERROR_IF( !(EXP), MSG ) |
Abort execution if EXP
is false but only when NDEBUG is not defined..
EXP | The expression to check. |
MSG | The message to associate with the error, can be anything streamable to std::cout. |
Definition at line 136 of file Macros.hpp.
#define LVARRAY_ASSERT_NE | ( | lhs, | |
rhs | |||
) | LVARRAY_ASSERT_NE_MSG( lhs, rhs, "" ) |
Assert that two values compare not equal in debug builds.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 340 of file Macros.hpp.
#define LVARRAY_ASSERT_NE_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ASSERT_OP_MSG( lhs, !=, rhs, msg ) |
Assert that two values compare not equal in debug builds.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 333 of file Macros.hpp.
#define LVARRAY_ASSERT_OP_MSG | ( | lhs, | |
OP, | |||
rhs, | |||
msg | |||
) |
Abort execution if lhs
OP
rhs
is false.
lhs | The left side of the operation. |
OP | The operation to apply. |
rhs | The right side of the operation. |
msg | The message to diplay. |
Definition at line 306 of file Macros.hpp.
#define LVARRAY_DEBUG_VAR | ( | X | ) | LVARRAY_UNUSED_VARIABLE( X ) |
Mark X
as an debug variable, used to silence compiler warnings.
X | the debug variable. |
Definition at line 57 of file Macros.hpp.
#define LVARRAY_ERROR | ( | MSG | ) | LVARRAY_ERROR_IF( true, MSG ) |
Abort execution.
MSG | The message to associate with the error, can be anything streamable to std::cout. |
Definition at line 122 of file Macros.hpp.
#define LVARRAY_ERROR_IF | ( | EXP, | |
MSG | |||
) |
Abort execution if EXP
is true.
EXP | The expression to check. |
MSG | The message to associate with the error, can be anything streamable to std::cout. |
Definition at line 101 of file Macros.hpp.
#define LVARRAY_ERROR_IF_EQ | ( | lhs, | |
rhs | |||
) | LVARRAY_ERROR_IF_EQ_MSG( lhs, rhs, "" ) |
Raise a hard error if two values are equal.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 222 of file Macros.hpp.
#define LVARRAY_ERROR_IF_EQ_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ERROR_IF_OP_MSG( lhs, ==, !=, rhs, msg ) |
Raise a hard error if two values are equal.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 215 of file Macros.hpp.
#define LVARRAY_ERROR_IF_GE | ( | lhs, | |
rhs | |||
) | LVARRAY_ERROR_IF_GE_MSG( lhs, rhs, "" ) |
Raise a hard error if one value compares greater than or equal to the other.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 267 of file Macros.hpp.
#define LVARRAY_ERROR_IF_GE_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ERROR_IF_OP_MSG( lhs, >=, <, rhs, msg ) |
Raise a hard error if one value compares greater than or equal to the other.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 260 of file Macros.hpp.
#define LVARRAY_ERROR_IF_GT | ( | lhs, | |
rhs | |||
) | LVARRAY_ERROR_IF_GT_MSG( lhs, rhs, "" ) |
Raise a hard error if one value compares greater than the other.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 252 of file Macros.hpp.
#define LVARRAY_ERROR_IF_GT_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ERROR_IF_OP_MSG( lhs, >, <=, rhs, msg ) |
Raise a hard error if one value compares greater than the other.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 245 of file Macros.hpp.
#define LVARRAY_ERROR_IF_LE | ( | lhs, | |
rhs | |||
) | LVARRAY_ERROR_IF_GE_MSG( lhs, rhs, "" ) |
Raise a hard error if one value compares less than or equal to the other.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 297 of file Macros.hpp.
#define LVARRAY_ERROR_IF_LE_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ERROR_IF_OP_MSG( lhs, <=, >, rhs, msg ) |
Raise a hard error if one value compares less than or equal to the other.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 290 of file Macros.hpp.
#define LVARRAY_ERROR_IF_LT | ( | lhs, | |
rhs | |||
) | LVARRAY_ERROR_IF_LT_MSG( lhs, rhs, "" ) |
Raise a hard error if one value compares less than the other.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 282 of file Macros.hpp.
#define LVARRAY_ERROR_IF_LT_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ERROR_IF_OP_MSG( lhs, <, >=, rhs, msg ) |
Raise a hard error if one value compares less than the other.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 275 of file Macros.hpp.
#define LVARRAY_ERROR_IF_NE | ( | lhs, | |
rhs | |||
) | LVARRAY_ERROR_IF_NE_MSG( lhs, rhs, "" ) |
Raise a hard error if two values are not equal.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
Definition at line 237 of file Macros.hpp.
#define LVARRAY_ERROR_IF_NE_MSG | ( | lhs, | |
rhs, | |||
msg | |||
) | LVARRAY_ERROR_IF_OP_MSG( lhs, !=, ==, rhs, msg ) |
Raise a hard error if two values are not equal.
lhs | expression to be evaluated and used as left-hand side in comparison |
rhs | expression to be evaluated and used as right-hand side in comparison |
msg | a message to log (any expression that can be stream inserted) |
Definition at line 230 of file Macros.hpp.
#define LVARRAY_ERROR_IF_OP_MSG | ( | lhs, | |
OP, | |||
NOP, | |||
rhs, | |||
msg | |||
) |
Abort execution if lhs
OP
rhs
.
lhs | The left side of the operation. |
OP | The operation to apply. |
NOP | The opposite of OP , used in the message. |
rhs | The right side of the operation. |
msg | The message to diplay. |
Definition at line 202 of file Macros.hpp.
#define LVARRAY_INFO | ( | msg | ) | LVARRAY_INFO_IF( true, msg ) |
Print msg
along with the location.
msg | The message to print. |
Definition at line 192 of file Macros.hpp.
#define LVARRAY_INFO_IF | ( | EXP, | |
MSG | |||
) |
Print msg
along with the location if EXP
is true.
EXP | The expression to test. |
MSG | The message to print. |
Definition at line 174 of file Macros.hpp.
#define LVARRAY_UNUSED_ARG | ( | X | ) |
Mark X
as an unused argument, used to silence compiler warnings.
X | the unused argument. |
Definition at line 45 of file Macros.hpp.
#define LVARRAY_UNUSED_VARIABLE | ( | X | ) | ( ( void ) X ) |
Mark X
as an unused variable, used to silence compiler warnings.
X | the unused variable. |
Definition at line 51 of file Macros.hpp.
#define LVARRAY_WARNING | ( | MSG | ) | LVARRAY_WARNING_IF( true, MSG ) |
Print a warning with a message.
MSG | The message to print. |
Definition at line 167 of file Macros.hpp.
#define LVARRAY_WARNING_IF | ( | EXP, | |
MSG | |||
) |
Print a warning if EXP
is true.
EXP | The expression to check. |
MSG | The message to associate with the warning, can be anything streamable to std::cout. |
Definition at line 149 of file Macros.hpp.
#define STRINGIZE | ( | A | ) | STRINGIZE_NX( A ) |
Convert the macro expansion of A
into a string.
A | the token to convert to a string. |
Definition at line 39 of file Macros.hpp.
#define STRINGIZE_NX | ( | A | ) | #A |
Convert A
into a string.
A | the token to convert to a string. |
Definition at line 33 of file Macros.hpp.
#define TYPEOFPTR | ( | X | ) | std::remove_pointer_t< decltype( X ) > |
Given an expression X
that evaluates to a pointer, expands to the type pointed to.
X | The expression to evaluate. |
Definition at line 66 of file Macros.hpp.
#define TYPEOFREF | ( | X | ) | std::remove_reference_t< decltype( X ) > |
Given an expression X
that evaluates to a reference, expands to the type referred to.
X | The expression to evaluate. |
Definition at line 72 of file Macros.hpp.