Class MessageSpecialisationHandler

Inheritance Relationships

Derived Types

Class Documentation

class MessageSpecialisationHandler

Interface for message specialisation A derived implementation of this is required for each combination of message type (e.g. MessageBruteForce) and simulation type (e.g. CUDASimulation)

Note

It is recommended that derived classes require an object that provides access to the model specialisation’s representation of messages (e.g. CUDAMessage)

Note

: this is slightly CUDA aware. Future abstraction DevicePtr should be in a CUDANone message or similar.

Subclassed by flamegpu::MessageArray2D::CUDAModelHandler, flamegpu::MessageArray3D::CUDAModelHandler, flamegpu::MessageArray::CUDAModelHandler, flamegpu::MessageBruteForce::CUDAModelHandler, flamegpu::MessageBucket::CUDAModelHandler, flamegpu::MessageNone::CUDAModelHandler, flamegpu::MessageSpatial2D::CUDAModelHandler, flamegpu::MessageSpatial3D::CUDAModelHandler

Public Functions

inline MessageSpecialisationHandler()
inline virtual ~MessageSpecialisationHandler()

Destructor, should free any allocated memory in derived classes

virtual void init(detail::CUDAScatter &scatter, unsigned int streamId, cudaStream_t stream) = 0

Allocate and fill metadata, as though message list was empty

Parameters:
  • scatter – Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)

  • streamId – Index of stream specific structures used

  • stream – The CUDAStream to use for CUDA operations

inline virtual void buildIndex(detail::CUDAScatter &scatter, unsigned int streamId, cudaStream_t stream)

Constructs an index for the message data structure (e.g. Partition boundary matrix for spatial message types) This is called the first time messages are read, after new messages have been output

Parameters:
  • scatter – Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)

  • streamId – The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers

  • stream – The CUDAStream to use for CUDA operations

inline virtual void allocateMetaDataDevicePtr(cudaStream_t stream)

Allocates memory for the constructed index. The memory allocation is checked by build index.

inline virtual void freeMetaDataDevicePtr()

Releases memory for the constructed index.

inline virtual const void *getMetaDataDevicePtr() const

Returns a pointer to metadata for message access during agent functions (For CUDASimulation this is a device pointer)

Note

: this is slightly CUDA aware. Future abstraction this should be base CUDANone or similar.