Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends

LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE > Class Template Reference

The CUDAStepper offloads cell updates to a CUDA enabled GPU. More...

#include <cudastepper.h>

Inherits LibGeoDecomp::HiParSimulator::CommonStepper< CELL_TYPE >.

Collaboration diagram for LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Stepper< CELL_TYPE >
::Topology 
Topology
typedef class Stepper< CELL_TYPE > ParentType
typedef ParentType::GridType GridType
typedef CUDAGrid< CELL_TYPE,
Topology, true > 
CUDAGridType
typedef PartitionManager
< Topology
PartitionManagerType
typedef PatchBufferFixed
< GridType, GridType, 1 > 
PatchBufferType1
typedef PatchBufferFixed
< GridType, GridType, 2 > 
PatchBufferType2
typedef
ParentType::PatchAccepterVec 
PatchAccepterVec

Public Member Functions

 CUDAStepper (boost::shared_ptr< PartitionManagerType > partitionManager, boost::shared_ptr< Initializer< CELL_TYPE > > initializer, const PatchAccepterVec &ghostZonePatchAccepters=PatchAccepterVec(), const PatchAccepterVec &innerSetPatchAccepters=PatchAccepterVec())

Static Public Attributes

static const int DIM = Topology::DIM
static const unsigned NANO_STEPS = APITraits::SelectNanoSteps<CELL_TYPE>::VALUE

Private Member Functions

void update1 ()
 Proceed the simulation exactly one nano step.
void notifyPatchAcceptersGhostZones (const Region< DIM > &region, std::size_t nanoStep)
void notifyPatchProvidersGhostZones (const Region< DIM > &region, std::size_t nanoStep)
void notifyPatchAcceptersInnerSet (const Region< DIM > &region, std::size_t nanoStep)
void notifyPatchProvidersInnerSet (const Region< DIM > &region, std::size_t nanoStep)
void initGrids ()
void updateGhost ()
 computes the next ghost zone at time "t_1 = globalNanoStep() + ghostZoneWidth()".
const CUDARegion< DIM > & deviceInnerSet (unsigned offset) const

Private Attributes

boost::shared_ptr< CUDAGridTypeoldDeviceGrid
boost::shared_ptr< CUDAGridTypenewDeviceGrid
std::vector< boost::shared_ptr
< CUDARegion< DIM > > > 
deviceInnerSets

Friends

class CUDAStepperRegionTest
class CUDAStepperBasicTest
class CUDAStepperTest

Detailed Description

template<typename CELL_TYPE>
class LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >

The CUDAStepper offloads cell updates to a CUDA enabled GPU.

FIXME: add option to select CUDA device in c-tor. we'll need to use a custom stream in this case. FIXME: add 2d unit test


Member Typedef Documentation

template<typename CELL_TYPE >
typedef CUDAGrid<CELL_TYPE, Topology, true> LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::CUDAGridType
template<typename CELL_TYPE >
typedef ParentType::GridType LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::GridType
template<typename CELL_TYPE >
typedef class Stepper< CELL_TYPE > LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::ParentType
template<typename CELL_TYPE >
typedef PartitionManager<Topology> LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::PartitionManagerType
template<typename CELL_TYPE >
typedef ParentType::PatchAccepterVec LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::PatchAccepterVec
template<typename CELL_TYPE >
typedef PatchBufferFixed<GridType, GridType, 1> LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::PatchBufferType1
template<typename CELL_TYPE >
typedef PatchBufferFixed<GridType, GridType, 2> LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::PatchBufferType2
template<typename CELL_TYPE >
typedef Stepper<CELL_TYPE>::Topology LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::Topology

Constructor & Destructor Documentation

template<typename CELL_TYPE >
LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::CUDAStepper ( boost::shared_ptr< PartitionManagerType partitionManager,
boost::shared_ptr< Initializer< CELL_TYPE > >  initializer,
const PatchAccepterVec ghostZonePatchAccepters = PatchAccepterVec(),
const PatchAccepterVec innerSetPatchAccepters = PatchAccepterVec() 
) [inline]

Member Function Documentation

template<typename CELL_TYPE >
const CUDARegion<DIM>& LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::deviceInnerSet ( unsigned  offset  )  const [inline, private]
template<typename CELL_TYPE >
void LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::initGrids (  )  [inline, private]
template<typename CELL_TYPE >
void LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::notifyPatchAcceptersGhostZones ( const Region< DIM > &  region,
std::size_t  nanoStep 
) [inline, private]
template<typename CELL_TYPE >
void LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::notifyPatchAcceptersInnerSet ( const Region< DIM > &  region,
std::size_t  nanoStep 
) [inline, private]
template<typename CELL_TYPE >
void LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::notifyPatchProvidersGhostZones ( const Region< DIM > &  region,
std::size_t  nanoStep 
) [inline, private]
template<typename CELL_TYPE >
void LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::notifyPatchProvidersInnerSet ( const Region< DIM > &  region,
std::size_t  nanoStep 
) [inline, private]
template<typename CELL_TYPE >
void LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::update1 (  )  [inline, private, virtual]
template<typename CELL_TYPE >
void LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::updateGhost (  )  [inline, private]

computes the next ghost zone at time "t_1 = globalNanoStep() + ghostZoneWidth()".

Expects that oldGrid has its kernel and its outer ghostzone updated to time "globalNanoStep()" and that the inner ghostzones (rim) at time t_1 can be retrieved from the internal patch buffer. Will leave oldgrid in a state so that its whole ownRegion() will be at time t_1 and the rim will be saved to the patchBuffer at "t2 = t1 + ghostZoneWidth()".

Referenced by LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::update1().


Friends And Related Function Documentation

template<typename CELL_TYPE >
friend class CUDAStepperBasicTest [friend]
template<typename CELL_TYPE >
friend class CUDAStepperRegionTest [friend]
template<typename CELL_TYPE >
friend class CUDAStepperTest [friend]

Member Data Documentation

template<typename CELL_TYPE >
std::vector<boost::shared_ptr<CUDARegion<DIM> > > LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::deviceInnerSets [private]
template<typename CELL_TYPE >
const int LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::DIM = Topology::DIM [static]
template<typename CELL_TYPE >
const unsigned LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::NANO_STEPS = APITraits::SelectNanoSteps<CELL_TYPE>::VALUE [static]
template<typename CELL_TYPE >
boost::shared_ptr<CUDAGridType> LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::newDeviceGrid [private]
template<typename CELL_TYPE >
boost::shared_ptr<CUDAGridType> LibGeoDecomp::HiParSimulator::CUDAStepper< CELL_TYPE >::oldDeviceGrid [private]

The documentation for this class was generated from the following file: