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_UNUSED_PARAM(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_UNUSED_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 only used when AXOM_DEBUG is defined. 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::Polyhedron< T, NDIMS >::addNeighbors(), axom::primal::Polyhedron< T, NDIMS >::addVertex(), axom::primal::Point< IndexType, NDIMS >::array(), axom::primal::Vector< SpaceCoordType, NDIMS >::array(), axom::primal::Triangle< double, NDIMS >::baryToPhysical(), axom::ArrayBase< T, 1, ArrayType >::blockSize(), axom::primal::BoundingBox< double, DIM >::BoundingBox(), axom::primal::Polyhedron< T, NDIMS >::centroid(), axom::primal::Triangle< double, NDIMS >::checkInTriangle(), axom::primal::Point< IndexType, NDIMS >::data(), axom::primal::Vector< SpaceCoordType, NDIMS >::data(), axom::spin::Mortonizer< CoordType, MortonIndexType, 2 >::demortonize(), axom::spin::Mortonizer< CoordType, MortonIndexType, 3 >::demortonize(), axom::numerics::determinant(), axom::primal::Point< IndexType, NDIMS >::dimension(), axom::primal::BoundingBox< double, DIM >::dimension(), axom::primal::Vector< SpaceCoordType, NDIMS >::dimension(), axom::spin::MortonBase< CoordType, MortonIndexType, Mortonizer< CoordType, MortonIndexType, 2 > >::expandBits(), axom::slic::detail::FalseType::FalseType(), axom::spin::BVH< NDIMS, ExecSpace >::findBoundingBoxes(), axom::spin::BVH< NDIMS, ExecSpace >::findPoints(), axom::spin::BVH< NDIMS, ExecSpace >::findRays(), axom::quest::SignedDistance< NDIMS, ExecSpace >::getBVHTree(), axom::primal::BoundingBox< double, DIM >::getCentroid(), axom::numerics::Matrix< T >::getDiagonalSize(), axom::primal::BoundingBox< double, DIM >::getMax(), axom::primal::BoundingBox< double, DIM >::getMin(), axom::primal::Polyhedron< T, NDIMS >::getNeighbors(), axom::primal::Polyhedron< T, NDIMS >::getNumNeighbors(), axom::primal::Polyhedron< T, NDIMS >::isValid(), 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::spin::Mortonizer< CoordType, MortonIndexType, 2 >::mortonize(), axom::spin::Mortonizer< CoordType, MortonIndexType, 3 >::mortonize(), axom::primal::Triangle< double, NDIMS >::normal(), axom::primal::Octahedron< T, NDIMS >::Octahedron(), axom::numerics::Matrix< T >::ones(), axom::StackArray< T, N >::operator T*(), axom::primal::operator!=(), axom::StackArray< PointType, MAX_VERTS >::operator[](), axom::primal::Triangle< double, NDIMS >::operator[](), axom::primal::Segment< T, NDIMS >::operator[](), axom::primal::Point< IndexType, NDIMS >::operator[](), axom::primal::Octahedron< T, NDIMS >::operator[](), axom::primal::Vector< SpaceCoordType, NDIMS >::operator[](), axom::primal::Ray< T, NDIMS >::origin(), axom::primal::Point< IndexType, NDIMS >::Point(), axom::primal::Polyhedron< T, NDIMS >::print(), axom::primal::BoundingBox< double, DIM >::range(), axom::quest::IntersectionShaper::setExecPolicy(), axom::primal::Plane< T, NDIMS >::signedDistance(), axom::primal::NumericArray< IndexType, NDIMS >::size(), axom::primal::Segment< T, NDIMS >::target(), axom::primal::Tetrahedron< T, NDIMS >::Tetrahedron(), axom::primal::Point< IndexType, NDIMS >::to_array(), axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::updateStrides(), axom::primal::Vector< SpaceCoordType, NDIMS >::Vector(), axom::primal::Tetrahedron< T, NDIMS >::volume(), axom::primal::Point< IndexType, NDIMS >::zero(), and axom::primal::Triangle< double, NDIMS >::~Triangle().

◆ 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::SignedDistance< NDIMS, ExecSpace >::computeDistances(), axom::quest::getMeshTriangle(), axom::spin::BVH< NDIMS, ExecSpace >::initialize(), axom::quest::IntersectionShaper::setExecPolicy(), and axom::quest::SignedDistance< NDIMS, ExecSpace >::setMesh().

◆ 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_UNUSED_PARAM

#define AXOM_UNUSED_PARAM (   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_UNUSED_PARAM(y))
{
// my implementation
}

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

◆ AXOM_STATIC_ASSERT

◆ AXOM_STATIC_ASSERT_MSG

◆ AXOM_UNUSED_VAR

#define AXOM_UNUSED_VAR (   _x)    static_cast<void>(_x)

Macro used to silence compiler warnings about variables that are defined but not used.

Note
The intent is to use this macro for variables that are only used within compiler defines (e.g. in debug assertions). For example:
double myVar = ...
AXOM_UNUSED_VAR(myVar);
// code emits the following warning in release builds
// if extra warnings are enabled and this macro is not called
// warning: unused variable 'myVar' [-Wunused-variable]
SLIC_ASSERT(myVar > 0)

Referenced by axom::allocate(), axom::experimental::Map< Key, T, Hash, Policy >::check_rehash(), axom::slam::policies::CompileTimeOffset< IntType, INT_VAL >::CompileTimeOffset(), axom::slam::policies::CompileTimeSize< IntType, INT_VAL >::CompileTimeSize(), axom::quest::SignedDistance< NDIMS, ExecSpace >::computeDistances(), axom::quest::InOutOctree< DIM >::generateIndex(), axom::slam::policies::VirtualParentSubset::isValid(), axom::slam::policies::ArrayIndirection< PositionType, ElementType >::isValid(), axom::slam::policies::ConcreteParentSubset< TheParentSetType >::isValid(), axom::slam::policies::STLVectorIndirection< SetPosition, SetElement >::isValid(), axom::primal::OrientedBoundingBox< T, NDIMS >::OrientedBoundingBox(), axom::reallocate(), axom::setDefaultAllocator(), axom::quest::IntersectionShaper::setExecPolicy(), axom::quest::SignedDistance< NDIMS, ExecSpace >::setMesh(), axom::slam::BitSet::test(), axom::quest::InOutOctree< DIM >::within(), axom::slam::policies::ZeroOffset< SetPosition >::ZeroOffset(), and axom::slam::policies::ZeroSize< IntType >::ZeroSize().

◆ 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