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

#include <synapseGroup.h>

Public Types

enum  SpanType { SpanType::POSTSYNAPTIC, SpanType::PRESYNAPTIC }
 

Public Member Functions

 SynapseGroup (const std::string name, SynapseMatrixType matrixType, unsigned int delaySteps, const WeightUpdateModels::Base *wu, const std::vector< double > &wuParams, const std::vector< NewModels::VarInit > &wuVarInitialisers, const std::vector< NewModels::VarInit > &wuPreVarInitialisers, const std::vector< NewModels::VarInit > &wuPostVarInitialisers, const PostsynapticModels::Base *ps, const std::vector< double > &psParams, const std::vector< NewModels::VarInit > &psVarInitialisers, NeuronGroup *srcNeuronGroup, NeuronGroup *trgNeuronGroup, const InitSparseConnectivitySnippet::Init &connectivityInitialiser)
 
 SynapseGroup (const SynapseGroup &)=delete
 
 SynapseGroup ()=delete
 
NeuronGroupgetSrcNeuronGroup ()
 
NeuronGroupgetTrgNeuronGroup ()
 
void setTrueSpikeRequired (bool req)
 
void setSpikeEventRequired (bool req)
 
void setEventThresholdReTestRequired (bool req)
 
void setPSModelMergeTarget (const std::string &targetName)
 Function to enable the use of zero-copied memory for a particular weight update model state variable (deprecated use SynapseGroup::setWUVarMode): More...
 
void setWUVarZeroCopyEnabled (const std::string &varName, bool enabled)
 Function to enable the use zero-copied memory for a particular postsynaptic model state variable (deprecated use SynapseGroup::setWUVarMode) More...
 
void setPSVarZeroCopyEnabled (const std::string &varName, bool enabled)
 
void setWUVarMode (const std::string &varName, VarMode mode)
 Set variable mode of weight update model state variable. More...
 
void setWUPreVarMode (const std::string &varName, VarMode mode)
 Set variable mode of weight update model presynaptic state variable. More...
 
void setWUPostVarMode (const std::string &varName, VarMode mode)
 Set variable mode of weight update model postsynaptic state variable. More...
 
void setPSVarMode (const std::string &varName, VarMode mode)
 Set variable mode of postsynaptic model state variable. More...
 
void setInSynVarMode (VarMode mode)
 Set variable mode used for variables used to combine input from this synapse group. More...
 
void setSparseConnectivityVarMode (VarMode mode)
 Set variable mode used for sparse connectivity. More...
 
void setDendriticDelayVarMode (VarMode mode)
 Set variable mode used for this synapse group's dendritic delay buffers. More...
 
void setMaxConnections (unsigned int maxConnections)
 Sets the maximum number of target neurons any source neurons can connect to. More...
 
void setMaxSourceConnections (unsigned int maxPostConnections)
 Sets the maximum number of source neurons any target neuron can connect to. More...
 
void setMaxDendriticDelayTimesteps (unsigned int maxDendriticDelay)
 Sets the maximum dendritic delay for synapses in this synapse group. More...
 
void setSpanType (SpanType spanType)
 Set how CUDA implementation is parallelised. More...
 
void setBackPropDelaySteps (unsigned int timesteps)
 Sets the number of delay steps used to delay postsynaptic spikes travelling back along dendrites to synapses. More...
 
void initDerivedParams (double dt)
 
void calcKernelSizes (unsigned int blockSize, unsigned int &paddedKernelIDStart)
 
std::pair< unsigned int, unsigned int > getPaddedKernelIDRange () const
 
const std::string & getName () const
 
SpanType getSpanType () const
 
unsigned int getDelaySteps () const
 
unsigned int getBackPropDelaySteps () const
 
unsigned int getMaxConnections () const
 
unsigned int getMaxSourceConnections () const
 
unsigned int getMaxDendriticDelayTimesteps () const
 
SynapseMatrixType getMatrixType () const
 
VarMode getInSynVarMode () const
 Get variable mode used for variables used to combine input from this synapse group. More...
 
VarMode getSparseConnectivityVarMode () const
 Get variable mode used for sparse connectivity. More...
 
VarMode getDendriticDelayVarMode () const
 Get variable mode used for this synapse group's dendritic delay buffers. More...
 
unsigned int getPaddedDynKernelSize (unsigned int blockSize) const
 
unsigned int getPaddedPostLearnKernelSize (unsigned int blockSize) const
 
const NeuronGroupgetSrcNeuronGroup () const
 
const NeuronGroupgetTrgNeuronGroup () const
 
int getClusterHostID () const
 
int getClusterDeviceID () const
 
bool isTrueSpikeRequired () const
 
bool isSpikeEventRequired () const
 
bool isEventThresholdReTestRequired () const
 
const WeightUpdateModels::BasegetWUModel () const
 
const std::vector< double > & getWUParams () const
 
const std::vector< double > & getWUDerivedParams () const
 
const std::vector< NewModels::VarInit > & getWUVarInitialisers () const
 
const std::vector< NewModels::VarInit > & getWUPreVarInitialisers () const
 
const std::vector< NewModels::VarInit > & getWUPostVarInitialisers () const
 
const std::vector< double > getWUConstInitVals () const
 
const PostsynapticModels::BasegetPSModel () const
 
const std::vector< double > & getPSParams () const
 
const std::vector< double > & getPSDerivedParams () const
 
const std::vector< NewModels::VarInit > & getPSVarInitialisers () const
 
const std::vector< double > getPSConstInitVals () const
 
const InitSparseConnectivitySnippet::InitgetConnectivityInitialiser () const
 
const std::string & getPSModelTargetName () const
 
bool isPSModelMerged () const
 
bool isZeroCopyEnabled () const
 
bool isWUVarZeroCopyEnabled (const std::string &var) const
 
bool isPSVarZeroCopyEnabled (const std::string &var) const
 
VarMode getWUVarMode (const std::string &var) const
 Get variable mode used by weight update model per-synapse state variable. More...
 
VarMode getWUVarMode (size_t index) const
 Get variable mode used by weight update model per-synapse state variable. More...
 
VarMode getWUPreVarMode (const std::string &var) const
 Get variable mode used by weight update model presynaptic state variable. More...
 
VarMode getWUPreVarMode (size_t index) const
 Get variable mode used by weight update model presynaptic state variable. More...
 
VarMode getWUPostVarMode (const std::string &var) const
 Get variable mode used by weight update model postsynaptic state variable. More...
 
VarMode getWUPostVarMode (size_t index) const
 Get variable mode used by weight update model postsynaptic state variable. More...
 
VarMode getPSVarMode (const std::string &var) const
 Get variable mode used by postsynaptic model state variable. More...
 
VarMode getPSVarMode (size_t index) const
 Get variable mode used by postsynaptic model state variable. More...
 
void addExtraGlobalConnectivityInitialiserParams (std::map< string, string > &kernelParameters) const
 
void addExtraGlobalNeuronParams (std::map< string, string > &kernelParameters) const
 
void addExtraGlobalSynapseParams (std::map< string, string > &kernelParameters) const
 
void addExtraGlobalPostLearnParams (std::map< string, string > &kernelParameters) const
 
void addExtraGlobalSynapseDynamicsParams (std::map< string, string > &kernelParameters) const
 
std::string getPresynapticAxonalDelaySlot (const std::string &devPrefix) const
 
std::string getPostsynapticBackPropDelaySlot (const std::string &devPrefix) const
 
std::string getDendriticDelayOffset (const std::string &devPrefix, const std::string &offset="") const
 
bool isDendriticDelayRequired () const
 Does this synapse group require dendritic delay? More...
 
bool isPSInitRNGRequired (VarInit varInitMode) const
 Does this synapse group require an RNG for it's postsynaptic init code? More...
 
bool isWUInitRNGRequired (VarInit varInitMode) const
 Does this synapse group require an RNG for it's weight update init code? More...
 
bool isPSDeviceVarInitRequired () const
 Is device var init code required for any variables in this synapse group's postsynaptic model? More...
 
bool isWUDeviceVarInitRequired () const
 Is device var init code required for any variables in this synapse group's weight update model? More...
 
bool isWUDevicePreVarInitRequired () const
 Is device var init code required for any presynaptic variables in this synapse group's weight update model. More...
 
bool isWUDevicePostVarInitRequired () const
 Is device var init code required for any postsynaptic variables in this synapse group's weight update model. More...
 
bool isDeviceSparseConnectivityInitRequired () const
 Is device sparse connectivity initialisation code required for this synapse group? More...
 
bool isDeviceInitRequired () const
 Is any form of device initialisation required? More...
 
bool isDeviceSparseInitRequired () const
 Is any form of sparse device initialisation required? More...
 
bool canRunOnCPU () const
 Can this synapse group run on the CPU? More...
 

Member Enumeration Documentation

◆ SpanType

Enumerator
POSTSYNAPTIC 
PRESYNAPTIC 

Constructor & Destructor Documentation

◆ SynapseGroup() [1/3]

SynapseGroup::SynapseGroup ( const std::string  name,
SynapseMatrixType  matrixType,
unsigned int  delaySteps,
const WeightUpdateModels::Base wu,
const std::vector< double > &  wuParams,
const std::vector< NewModels::VarInit > &  wuVarInitialisers,
const std::vector< NewModels::VarInit > &  wuPreVarInitialisers,
const std::vector< NewModels::VarInit > &  wuPostVarInitialisers,
const PostsynapticModels::Base ps,
const std::vector< double > &  psParams,
const std::vector< NewModels::VarInit > &  psVarInitialisers,
NeuronGroup srcNeuronGroup,
NeuronGroup trgNeuronGroup,
const InitSparseConnectivitySnippet::Init connectivityInitialiser 
)

◆ SynapseGroup() [2/3]

SynapseGroup::SynapseGroup ( const SynapseGroup )
delete

◆ SynapseGroup() [3/3]

SynapseGroup::SynapseGroup ( )
delete

Member Function Documentation

◆ addExtraGlobalConnectivityInitialiserParams()

void SynapseGroup::addExtraGlobalConnectivityInitialiserParams ( std::map< string, string > &  kernelParameters) const

◆ addExtraGlobalNeuronParams()

void SynapseGroup::addExtraGlobalNeuronParams ( std::map< string, string > &  kernelParameters) const

◆ addExtraGlobalPostLearnParams()

void SynapseGroup::addExtraGlobalPostLearnParams ( std::map< string, string > &  kernelParameters) const

◆ addExtraGlobalSynapseDynamicsParams()

void SynapseGroup::addExtraGlobalSynapseDynamicsParams ( std::map< string, string > &  kernelParameters) const

◆ addExtraGlobalSynapseParams()

void SynapseGroup::addExtraGlobalSynapseParams ( std::map< string, string > &  kernelParameters) const

◆ calcKernelSizes()

void SynapseGroup::calcKernelSizes ( unsigned int  blockSize,
unsigned int &  paddedKernelIDStart 
)

◆ canRunOnCPU()

bool SynapseGroup::canRunOnCPU ( ) const

Can this synapse 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.

◆ getBackPropDelaySteps()

unsigned int SynapseGroup::getBackPropDelaySteps ( ) const
inline

◆ getClusterDeviceID()

int SynapseGroup::getClusterDeviceID ( ) const
inline

◆ getClusterHostID()

int SynapseGroup::getClusterHostID ( ) const
inline

◆ getConnectivityInitialiser()

const InitSparseConnectivitySnippet::Init& SynapseGroup::getConnectivityInitialiser ( ) const
inline

◆ getDelaySteps()

unsigned int SynapseGroup::getDelaySteps ( ) const
inline

◆ getDendriticDelayOffset()

std::string SynapseGroup::getDendriticDelayOffset ( const std::string &  devPrefix,
const std::string &  offset = "" 
) const

◆ getDendriticDelayVarMode()

VarMode SynapseGroup::getDendriticDelayVarMode ( ) const
inline

Get variable mode used for this synapse group's dendritic delay buffers.

◆ getInSynVarMode()

VarMode SynapseGroup::getInSynVarMode ( ) const
inline

Get variable mode used for variables used to combine input from this synapse group.

◆ getMatrixType()

SynapseMatrixType SynapseGroup::getMatrixType ( ) const
inline

◆ getMaxConnections()

unsigned int SynapseGroup::getMaxConnections ( ) const
inline

◆ getMaxDendriticDelayTimesteps()

unsigned int SynapseGroup::getMaxDendriticDelayTimesteps ( ) const
inline

◆ getMaxSourceConnections()

unsigned int SynapseGroup::getMaxSourceConnections ( ) const
inline

◆ getName()

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

◆ getPaddedDynKernelSize()

unsigned int SynapseGroup::getPaddedDynKernelSize ( unsigned int  blockSize) const

◆ getPaddedKernelIDRange()

std::pair<unsigned int, unsigned int> SynapseGroup::getPaddedKernelIDRange ( ) const
inline

◆ getPaddedPostLearnKernelSize()

unsigned int SynapseGroup::getPaddedPostLearnKernelSize ( unsigned int  blockSize) const

◆ getPostsynapticBackPropDelaySlot()

std::string SynapseGroup::getPostsynapticBackPropDelaySlot ( const std::string &  devPrefix) const

Get the expression to calculate the delay slot for accessing Postsynaptic neuron state variables, taking into account back propagation delay

◆ getPresynapticAxonalDelaySlot()

std::string SynapseGroup::getPresynapticAxonalDelaySlot ( const std::string &  devPrefix) const

Get the expression to calculate the delay slot for accessing Presynaptic neuron state variables, taking into account axonal delay

◆ getPSConstInitVals()

const std::vector< double > SynapseGroup::getPSConstInitVals ( ) const

◆ getPSDerivedParams()

const std::vector<double>& SynapseGroup::getPSDerivedParams ( ) const
inline

◆ getPSModel()

const PostsynapticModels::Base* SynapseGroup::getPSModel ( ) const
inline

◆ getPSModelTargetName()

const std::string& SynapseGroup::getPSModelTargetName ( ) const
inline

◆ getPSParams()

const std::vector<double>& SynapseGroup::getPSParams ( ) const
inline

◆ getPSVarInitialisers()

const std::vector<NewModels::VarInit>& SynapseGroup::getPSVarInitialisers ( ) const
inline

◆ getPSVarMode() [1/2]

VarMode SynapseGroup::getPSVarMode ( const std::string &  var) const

Get variable mode used by postsynaptic model state variable.

◆ getPSVarMode() [2/2]

VarMode SynapseGroup::getPSVarMode ( size_t  index) const
inline

Get variable mode used by postsynaptic model state variable.

◆ getSpanType()

SpanType SynapseGroup::getSpanType ( ) const
inline

◆ getSparseConnectivityVarMode()

VarMode SynapseGroup::getSparseConnectivityVarMode ( ) const
inline

Get variable mode used for sparse connectivity.

◆ getSrcNeuronGroup() [1/2]

NeuronGroup* SynapseGroup::getSrcNeuronGroup ( )
inline

◆ getSrcNeuronGroup() [2/2]

const NeuronGroup* SynapseGroup::getSrcNeuronGroup ( ) const
inline

◆ getTrgNeuronGroup() [1/2]

NeuronGroup* SynapseGroup::getTrgNeuronGroup ( )
inline

◆ getTrgNeuronGroup() [2/2]

const NeuronGroup* SynapseGroup::getTrgNeuronGroup ( ) const
inline

◆ getWUConstInitVals()

const std::vector< double > SynapseGroup::getWUConstInitVals ( ) const

◆ getWUDerivedParams()

const std::vector<double>& SynapseGroup::getWUDerivedParams ( ) const
inline

◆ getWUModel()

const WeightUpdateModels::Base* SynapseGroup::getWUModel ( ) const
inline

◆ getWUParams()

const std::vector<double>& SynapseGroup::getWUParams ( ) const
inline

◆ getWUPostVarInitialisers()

const std::vector<NewModels::VarInit>& SynapseGroup::getWUPostVarInitialisers ( ) const
inline

◆ getWUPostVarMode() [1/2]

VarMode SynapseGroup::getWUPostVarMode ( const std::string &  var) const

Get variable mode used by weight update model postsynaptic state variable.

◆ getWUPostVarMode() [2/2]

VarMode SynapseGroup::getWUPostVarMode ( size_t  index) const
inline

Get variable mode used by weight update model postsynaptic state variable.

◆ getWUPreVarInitialisers()

const std::vector<NewModels::VarInit>& SynapseGroup::getWUPreVarInitialisers ( ) const
inline

◆ getWUPreVarMode() [1/2]

VarMode SynapseGroup::getWUPreVarMode ( const std::string &  var) const

Get variable mode used by weight update model presynaptic state variable.

◆ getWUPreVarMode() [2/2]

VarMode SynapseGroup::getWUPreVarMode ( size_t  index) const
inline

Get variable mode used by weight update model presynaptic state variable.

◆ getWUVarInitialisers()

const std::vector<NewModels::VarInit>& SynapseGroup::getWUVarInitialisers ( ) const
inline

◆ getWUVarMode() [1/2]

VarMode SynapseGroup::getWUVarMode ( const std::string &  var) const

Get variable mode used by weight update model per-synapse state variable.

◆ getWUVarMode() [2/2]

VarMode SynapseGroup::getWUVarMode ( size_t  index) const
inline

Get variable mode used by weight update model per-synapse state variable.

◆ initDerivedParams()

void SynapseGroup::initDerivedParams ( double  dt)

◆ isDendriticDelayRequired()

bool SynapseGroup::isDendriticDelayRequired ( ) const

Does this synapse group require dendritic delay?

◆ isDeviceInitRequired()

bool SynapseGroup::isDeviceInitRequired ( ) const

Is any form of device initialisation required?

◆ isDeviceSparseConnectivityInitRequired()

bool SynapseGroup::isDeviceSparseConnectivityInitRequired ( ) const

Is device sparse connectivity initialisation code required for this synapse group?

◆ isDeviceSparseInitRequired()

bool SynapseGroup::isDeviceSparseInitRequired ( ) const

Is any form of sparse device initialisation required?

◆ isEventThresholdReTestRequired()

bool SynapseGroup::isEventThresholdReTestRequired ( ) const
inline

◆ isPSDeviceVarInitRequired()

bool SynapseGroup::isPSDeviceVarInitRequired ( ) const

Is device var init code required for any variables in this synapse group's postsynaptic model?

◆ isPSInitRNGRequired()

bool SynapseGroup::isPSInitRNGRequired ( VarInit  varInitMode) const

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

◆ isPSModelMerged()

bool SynapseGroup::isPSModelMerged ( ) const
inline

◆ isPSVarZeroCopyEnabled()

bool SynapseGroup::isPSVarZeroCopyEnabled ( const std::string &  var) const
inline

◆ isSpikeEventRequired()

bool SynapseGroup::isSpikeEventRequired ( ) const
inline

◆ isTrueSpikeRequired()

bool SynapseGroup::isTrueSpikeRequired ( ) const
inline

◆ isWUDevicePostVarInitRequired()

bool SynapseGroup::isWUDevicePostVarInitRequired ( ) const

Is device var init code required for any postsynaptic variables in this synapse group's weight update model.

◆ isWUDevicePreVarInitRequired()

bool SynapseGroup::isWUDevicePreVarInitRequired ( ) const

Is device var init code required for any presynaptic variables in this synapse group's weight update model.

◆ isWUDeviceVarInitRequired()

bool SynapseGroup::isWUDeviceVarInitRequired ( ) const

Is device var init code required for any variables in this synapse group's weight update model?

◆ isWUInitRNGRequired()

bool SynapseGroup::isWUInitRNGRequired ( VarInit  varInitMode) const

Does this synapse group require an RNG for it's weight update init code?

◆ isWUVarZeroCopyEnabled()

bool SynapseGroup::isWUVarZeroCopyEnabled ( const std::string &  var) const
inline

◆ isZeroCopyEnabled()

bool SynapseGroup::isZeroCopyEnabled ( ) const

◆ setBackPropDelaySteps()

void SynapseGroup::setBackPropDelaySteps ( unsigned int  timesteps)

Sets the number of delay steps used to delay postsynaptic spikes travelling back along dendrites to synapses.

◆ setDendriticDelayVarMode()

void SynapseGroup::setDendriticDelayVarMode ( VarMode  mode)
inline

Set variable mode used for this synapse group's dendritic delay buffers.

This is ignored for CPU simulations

◆ setEventThresholdReTestRequired()

void SynapseGroup::setEventThresholdReTestRequired ( bool  req)
inline

◆ setInSynVarMode()

void SynapseGroup::setInSynVarMode ( VarMode  mode)
inline

Set variable mode used for variables used to combine input from this synapse group.

This is ignored for CPU simulations

◆ setMaxConnections()

void SynapseGroup::setMaxConnections ( unsigned int  maxConnections)

Sets the maximum number of target neurons any source neurons can connect to.

Use with synaptic matrix types with SynapseMatrixConnectivity::SPARSE to optimise CUDA implementation

◆ setMaxDendriticDelayTimesteps()

void SynapseGroup::setMaxDendriticDelayTimesteps ( unsigned int  maxDendriticDelay)

Sets the maximum dendritic delay for synapses in this synapse group.

◆ setMaxSourceConnections()

void SynapseGroup::setMaxSourceConnections ( unsigned int  maxPostConnections)

Sets the maximum number of source neurons any target neuron can connect to.

Use with synaptic matrix types with SynapseMatrixConnectivity::SPARSE and postsynaptic learning to optimise CUDA implementation

◆ setPSModelMergeTarget()

void SynapseGroup::setPSModelMergeTarget ( const std::string &  targetName)
inline

Function to enable the use of zero-copied memory for a particular weight update model state variable (deprecated use SynapseGroup::setWUVarMode):

◆ setPSVarMode()

void SynapseGroup::setPSVarMode ( const std::string &  varName,
VarMode  mode 
)

Set variable mode of postsynaptic model state variable.

This is ignored for CPU simulations

◆ setPSVarZeroCopyEnabled()

void SynapseGroup::setPSVarZeroCopyEnabled ( const std::string &  varName,
bool  enabled 
)
inline

May improve IO performance at the expense of kernel performance

◆ setSpanType()

void SynapseGroup::setSpanType ( SpanType  spanType)

Set how CUDA implementation is parallelised.

with a thread per target neuron (default) or a thread per source spike

◆ setSparseConnectivityVarMode()

void SynapseGroup::setSparseConnectivityVarMode ( VarMode  mode)
inline

Set variable mode used for sparse connectivity.

This is ignored for CPU simulations

◆ setSpikeEventRequired()

void SynapseGroup::setSpikeEventRequired ( bool  req)
inline

◆ setTrueSpikeRequired()

void SynapseGroup::setTrueSpikeRequired ( bool  req)
inline

◆ setWUPostVarMode()

void SynapseGroup::setWUPostVarMode ( const std::string &  varName,
VarMode  mode 
)

Set variable mode of weight update model postsynaptic state variable.

This is ignored for CPU simulations

◆ setWUPreVarMode()

void SynapseGroup::setWUPreVarMode ( const std::string &  varName,
VarMode  mode 
)

Set variable mode of weight update model presynaptic state variable.

This is ignored for CPU simulations

◆ setWUVarMode()

void SynapseGroup::setWUVarMode ( const std::string &  varName,
VarMode  mode 
)

Set variable mode of weight update model state variable.

This is ignored for CPU simulations

◆ setWUVarZeroCopyEnabled()

void SynapseGroup::setWUVarZeroCopyEnabled ( const std::string &  varName,
bool  enabled 
)
inline

Function to enable the use zero-copied memory for a particular postsynaptic model state variable (deprecated use SynapseGroup::setWUVarMode)

May improve IO performance at the expense of kernel performance


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