AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
InterfacePolicies.hpp File Reference

Interface policies for SLAM. More...

Classes

class  axom::slam::policies::VirtualInterface
 Policy to use a virtual interface with a given Slam type. More...
 
struct  axom::slam::policies::ConcreteInterface
 

Namespaces

 axom
 
 axom::slam
 
 axom::slam::policies
 

Detailed Description

Interface policies for SLAM.

Interface policies, when used to instantiate supported SLAM types, allow for selecting between a virtual interface or a concrete interface.

Using a virtual interface has the advantage of being able to switch at runtime between different types that correspond to the same base interface. However, there may be some disadvantages:

  • Virtual function calls may be slower, if performance is a concern.
  • For CUDA/HIP code, virtual SLAM objects cannot cross a host/device boundary, since the virtual function table is only correct for either the host or the device, depending on where the object was constructed.

Using a concrete interface trades the convenience of runtime polymorphism for improved performance by avoiding virtual function calls. For CUDA/HIP code, SLAM types instantiated with a concrete interface are usually able to cross a host/device boundary, i.e. when captured in a RAJA lambda-based loop.

See also
SetInterfacePolicies.hpp \set MapInterfacePolicies.hpp
BivariateSetInterfacePolicies.hpp