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_MACROS_HPP_
 
#define AXOM_DEVICE
 
#define AXOM_HOST_DEVICE
 CUDA host/device macros for decorating functions/lambdas. More...
 
#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_MACROS_HPP_

#define AXOM_MACROS_HPP_

◆ AXOM_DEVICE

#define AXOM_DEVICE

◆ AXOM_HOST_DEVICE

◆ 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::spin::BVH< NDIMS, ExecSpace, FloatType >::build(), and axom::spin::BVH< NDIMS, ExecSpace, FloatType >::find().

◆ 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(), 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::Group::createViewScalar(), axom::sidre::View::getNextValidAttrValueIndex(), axom::sidre::Attribute::getTypeID(), and axom::sidre::Buffer::isDescribed().

◆ DISABLE_COPY_AND_ASSIGNMENT

#define DISABLE_COPY_AND_ASSIGNMENT (   className)

◆ DISABLE_MOVE_AND_ASSIGNMENT

#define DISABLE_MOVE_AND_ASSIGNMENT (   className)