Graphitti
A toolkit/software architecture to ease creating high-performance neural network simulators
Loading...
Searching...
No Matches
GPUModel Class Reference
Inheritance diagram for GPUModel:
Collaboration diagram for GPUModel:

Public Member Functions

virtual void setupSim () override
 Set up model state, if anym for a specific simulation run.
 
virtual void finish () override
 Performs any finalization tasks on network following a simulation.
 
virtual void advance () override
 Advances network state one simulation step.
 
virtual void updateConnections () override
 Update the connection of all the vertices and edges of the simulation.
 
virtual void copyCPUtoGPU () override
 Allocate and Copy CPU Synapse data to GPU.
 
virtual void copyGPUtoCPU () override
 Prints debug information about the current state of the network.
 
void printGPUEdgesPropsModel () const
 Print out EdgeProps on the GPU.
 
AllEdgesDeviceProperties *& getAllEdgesDevice ()
 Getter for edge (synapse) structures in device memory.
 
AllVerticesDeviceProperties *& getAllVerticesDevice ()
 Getter for vertex (neuron) structures in device memory.
 
- Public Member Functions inherited from Model
 Model ()
 Constructor.
 
virtual ~Model ()=default
 Destructor.
 
ConnectionsgetConnections () const
 Returns reference to Connections.
 
LayoutgetLayout () const
 Returns reference to Layout.
 
RecordergetRecorder () const
 Returns reference to Recorder.
 
virtual void saveResults ()
 Save simulation results to an output destination.
 
template<class Archive >
void serialize (Archive &archive, std::uint32_t const version)
 Cereal serialization method.
 

Protected Member Functions

void allocDeviceStruct ()
 Allocates and initializes memories on CUDA device.
 
virtual void deleteDeviceStruct ()
 Deallocates device memories.
 
- Protected Member Functions inherited from Model
void createAllVertices ()
 Creates all the vertices and generates data for them.
 

Protected Attributes

float * randNoise_d
 Pointer to device random noise array.
 
AllEdgesDeviceProperties * allEdgesDevice_
 edge structures in device memory.
 
AllVerticesDeviceProperties * allVerticesDevice_
 vertex structure in device memory.
 
- Protected Attributes inherited from Model
unique_ptr< Connectionsconnections_
 
unique_ptr< Layoutlayout_
 
unique_ptr< Recorderrecorder_
 
log4cplus::Logger fileLogger_
 

Friends

class GpuSInputPoisson
 

Detailed Description

Definition at line 66 of file GPUModel.h.

Constructor & Destructor Documentation

◆ GPUModel()

GPUModel::GPUModel ( )

Definition at line 28 of file GPUModel.cpp.

Member Function Documentation

◆ advance()

void GPUModel::advance ( )
overridevirtual

Advances network state one simulation step.

Advance everything in the model one time step. In this case, that means calling all of the kernels that do the "micro step" updating (i.e., NOT the stuff associated with growth).

Implements Model.

Definition at line 138 of file GPUModel.cpp.

◆ allocDeviceStruct()

void GPUModel::allocDeviceStruct ( )
protected

Allocates and initializes memories on CUDA device.

Definition at line 52 of file GPUModel.cpp.

◆ copyCPUtoGPU()

void GPUModel::copyCPUtoGPU ( )
overridevirtual

Allocate and Copy CPU Synapse data to GPU.

Copies neuron and synapse data from CPU to GPU memory. TODO: Refactor this. Currently, GPUModel handles low-level memory transfer for vertices and edges. Consider moving this responsibility to a more appropriate class, such as a dedicated memory manager or the OperationManager, to better separate concerns and keep the model focused on high-level coordination.

Implements Model.

Definition at line 283 of file GPUModel.cpp.

◆ copyGPUtoCPU()

virtual void GPUModel::copyGPUtoCPU ( )
inlineoverridevirtual

Prints debug information about the current state of the network.

Copy GPU Edge data to CPU.

Implements Model.

Definition at line 95 of file GPUModel.h.

◆ deleteDeviceStruct()

void GPUModel::deleteDeviceStruct ( )
protectedvirtual

Deallocates device memories.

Copies device memories to host memories and deallocates them.

Definition at line 64 of file GPUModel.cpp.

◆ finish()

void GPUModel::finish ( )
overridevirtual

Performs any finalization tasks on network following a simulation.

Implements Model.

Definition at line 122 of file GPUModel.cpp.

◆ getAllEdgesDevice()

AllEdgesDeviceProperties *& GPUModel::getAllEdgesDevice ( )

Getter for edge (synapse) structures in device memory.

Getter for synapse structures in device memory.

Definition at line 342 of file GPUModel.cpp.

◆ getAllVerticesDevice()

AllVerticesDeviceProperties *& GPUModel::getAllVerticesDevice ( )

Getter for vertex (neuron) structures in device memory.

Getter for neuron structure in device memory.

Definition at line 336 of file GPUModel.cpp.

◆ printGPUEdgesPropsModel()

void GPUModel::printGPUEdgesPropsModel ( ) const

Print out EdgeProps on the GPU.

Definition at line 330 of file GPUModel.cpp.

◆ setupSim()

void GPUModel::setupSim ( )
overridevirtual

Set up model state, if anym for a specific simulation run.

Sets up the Simulation.

Reimplemented from Model.

Definition at line 81 of file GPUModel.cpp.

◆ updateConnections()

void GPUModel::updateConnections ( )
overridevirtual

Update the connection of all the vertices and edges of the simulation.

Modifies connections between vertices based on current state of the network and behavior over the past epoch. Should be called once every epoch.

Implements Model.

Definition at line 230 of file GPUModel.cpp.

Friends And Related Symbol Documentation

◆ GpuSInputPoisson

friend class GpuSInputPoisson
friend

Definition at line 67 of file GPUModel.h.

Member Data Documentation

◆ allEdgesDevice_

AllEdgesDeviceProperties* GPUModel::allEdgesDevice_
protected

edge structures in device memory.

Definition at line 124 of file GPUModel.h.

◆ allVerticesDevice_

AllVerticesDeviceProperties* GPUModel::allVerticesDevice_
protected

vertex structure in device memory.

Definition at line 127 of file GPUModel.h.

◆ randNoise_d

float* GPUModel::randNoise_d
protected

Pointer to device random noise array.

Definition at line 116 of file GPUModel.h.


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