GeNN
3.3.0
GPU enhanced Neuronal Networks (GeNN)
|
#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 | |
NeuronGroup * | getSrcNeuronGroup () |
NeuronGroup * | getTrgNeuronGroup () |
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 NeuronGroup * | getSrcNeuronGroup () const |
const NeuronGroup * | getTrgNeuronGroup () const |
int | getClusterHostID () const |
int | getClusterDeviceID () const |
bool | isTrueSpikeRequired () const |
bool | isSpikeEventRequired () const |
bool | isEventThresholdReTestRequired () const |
const WeightUpdateModels::Base * | getWUModel () 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::Base * | getPSModel () 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::Init & | getConnectivityInitialiser () 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... | |
|
strong |
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 | ||
) |
|
delete |
|
delete |
void SynapseGroup::addExtraGlobalConnectivityInitialiserParams | ( | std::map< string, string > & | kernelParameters | ) | const |
void SynapseGroup::addExtraGlobalNeuronParams | ( | std::map< string, string > & | kernelParameters | ) | const |
void SynapseGroup::addExtraGlobalPostLearnParams | ( | std::map< string, string > & | kernelParameters | ) | const |
void SynapseGroup::addExtraGlobalSynapseDynamicsParams | ( | std::map< string, string > & | kernelParameters | ) | const |
void SynapseGroup::addExtraGlobalSynapseParams | ( | std::map< string, string > & | kernelParameters | ) | const |
void SynapseGroup::calcKernelSizes | ( | unsigned int | blockSize, |
unsigned int & | paddedKernelIDStart | ||
) |
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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::string SynapseGroup::getDendriticDelayOffset | ( | const std::string & | devPrefix, |
const std::string & | offset = "" |
||
) | const |
|
inline |
Get variable mode used for this synapse group's dendritic delay buffers.
|
inline |
Get variable mode used for variables used to combine input from this synapse group.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
unsigned int SynapseGroup::getPaddedDynKernelSize | ( | unsigned int | blockSize | ) | const |
|
inline |
unsigned int SynapseGroup::getPaddedPostLearnKernelSize | ( | unsigned int | blockSize | ) | const |
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
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
const std::vector< double > SynapseGroup::getPSConstInitVals | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
VarMode SynapseGroup::getPSVarMode | ( | const std::string & | var | ) | const |
Get variable mode used by postsynaptic model state variable.
|
inline |
Get variable mode used by postsynaptic model state variable.
|
inline |
|
inline |
Get variable mode used for sparse connectivity.
|
inline |
|
inline |
|
inline |
|
inline |
const std::vector< double > SynapseGroup::getWUConstInitVals | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
VarMode SynapseGroup::getWUPostVarMode | ( | const std::string & | var | ) | const |
Get variable mode used by weight update model postsynaptic state variable.
|
inline |
Get variable mode used by weight update model postsynaptic state variable.
|
inline |
VarMode SynapseGroup::getWUPreVarMode | ( | const std::string & | var | ) | const |
Get variable mode used by weight update model presynaptic state variable.
|
inline |
Get variable mode used by weight update model presynaptic state variable.
|
inline |
VarMode SynapseGroup::getWUVarMode | ( | const std::string & | var | ) | const |
Get variable mode used by weight update model per-synapse state variable.
|
inline |
Get variable mode used by weight update model per-synapse state variable.
void SynapseGroup::initDerivedParams | ( | double | dt | ) |
bool SynapseGroup::isDendriticDelayRequired | ( | ) | const |
Does this synapse group require dendritic delay?
bool SynapseGroup::isDeviceInitRequired | ( | ) | const |
Is any form of device initialisation required?
bool SynapseGroup::isDeviceSparseConnectivityInitRequired | ( | ) | const |
Is device sparse connectivity initialisation code required for this synapse group?
bool SynapseGroup::isDeviceSparseInitRequired | ( | ) | const |
Is any form of sparse device initialisation required?
|
inline |
bool SynapseGroup::isPSDeviceVarInitRequired | ( | ) | const |
Is device var init code required for any variables in this synapse group's postsynaptic model?
bool SynapseGroup::isPSInitRNGRequired | ( | VarInit | varInitMode | ) | const |
Does this synapse group require an RNG for it's postsynaptic init code?
|
inline |
|
inline |
|
inline |
|
inline |
bool SynapseGroup::isWUDevicePostVarInitRequired | ( | ) | const |
Is device var init code required for any postsynaptic variables in this synapse group's weight update model.
bool SynapseGroup::isWUDevicePreVarInitRequired | ( | ) | const |
Is device var init code required for any presynaptic variables in this synapse group's weight update model.
bool SynapseGroup::isWUDeviceVarInitRequired | ( | ) | const |
Is device var init code required for any variables in this synapse group's weight update model?
bool SynapseGroup::isWUInitRNGRequired | ( | VarInit | varInitMode | ) | const |
Does this synapse group require an RNG for it's weight update init code?
|
inline |
bool SynapseGroup::isZeroCopyEnabled | ( | ) | const |
void SynapseGroup::setBackPropDelaySteps | ( | unsigned int | timesteps | ) |
Sets the number of delay steps used to delay postsynaptic spikes travelling back along dendrites to synapses.
|
inline |
Set variable mode used for this synapse group's dendritic delay buffers.
This is ignored for CPU simulations
|
inline |
|
inline |
Set variable mode used for variables used to combine input from this synapse group.
This is ignored for CPU simulations
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
void SynapseGroup::setMaxDendriticDelayTimesteps | ( | unsigned int | maxDendriticDelay | ) |
Sets the maximum dendritic delay for synapses in this synapse group.
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
|
inline |
Function to enable the use of zero-copied memory for a particular weight update model state variable (deprecated use SynapseGroup::setWUVarMode):
void SynapseGroup::setPSVarMode | ( | const std::string & | varName, |
VarMode | mode | ||
) |
Set variable mode of postsynaptic model state variable.
This is ignored for CPU simulations
|
inline |
May improve IO performance at the expense of kernel performance
void SynapseGroup::setSpanType | ( | SpanType | spanType | ) |
Set how CUDA implementation is parallelised.
with a thread per target neuron (default) or a thread per source spike
|
inline |
Set variable mode used for sparse connectivity.
This is ignored for CPU simulations
|
inline |
|
inline |
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
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
void SynapseGroup::setWUVarMode | ( | const std::string & | varName, |
VarMode | mode | ||
) |
Set variable mode of weight update model state variable.
This is ignored for CPU simulations
|
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