AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
Macros.hpp File Reference
#include "axom/config.hpp"
#include <cassert>

Macros

#define AXOM_DEVICE
 
#define AXOM_HOST_DEVICE
 CUDA host/device macros for decorating functions/lambdas. More...
 
#define AXOM_HOST
 
#define AXOM_STRINGIFY(x)   AXOM_DO_STRINGIFY(x)
 
#define AXOM_DO_STRINGIFY(x)   #x
 
#define AXOM_PRAGMA(x)   _Pragma(AXOM_STRINGIFY(x))
 
#define AXOM_SUPPRESS_HD_WARN
 
#define AXOM_LAMBDA   [=]
 Convenience macro used for lambda capture by value. More...
 
#define AXOM_DEVICE_LAMBDA   [=]
 
#define AXOM_HOST_LAMBDA   [=]
 
#define AXOM_CUDA_TEST(X, Y)   TEST(X, Y)
 Convenience macro used for a gtest that uses cuda. More...
 
#define AXOM_NOT_USED(x)
 Macro used to silence compiler warnings in methods with unused arguments. More...
 
#define AXOM_STATIC_ASSERT(cond)   static_assert(cond, #cond)
 
#define AXOM_STATIC_ASSERT_MSG(cond, MSG)   static_assert(cond, MSG)
 This macro wraps the compile time static_assert functionality so you don't have to provide a message. More...
 
#define AXOM_DEBUG_VAR(_x)   static_cast<void>(_x)
 Macro used to silence compiler warnings about variables that are defined but not used. More...
 
#define AXOM_DEBUG_PARAM(_x)
 Macro used to silence compiler warnings about parameters that are used in debug code but not in release code. More...
 
#define DISABLE_DEFAULT_CTOR(className)   className() = delete
 Macro to disable default constructor for the given class. More...
 
#define DISABLE_COPY_AND_ASSIGNMENT(className)
 Macro to disable copy and assignment operations for the given class. More...
 
#define DISABLE_MOVE_AND_ASSIGNMENT(className)
 Macro to disable move constructor and move assignment operations for the given class. More...
 

Macro Definition Documentation

◆ AXOM_DEVICE

#define AXOM_DEVICE

◆ AXOM_HOST_DEVICE

#define AXOM_HOST_DEVICE

CUDA host/device macros for decorating functions/lambdas.

Note
These will expand to the corresponding CUDA decorations when compiled with -DAXOM_USE_CUDA

Referenced by axom::primal::Point< IndexType, NDIMS >::array(), axom::primal::Vector< SpaceCoordType, NDIMS >::array(), axom::primal::Triangle< T, NDIMS >::baryToPhysical(), axom::primal::BoundingBox< double, DIM >::BoundingBox(), axom::primal::Point< IndexType, NDIMS >::data(), axom::primal::Vector< SpaceCoordType, NDIMS >::data(), axom::primal::Point< IndexType, NDIMS >::dimension(), axom::primal::Vector< SpaceCoordType, NDIMS >::dimension(), axom::slic::detail::FalseType::FalseType(), axom::numerics::Matrix< T >::getDiagonalSize(), axom::primal::BoundingBox< double, DIM >::getMin(), axom::numerics::floating_point_limits< float >::lowest(), axom::numerics::floating_point_limits< double >::lowest(), axom::numerics::floating_point_limits< long double >::lowest(), axom::numerics::floating_point_limits< float >::max(), axom::numerics::floating_point_limits< double >::max(), axom::numerics::floating_point_limits< long double >::max(), axom::numerics::floating_point_limits< float >::min(), axom::numerics::floating_point_limits< double >::min(), axom::numerics::floating_point_limits< long double >::min(), axom::primal::Triangle< T, NDIMS >::normal(), axom::primal::NumericArray< IndexType, NDIMS >::NumericArray(), axom::numerics::Matrix< T >::ones(), axom::StackArray< T, N >::operator T*(), axom::primal::operator!=(), axom::primal::Point< IndexType, NDIMS >::operator=(), axom::StackArray< int64, 6 >::operator[](), axom::primal::Triangle< T, NDIMS >::operator[](), axom::primal::Point< IndexType, NDIMS >::operator[](), axom::primal::Vector< SpaceCoordType, NDIMS >::operator[](), axom::primal::Point< IndexType, NDIMS >::Point(), axom::primal::BoundingBox< double, DIM >::range(), axom::primal::NumericArray< IndexType, NDIMS >::size(), axom::primal::Vector< SpaceCoordType, NDIMS >::Vector(), axom::primal::BoundingBox< double, DIM >::~BoundingBox(), axom::primal::Triangle< T, NDIMS >::~Triangle(), and axom::primal::Vector< SpaceCoordType, NDIMS >::~Vector().

◆ AXOM_HOST

#define AXOM_HOST

◆ AXOM_STRINGIFY

#define AXOM_STRINGIFY (   x)    AXOM_DO_STRINGIFY(x)

◆ AXOM_DO_STRINGIFY

#define AXOM_DO_STRINGIFY (   x)    #x

◆ AXOM_PRAGMA

#define AXOM_PRAGMA (   x)    _Pragma(AXOM_STRINGIFY(x))

◆ AXOM_SUPPRESS_HD_WARN

#define AXOM_SUPPRESS_HD_WARN

◆ AXOM_LAMBDA

#define AXOM_LAMBDA   [=]

Convenience macro used for lambda capture by value.

Note
When CUDA is used, the macro always expands to a host/device lambda.
Warning
When compiling with CUDA, host/device lambdas incur a significant penalty on the CPU code. The way NVCC implements host/device lambdas prevents the compiler from proper in-lining them. When CUDA is enabled use the parallel_gpu execution policy or opt to turn off CUDA if the application is making more use of the parallel_cpu and serial execution policies.

Referenced by axom::quest::getMeshTriangle().

◆ AXOM_DEVICE_LAMBDA

#define AXOM_DEVICE_LAMBDA   [=]

◆ AXOM_HOST_LAMBDA

#define AXOM_HOST_LAMBDA   [=]

◆ AXOM_CUDA_TEST

#define AXOM_CUDA_TEST (   X,
 
)    TEST(X, Y)

Convenience macro used for a gtest that uses cuda.

◆ AXOM_NOT_USED

#define AXOM_NOT_USED (   x)

Macro used to silence compiler warnings in methods with unused arguments.

Note
The intent is to use this macro in the function signature. For example:
void my_function(int x, int AXOM_NOT_USED(y))
{
// my implementation
}

Referenced by axom::slam::Map< slam::Set< CoordType, CoordType >, OctreeLevelType * >::data(), axom::mint::Mesh::getCellCapacity(), axom::mint::Mesh::getFaceCapacity(), axom::quest::getMeshTriangle(), and axom::spin::BVHTree< T, NDIMS >::writeVtkFile().

◆ AXOM_STATIC_ASSERT

◆ AXOM_STATIC_ASSERT_MSG

◆ AXOM_DEBUG_VAR

◆ AXOM_DEBUG_PARAM

◆ DISABLE_DEFAULT_CTOR

#define DISABLE_DEFAULT_CTOR (   className)    className() = delete

Macro to disable default constructor for the given class.

Note
This macro should only be used within the private section of a class, as indicated in the example below.
class Foo
{
public:
// Public methods here
private:
};

Referenced by axom::sidre::View::getNextValidAttrValueIndex(), axom::sidre::Attribute::getTypeID(), axom::sidre::Buffer::isDescribed(), and axom::sidre::Group::isUsingList().

◆ DISABLE_COPY_AND_ASSIGNMENT

#define DISABLE_COPY_AND_ASSIGNMENT (   className)

◆ DISABLE_MOVE_AND_ASSIGNMENT