GeNN  3.3.0
GPU enhanced Neuronal Networks (GeNN)
NeuronGroup Class Reference

#include <neuronGroup.h>

Public Member Functions

 NeuronGroup (const std::string &name, int numNeurons, const NeuronModels::Base *neuronModel, const std::vector< double > &params, const std::vector< NewModels::VarInit > &varInitialisers, int hostID, int deviceID)
 
 NeuronGroup (const NeuronGroup &)=delete
 
 NeuronGroup ()=delete
 
void checkNumDelaySlots (unsigned int requiredDelay)
 Checks delay slots currently provided by the neuron group against a required delay and extends if required. More...
 
void updatePreVarQueues (const std::string &code)
 Update which presynaptic variables require queues based on piece of code. More...
 
void updatePostVarQueues (const std::string &code)
 Update which postsynaptic variables require queues based on piece of code. More...
 
void setSpikeTimeRequired (bool req)
 
void setTrueSpikeRequired (bool req)
 
void setSpikeEventRequired (bool req)
 
void setSpikeZeroCopyEnabled (bool enabled)
 Function to enable the use of zero-copied memory for spikes (deprecated use NeuronGroup::setSpikeVarMode): More...
 
void setSpikeEventZeroCopyEnabled (bool enabled)
 Function to enable the use of zero-copied memory for spike-like events (deprecated use NeuronGroup::setSpikeEventVarMode): More...
 
void setSpikeTimeZeroCopyEnabled (bool enabled)
 Function to enable the use of zero-copied memory for spike times (deprecated use NeuronGroup::setSpikeTimeVarMode): More...
 
void setVarZeroCopyEnabled (const std::string &varName, bool enabled)
 Function to enable the use zero-copied memory for a particular state variable (deprecated use NeuronGroup::setVarMode): More...
 
void setSpikeVarMode (VarMode mode)
 Set variable mode used for variables containing this neuron group's output spikes. More...
 
void setSpikeEventVarMode (VarMode mode)
 Set variable mode used for variables containing this neuron group's output spike events. More...
 
void setSpikeTimeVarMode (VarMode mode)
 Set variable mode used for variables containing this neuron group's output spike times. More...
 
void setVarMode (const std::string &varName, VarMode mode)
 Set variable mode of neuron model state variable. More...
 
void addSpkEventCondition (const std::string &code, const std::string &supportCodeNamespace)
 
void addInSyn (SynapseGroup *synapseGroup)
 
void addOutSyn (SynapseGroup *synapseGroup)
 
void initDerivedParams (double dt)
 
void calcSizes (unsigned int blockSize, unsigned int &idStart, unsigned int &paddedIDStart)
 
void mergeIncomingPSM ()
 Merge incoming postsynaptic models. More...
 
void injectCurrent (CurrentSource *source)
 add input current source More...
 
const std::string & getName () const
 
unsigned int getNumNeurons () const
 Gets number of neurons in group. More...
 
const std::pair< unsigned int, unsigned int > & getPaddedIDRange () const
 
const std::pair< unsigned int, unsigned int > & getIDRange () const
 
const NeuronModels::BasegetNeuronModel () const
 Gets the neuron model used by this group. More...
 
const std::vector< double > & getParams () const
 
const std::vector< double > & getDerivedParams () const
 
const std::vector< NewModels::VarInit > & getVarInitialisers () const
 
const std::vector< SynapseGroup * > & getInSyn () const
 Gets pointers to all synapse groups which provide input to this neuron group. More...
 
const std::vector< std::pair< SynapseGroup *, std::vector< SynapseGroup * > > > & getMergedInSyn () const
 
const std::vector< SynapseGroup * > & getOutSyn () const
 Gets pointers to all synapse groups emanating from this neuron group. More...
 
const std::vector< CurrentSource * > & getCurrentSources () const
 Gets pointers to all current sources which provide input to this neuron group. More...
 
int getClusterHostID () const
 
int getClusterDeviceID () const
 
bool isSpikeTimeRequired () const
 
bool isTrueSpikeRequired () const
 
bool isSpikeEventRequired () const
 
bool isVarQueueRequired (const std::string &var) const
 
bool isVarQueueRequired (size_t index) const
 
const std::set< std::pair< std::string, std::string > > & getSpikeEventCondition () const
 
unsigned int getNumDelaySlots () const
 
bool isDelayRequired () const
 
bool isSpikeZeroCopyEnabled () const
 
bool isSpikeEventZeroCopyEnabled () const
 
bool isSpikeTimeZeroCopyEnabled () const
 
bool isZeroCopyEnabled () const
 
bool isVarZeroCopyEnabled (const std::string &var) const
 
VarMode getSpikeVarMode () const
 Get variable mode used for variables containing this neuron group's output spikes. More...
 
VarMode getSpikeEventVarMode () const
 Get variable mode used for variables containing this neuron group's output spike events. More...
 
VarMode getSpikeTimeVarMode () const
 Get variable mode used for variables containing this neuron group's output spike times. More...
 
VarMode getVarMode (const std::string &varName) const
 Get variable mode used by neuron model state variable. More...
 
VarMode getVarMode (size_t index) const
 Get variable mode used by neuron model state variable. More...
 
bool isParamRequiredBySpikeEventCondition (const std::string &pnamefull) const
 Do any of the spike event conditions tested by this neuron require specified parameter? More...
 
void addExtraGlobalParams (std::map< std::string, std::string > &kernelParameters) const
 
bool isInitCodeRequired () const
 Does this neuron group require any initialisation code to be run? More...
 
bool isSimRNGRequired () const
 Does this neuron group require an RNG to simulate? More...
 
bool isInitRNGRequired (VarInit varInitMode) const
 Does this neuron group require an RNG for it's init code? More...
 
bool isDeviceVarInitRequired () const
 Is device var init code required for any variables in this neuron group? More...
 
bool isDeviceInitRequired () const
 Is any form of device initialisation required? More...
 
bool canRunOnCPU () const
 Can this neuron group run on the CPU? More...
 
bool hasOutputToHost (int targetHostID) const
 Does this neuron group have outgoing connections specified host id? More...
 
std::string getCurrentQueueOffset (const std::string &devPrefix) const
 Get the expression to calculate the queue offset for accessing state of variables this timestep. More...
 
std::string getPrevQueueOffset (const std::string &devPrefix) const
 Get the expression to calculate the queue offset for accessing state of variables in previous timestep. More...
 

Constructor & Destructor Documentation

◆ NeuronGroup() [1/3]

NeuronGroup::NeuronGroup ( const std::string &  name,
int  numNeurons,
const NeuronModels::Base neuronModel,
const std::vector< double > &  params,
const std::vector< NewModels::VarInit > &  varInitialisers,
int  hostID,
int  deviceID 
)
inline

◆ NeuronGroup() [2/3]

NeuronGroup::NeuronGroup ( const NeuronGroup )
delete

◆ NeuronGroup() [3/3]

NeuronGroup::NeuronGroup ( )
delete

Member Function Documentation

◆ addExtraGlobalParams()

void NeuronGroup::addExtraGlobalParams ( std::map< std::string, std::string > &  kernelParameters) const

◆ addInSyn()

void NeuronGroup::addInSyn ( SynapseGroup synapseGroup)
inline

◆ addOutSyn()

void NeuronGroup::addOutSyn ( SynapseGroup synapseGroup)
inline

◆ addSpkEventCondition()

void NeuronGroup::addSpkEventCondition ( const std::string &  code,
const std::string &  supportCodeNamespace 
)

◆ calcSizes()

void NeuronGroup::calcSizes ( unsigned int  blockSize,
unsigned int &  idStart,
unsigned int &  paddedIDStart 
)

◆ canRunOnCPU()

bool NeuronGroup::canRunOnCPU ( ) const

Can this neuron group run on the CPU?

If we are running in CPU_ONLY mode this is always true, but some GPU functionality will prevent models being run on both CPU and GPU.

◆ checkNumDelaySlots()

void NeuronGroup::checkNumDelaySlots ( unsigned int  requiredDelay)

Checks delay slots currently provided by the neuron group against a required delay and extends if required.

◆ getClusterDeviceID()

int NeuronGroup::getClusterDeviceID ( ) const
inline

◆ getClusterHostID()

int NeuronGroup::getClusterHostID ( ) const
inline

◆ getCurrentQueueOffset()

std::string NeuronGroup::getCurrentQueueOffset ( const std::string &  devPrefix) const

Get the expression to calculate the queue offset for accessing state of variables this timestep.

◆ getCurrentSources()

const std::vector<CurrentSource*>& NeuronGroup::getCurrentSources ( ) const
inline

Gets pointers to all current sources which provide input to this neuron group.

◆ getDerivedParams()

const std::vector<double>& NeuronGroup::getDerivedParams ( ) const
inline

◆ getIDRange()

const std::pair<unsigned int, unsigned int>& NeuronGroup::getIDRange ( ) const
inline

◆ getInSyn()

const std::vector<SynapseGroup*>& NeuronGroup::getInSyn ( ) const
inline

Gets pointers to all synapse groups which provide input to this neuron group.

◆ getMergedInSyn()

const std::vector<std::pair<SynapseGroup*, std::vector<SynapseGroup*> > >& NeuronGroup::getMergedInSyn ( ) const
inline

◆ getName()

const std::string& NeuronGroup::getName ( ) const
inline

◆ getNeuronModel()

const NeuronModels::Base* NeuronGroup::getNeuronModel ( ) const
inline

Gets the neuron model used by this group.

◆ getNumDelaySlots()

unsigned int NeuronGroup::getNumDelaySlots ( ) const
inline

◆ getNumNeurons()

unsigned int NeuronGroup::getNumNeurons ( ) const
inline

Gets number of neurons in group.

◆ getOutSyn()

const std::vector<SynapseGroup*>& NeuronGroup::getOutSyn ( ) const
inline

Gets pointers to all synapse groups emanating from this neuron group.

◆ getPaddedIDRange()

const std::pair<unsigned int, unsigned int>& NeuronGroup::getPaddedIDRange ( ) const
inline

◆ getParams()

const std::vector<double>& NeuronGroup::getParams ( ) const
inline

◆ getPrevQueueOffset()

std::string NeuronGroup::getPrevQueueOffset ( const std::string &  devPrefix) const

Get the expression to calculate the queue offset for accessing state of variables in previous timestep.

◆ getSpikeEventCondition()

const std::set<std::pair<std::string, std::string> >& NeuronGroup::getSpikeEventCondition ( ) const
inline

◆ getSpikeEventVarMode()

VarMode NeuronGroup::getSpikeEventVarMode ( ) const
inline

Get variable mode used for variables containing this neuron group's output spike events.

◆ getSpikeTimeVarMode()

VarMode NeuronGroup::getSpikeTimeVarMode ( ) const
inline

Get variable mode used for variables containing this neuron group's output spike times.

◆ getSpikeVarMode()

VarMode NeuronGroup::getSpikeVarMode ( ) const
inline

Get variable mode used for variables containing this neuron group's output spikes.

◆ getVarInitialisers()

const std::vector<NewModels::VarInit>& NeuronGroup::getVarInitialisers ( ) const
inline

◆ getVarMode() [1/2]

VarMode NeuronGroup::getVarMode ( const std::string &  varName) const

Get variable mode used by neuron model state variable.

◆ getVarMode() [2/2]

VarMode NeuronGroup::getVarMode ( size_t  index) const
inline

Get variable mode used by neuron model state variable.

◆ hasOutputToHost()

bool NeuronGroup::hasOutputToHost ( int  targetHostID) const

Does this neuron group have outgoing connections specified host id?

◆ initDerivedParams()

void NeuronGroup::initDerivedParams ( double  dt)

◆ injectCurrent()

void NeuronGroup::injectCurrent ( CurrentSource source)

add input current source

◆ isDelayRequired()

bool NeuronGroup::isDelayRequired ( ) const
inline

◆ isDeviceInitRequired()

bool NeuronGroup::isDeviceInitRequired ( ) const

Is any form of device initialisation required?

◆ isDeviceVarInitRequired()

bool NeuronGroup::isDeviceVarInitRequired ( ) const

Is device var init code required for any variables in this neuron group?

◆ isInitCodeRequired()

bool NeuronGroup::isInitCodeRequired ( ) const

Does this neuron group require any initialisation code to be run?

◆ isInitRNGRequired()

bool NeuronGroup::isInitRNGRequired ( VarInit  varInitMode) const

Does this neuron group require an RNG for it's init code?

◆ isParamRequiredBySpikeEventCondition()

bool NeuronGroup::isParamRequiredBySpikeEventCondition ( const std::string &  pnamefull) const

Do any of the spike event conditions tested by this neuron require specified parameter?

◆ isSimRNGRequired()

bool NeuronGroup::isSimRNGRequired ( ) const

Does this neuron group require an RNG to simulate?

◆ isSpikeEventRequired()

bool NeuronGroup::isSpikeEventRequired ( ) const
inline

◆ isSpikeEventZeroCopyEnabled()

bool NeuronGroup::isSpikeEventZeroCopyEnabled ( ) const
inline

◆ isSpikeTimeRequired()

bool NeuronGroup::isSpikeTimeRequired ( ) const
inline

◆ isSpikeTimeZeroCopyEnabled()

bool NeuronGroup::isSpikeTimeZeroCopyEnabled ( ) const
inline

◆ isSpikeZeroCopyEnabled()

bool NeuronGroup::isSpikeZeroCopyEnabled ( ) const
inline

◆ isTrueSpikeRequired()

bool NeuronGroup::isTrueSpikeRequired ( ) const
inline

◆ isVarQueueRequired() [1/2]

bool NeuronGroup::isVarQueueRequired ( const std::string &  var) const

◆ isVarQueueRequired() [2/2]

bool NeuronGroup::isVarQueueRequired ( size_t  index) const
inline

◆ isVarZeroCopyEnabled()

bool NeuronGroup::isVarZeroCopyEnabled ( const std::string &  var) const
inline

◆ isZeroCopyEnabled()

bool NeuronGroup::isZeroCopyEnabled ( ) const

◆ mergeIncomingPSM()

void NeuronGroup::mergeIncomingPSM ( )

Merge incoming postsynaptic models.

◆ setSpikeEventRequired()

void NeuronGroup::setSpikeEventRequired ( bool  req)
inline

◆ setSpikeEventVarMode()

void NeuronGroup::setSpikeEventVarMode ( VarMode  mode)
inline

Set variable mode used for variables containing this neuron group's output spike events.

This is ignored for CPU simulations

◆ setSpikeEventZeroCopyEnabled()

void NeuronGroup::setSpikeEventZeroCopyEnabled ( bool  enabled)
inline

Function to enable the use of zero-copied memory for spike-like events (deprecated use NeuronGroup::setSpikeEventVarMode):

May improve IO performance at the expense of kernel performance

◆ setSpikeTimeRequired()

void NeuronGroup::setSpikeTimeRequired ( bool  req)
inline

◆ setSpikeTimeVarMode()

void NeuronGroup::setSpikeTimeVarMode ( VarMode  mode)
inline

Set variable mode used for variables containing this neuron group's output spike times.

This is ignored for CPU simulations

◆ setSpikeTimeZeroCopyEnabled()

void NeuronGroup::setSpikeTimeZeroCopyEnabled ( bool  enabled)
inline

Function to enable the use of zero-copied memory for spike times (deprecated use NeuronGroup::setSpikeTimeVarMode):

May improve IO performance at the expense of kernel performance

◆ setSpikeVarMode()

void NeuronGroup::setSpikeVarMode ( VarMode  mode)
inline

Set variable mode used for variables containing this neuron group's output spikes.

This is ignored for CPU simulations

◆ setSpikeZeroCopyEnabled()

void NeuronGroup::setSpikeZeroCopyEnabled ( bool  enabled)
inline

Function to enable the use of zero-copied memory for spikes (deprecated use NeuronGroup::setSpikeVarMode):

May improve IO performance at the expense of kernel performance

◆ setTrueSpikeRequired()

void NeuronGroup::setTrueSpikeRequired ( bool  req)
inline

◆ setVarMode()

void NeuronGroup::setVarMode ( const std::string &  varName,
VarMode  mode 
)

Set variable mode of neuron model state variable.

This is ignored for CPU simulations

◆ setVarZeroCopyEnabled()

void NeuronGroup::setVarZeroCopyEnabled ( const std::string &  varName,
bool  enabled 
)
inline

Function to enable the use zero-copied memory for a particular state variable (deprecated use NeuronGroup::setVarMode):

May improve IO performance at the expense of kernel performance

◆ updatePostVarQueues()

void NeuronGroup::updatePostVarQueues ( const std::string &  code)

Update which postsynaptic variables require queues based on piece of code.

◆ updatePreVarQueues()

void NeuronGroup::updatePreVarQueues ( const std::string &  code)

Update which presynaptic variables require queues based on piece of code.


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