Class MessageSpatial2D::CUDAModelHandler

Nested Relationships

This class is a nested type of Class MessageSpatial2D.

Inheritance Relationships

Base Type

Class Documentation

class CUDAModelHandler : public flamegpu::MessageSpecialisationHandler

CUDA host side handler of spatial messages Allocates memory for and constructs PBM

Public Functions

explicit CUDAModelHandler(detail::CUDAMessage &a)

Constructor

Initialises metadata, decides PBM size etc

Parameters:

a – Parent CUDAMessage, used to access message settings, data ptrs etc

~CUDAModelHandler() override

Destructor Frees all alocated memory

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

Allocates memory for the constructed index. Sets data asthough message list is 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

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

Reconstructs the partition boundary matrix This should be called before reading newly output messages

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

virtual void allocateMetaDataDevicePtr(cudaStream_t stream) override

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

virtual void freeMetaDataDevicePtr() override

Releases memory for the constructed index.

inline virtual const void *getMetaDataDevicePtr() const override

Returns a pointer to the metadata struct, this is required for reading the message data