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

#include <modelSpec.h>

Public Types

typedef map< string, NeuronGroup >::value_type NeuronGroupValueType
 
typedef map< string, SynapseGroup >::value_type SynapseGroupValueType
 
typedef map< string, std::pair< unsigned int, unsigned int > >::value_type SynapseGroupSubsetValueType
 

Public Member Functions

 NNmodel ()
 
 ~NNmodel ()
 
void setName (const std::string &)
 Method to set the neuronal network model name. More...
 
void setPrecision (FloatType)
 Set numerical precision for floating point. More...
 
void setTimePrecision (TimePrecision timePrecision)
 Set numerical precision for time. More...
 
void setDT (double)
 Set the integration step size of the model. More...
 
void setTiming (bool)
 Set whether timers and timing commands are to be included. More...
 
void setSeed (unsigned int)
 Set the random seed (disables automatic seeding if argument not 0). More...
 
void setRNType (const std::string &type)
 Sets the underlying type for random number generation (default: uint64_t) More...
 
void setGPUDevice (int)
 Sets the underlying type for random number generation (default: uint64_t) More...
 
string scalarExpr (const double) const
 Get the string literal that should be used to represent a value in the model's floating-point type. More...
 
void setPopulationSums ()
 Set the accumulated sums of lowest multiple of kernel block size >= group sizes for all simulated groups. More...
 
void finalize ()
 Declare that the model specification is finalised in modelDefinition(). More...
 
bool zeroCopyInUse () const
 Are any variables in any populations in this model using zero-copy memory? More...
 
unsigned int getNumPreSynapseResetRequiredGroups () const
 Return number of synapse groups which require a presynaptic reset kernel to be run. More...
 
bool isPreSynapseResetRequired () const
 Is there reset logic to be run before the synapse kernel i.e. for dendritic delays. More...
 
bool isHostRNGRequired () const
 Do any populations or initialisation code in this model require a host RNG? More...
 
bool isDeviceRNGRequired () const
 Do any populations or initialisation code in this model require a device RNG? More...
 
bool canRunOnCPU () const
 Can this model run on the CPU? More...
 
const std::string & getName () const
 Gets the name of the neuronal network model. More...
 
const std::string & getPrecision () const
 Gets the floating point numerical precision. More...
 
std::string getTimePrecision () const
 Gets the floating point numerical precision used to represent time. More...
 
unsigned int getResetKernel () const
 Which kernel should contain the reset logic? Specified in terms of GENN_FLAGS. More...
 
double getDT () const
 Gets the model integration step size. More...
 
unsigned int getSeed () const
 Get the random seed. More...
 
const std::string & getRNType () const
 Gets the underlying type for random number generation (default: uint64_t) More...
 
bool isFinalized () const
 Is the model specification finalized. More...
 
bool isTimingEnabled () const
 Are timers and timing commands enabled. More...
 
std::string getGeneratedCodePath (const std::string &path, const std::string &filename) const
 Generate path for generated code. More...
 
const map< string, string > & getInitKernelParameters () const
 
bool isDeviceInitRequired (int localHostID) const
 Does this model require device initialisation kernel. More...
 
bool isDeviceSparseInitRequired () const
 Does this model require a device sparse initialisation kernel. More...
 
const map< string, NeuronGroup > & getLocalNeuronGroups () const
 Get std::map containing local named NeuronGroup objects in model. More...
 
const map< string, NeuronGroup > & getRemoteNeuronGroups () const
 Get std::map containing remote named NeuronGroup objects in model. More...
 
const map< string, string > & getNeuronKernelParameters () const
 Gets std::map containing names and types of each parameter that should be passed through to the neuron kernel. More...
 
unsigned int getNeuronGridSize () const
 Gets the size of the neuron kernel thread grid. More...
 
unsigned int getNumLocalNeurons () const
 How many neurons are simulated locally in this model. More...
 
unsigned int getNumRemoteNeurons () const
 How many neurons are simulated remotely in this model. More...
 
unsigned int getNumNeurons () const
 How many neurons make up the entire model. More...
 
const NeuronGroupfindNeuronGroup (const std::string &name) const
 Find a neuron group by name. More...
 
NeuronGroupfindNeuronGroup (const std::string &name)
 Find a neuron group by name. More...
 
NeuronGroupaddNeuronPopulation (const string &, unsigned int, unsigned int, const double *, const double *, int hostID=0, int deviceID=0)
 Method for adding a neuron population to a neuronal network model, using C++ string for the name of the population. More...
 
NeuronGroupaddNeuronPopulation (const string &, unsigned int, unsigned int, const vector< double > &, const vector< double > &, int hostID=0, int deviceID=0)
 Method for adding a neuron population to a neuronal network model, using C++ string for the name of the population. More...
 
template<typename NeuronModel >
NeuronGroupaddNeuronPopulation (const string &name, unsigned int size, const NeuronModel *model, const typename NeuronModel::ParamValues &paramValues, const typename NeuronModel::VarValues &varInitialisers, int hostID=0, int deviceID=0)
 Adds a new neuron group to the model using a neuron model managed by the user. More...
 
template<typename NeuronModel >
NeuronGroupaddNeuronPopulation (const string &name, unsigned int size, const typename NeuronModel::ParamValues &paramValues, const typename NeuronModel::VarValues &varInitialisers, int hostID=0, int deviceID=0)
 Adds a new neuron group to the model using a singleton neuron model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
void setNeuronClusterIndex (const string &neuronGroup, int hostID, int deviceID)
 This function has been deprecated in GeNN 3.1.0. More...
 
void activateDirectInput (const string &, unsigned int type)
 This function defines the type of the explicit input to the neuron model. Current options are common constant input to all neurons, input from a file and input defines as a rule. More...
 
void setConstInp (const string &, double)
 This function has been deprecated in GeNN 2.2. More...
 
const map< string, SynapseGroup > & getLocalSynapseGroups () const
 Get std::map containing local named SynapseGroup objects in model. More...
 
const map< string, SynapseGroup > & getRemoteSynapseGroups () const
 Get std::map containing remote named SynapseGroup objects in model. More...
 
const map< string, std::pair< unsigned int, unsigned int > > & getSynapsePostLearnGroups () const
 
const map< string, std::pair< unsigned int, unsigned int > > & getSynapseDynamicsGroups () const
 
const map< string, string > & getSynapseKernelParameters () const
 Gets std::map containing names and types of each parameter that should be passed through to the synapse kernel. More...
 
const map< string, string > & getSimLearnPostKernelParameters () const
 Gets std::map containing names and types of each parameter that should be passed through to the postsynaptic learning kernel. More...
 
const map< string, string > & getSynapseDynamicsKernelParameters () const
 Gets std::map containing names and types of each parameter that should be passed through to the synapse dynamics kernel. More...
 
unsigned int getSynapseKernelGridSize () const
 Gets the size of the synapse kernel thread grid. More...
 
unsigned int getSynapsePostLearnGridSize () const
 Gets the size of the post-synaptic learning kernel thread grid. More...
 
unsigned int getSynapseDynamicsGridSize () const
 Gets the size of the synapse dynamics kernel thread grid. More...
 
const SynapseGroupfindSynapseGroup (const std::string &name) const
 Find a synapse group by name. More...
 
SynapseGroupfindSynapseGroup (const std::string &name)
 Find a synapse group by name. More...
 
bool isSynapseGroupDynamicsRequired (const std::string &name) const
 Does named synapse group have synapse dynamics. More...
 
bool isSynapseGroupPostLearningRequired (const std::string &name) const
 Does named synapse group have post-synaptic learning. More...
 
SynapseGroupaddSynapsePopulation (const string &name, unsigned int syntype, SynapseConnType conntype, SynapseGType gtype, const string &src, const string &trg, const double *p)
 This function has been depreciated as of GeNN 2.2. More...
 
SynapseGroupaddSynapsePopulation (const string &, unsigned int, SynapseConnType, SynapseGType, unsigned int, unsigned int, const string &, const string &, const double *, const double *, const double *)
 Overloaded version without initial variables for synapses. More...
 
SynapseGroupaddSynapsePopulation (const string &, unsigned int, SynapseConnType, SynapseGType, unsigned int, unsigned int, const string &, const string &, const double *, const double *, const double *, const double *)
 Method for adding a synapse population to a neuronal network model, using C++ string for the name of the population. More...
 
SynapseGroupaddSynapsePopulation (const string &, unsigned int, SynapseConnType, SynapseGType, unsigned int, unsigned int, const string &, const string &, const vector< double > &, const vector< double > &, const vector< double > &, const vector< double > &)
 Method for adding a synapse population to a neuronal network model, using C++ string for the name of the population. More...
 
template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroupaddSynapsePopulation (const string &name, SynapseMatrixType mtype, unsigned int delaySteps, const string &src, const string &trg, const WeightUpdateModel *wum, const typename WeightUpdateModel::ParamValues &weightParamValues, const typename WeightUpdateModel::VarValues &weightVarInitialisers, const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers, const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers, const PostsynapticModel *psm, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers, const InitSparseConnectivitySnippet::Init &connectivityInitialiser=uninitialisedConnectivity())
 Adds a synapse population to the model using weight update and postsynaptic models managed by the user. More...
 
template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroupaddSynapsePopulation (const string &name, SynapseMatrixType mtype, unsigned int delaySteps, const string &src, const string &trg, const typename WeightUpdateModel::ParamValues &weightParamValues, const typename WeightUpdateModel::VarValues &weightVarInitialisers, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers, const InitSparseConnectivitySnippet::Init &connectivityInitialiser=uninitialisedConnectivity())
 Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroupaddSynapsePopulation (const string &name, SynapseMatrixType mtype, unsigned int delaySteps, const string &src, const string &trg, const typename WeightUpdateModel::ParamValues &weightParamValues, const typename WeightUpdateModel::VarValues &weightVarInitialisers, const typename WeightUpdateModel::PreVarValues &weightPreVarInitialisers, const typename WeightUpdateModel::PostVarValues &weightPostVarInitialisers, const typename PostsynapticModel::ParamValues &postsynapticParamValues, const typename PostsynapticModel::VarValues &postsynapticVarInitialisers, const InitSparseConnectivitySnippet::Init &connectivityInitialiser=uninitialisedConnectivity())
 Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 
void setSynapseG (const string &, double)
 This function has been depreciated as of GeNN 2.2. More...
 
void setMaxConn (const string &, unsigned int)
 This function defines the maximum number of connections for a neuron in the population. More...
 
void setSpanTypeToPre (const string &)
 Method for switching the execution order of synapses to pre-to-post. More...
 
const map< string, CurrentSource > & getLocalCurrentSources () const
 Get std::map containing local named CurrentSource objects in model. More...
 
const map< string, CurrentSource > & getRemoteCurrentSources () const
 Get std::map containing remote named CurrentSource objects in model. More...
 
const map< string, string > & getCurrentSourceKernelParameters () const
 Gets std::map containing names and types of each parameter that should be passed through to the current source kernel. More...
 
const CurrentSourcefindCurrentSource (const std::string &name) const
 Find a current source by name. More...
 
CurrentSourcefindCurrentSource (const std::string &name)
 Find a current source by name. More...
 
template<typename CurrentSourceModel >
CurrentSourceaddCurrentSource (const string &currentSourceName, const CurrentSourceModel *model, const string &targetNeuronGroupName, const typename CurrentSourceModel::ParamValues &paramValues, const typename CurrentSourceModel::VarValues &varInitialisers)
 Adds a new current source to the model using a current source model managed by the user. More...
 
template<typename CurrentSourceModel >
CurrentSourceaddCurrentSource (const string &currentSourceName, const string &targetNeuronGroupName, const typename CurrentSourceModel::ParamValues &paramValues, const typename CurrentSourceModel::VarValues &varInitialisers)
 Adds a new current source to the model using a singleton current source model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros. More...
 

Member Typedef Documentation

◆ NeuronGroupValueType

typedef map<string, NeuronGroup>::value_type NNmodel::NeuronGroupValueType

◆ SynapseGroupSubsetValueType

typedef map<string, std::pair<unsigned int, unsigned int> >::value_type NNmodel::SynapseGroupSubsetValueType

◆ SynapseGroupValueType

typedef map<string, SynapseGroup>::value_type NNmodel::SynapseGroupValueType

Constructor & Destructor Documentation

◆ NNmodel()

NNmodel::NNmodel ( )

◆ ~NNmodel()

NNmodel::~NNmodel ( )

Member Function Documentation

◆ activateDirectInput()

void NNmodel::activateDirectInput ( const string &  ,
unsigned int  type 
)

This function defines the type of the explicit input to the neuron model. Current options are common constant input to all neurons, input from a file and input defines as a rule.

Parameters
typeType of input: 1 if common input, 2 if custom input from file, 3 if custom input as a rule

◆ addCurrentSource() [1/2]

template<typename CurrentSourceModel >
CurrentSource* NNmodel::addCurrentSource ( const string &  currentSourceName,
const CurrentSourceModel *  model,
const string &  targetNeuronGroupName,
const typename CurrentSourceModel::ParamValues &  paramValues,
const typename CurrentSourceModel::VarValues &  varInitialisers 
)
inline

Adds a new current source to the model using a current source model managed by the user.

Template Parameters
CurrentSourceModeltype of current source model (derived from CurrentSourceModels::Base).
Parameters
namestring containing unique name of current source.
modelcurrent source model to use for current source.
targetNeuronGroupNamestring name of the target neuron group
paramValuesparameters for model wrapped in CurrentSourceModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in CurrentSource::VarValues object.
Returns
pointer to newly created CurrentSource

◆ addCurrentSource() [2/2]

template<typename CurrentSourceModel >
CurrentSource* NNmodel::addCurrentSource ( const string &  currentSourceName,
const string &  targetNeuronGroupName,
const typename CurrentSourceModel::ParamValues &  paramValues,
const typename CurrentSourceModel::VarValues &  varInitialisers 
)
inline

Adds a new current source to the model using a singleton current source model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
CurrentSourceModeltype of neuron model (derived from CurrentSourceModel::Base).
Parameters
currentSourceNamestring containing unique name of current source.
targetNeuronGroupNamestring name of the target neuron group
paramValuesparameters for model wrapped in CurrentSourceModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in CurrentSourceModel::VarValues object.
Returns
pointer to newly created CurrentSource

◆ addNeuronPopulation() [1/4]

NeuronGroup * NNmodel::addNeuronPopulation ( const string &  name,
unsigned int  nNo,
unsigned int  type,
const double *  p,
const double *  ini,
int  hostID = 0,
int  deviceID = 0 
)

Method for adding a neuron population to a neuronal network model, using C++ string for the name of the population.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This function adds a neuron population to a neuronal network models, assigning the name, the number of neurons in the group, the neuron type, parameters and initial values, the latter two defined as double *

Parameters
nameThe name of the neuron population
nNoNumber of neurons in the population
typeType of the neurons, refers to either a standard type or user-defined type
pParameters of this neuron type
iniInitial values for variables of this neuron type
hostIDhost ID for neuron group

◆ addNeuronPopulation() [2/4]

NeuronGroup * NNmodel::addNeuronPopulation ( const string &  name,
unsigned int  nNo,
unsigned int  type,
const vector< double > &  p,
const vector< double > &  ini,
int  hostID = 0,
int  deviceID = 0 
)

Method for adding a neuron population to a neuronal network model, using C++ string for the name of the population.

This function adds a neuron population to a neuronal network models, assigning the name, the number of neurons in the group, the neuron type, parameters and initial values. The latter two defined as STL vectors of double.

Parameters
nameThe name of the neuron population
nNoNumber of neurons in the population
typeType of the neurons, refers to either a standard type or user-defined type
pParameters of this neuron type
iniInitial values for variables of this neuron type

◆ addNeuronPopulation() [3/4]

template<typename NeuronModel >
NeuronGroup* NNmodel::addNeuronPopulation ( const string &  name,
unsigned int  size,
const NeuronModel *  model,
const typename NeuronModel::ParamValues &  paramValues,
const typename NeuronModel::VarValues &  varInitialisers,
int  hostID = 0,
int  deviceID = 0 
)
inline

Adds a new neuron group to the model using a neuron model managed by the user.

Template Parameters
NeuronModeltype of neuron model (derived from NeuronModels::Base).
Parameters
namestring containing unique name of neuron population.
sizeinteger specifying how many neurons are in the population.
modelneuron model to use for neuron group.
paramValuesparameters for model wrapped in NeuronModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
Returns
pointer to newly created NeuronGroup

◆ addNeuronPopulation() [4/4]

template<typename NeuronModel >
NeuronGroup* NNmodel::addNeuronPopulation ( const string &  name,
unsigned int  size,
const typename NeuronModel::ParamValues &  paramValues,
const typename NeuronModel::VarValues &  varInitialisers,
int  hostID = 0,
int  deviceID = 0 
)
inline

Adds a new neuron group to the model using a singleton neuron model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
NeuronModeltype of neuron model (derived from NeuronModels::Base).
Parameters
namestring containing unique name of neuron population.
sizeinteger specifying how many neurons are in the population.
paramValuesparameters for model wrapped in NeuronModel::ParamValues object.
varInitialisersstate variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
Returns
pointer to newly created NeuronGroup

◆ addSynapsePopulation() [1/7]

SynapseGroup * NNmodel::addSynapsePopulation ( const string &  name,
unsigned int  syntype,
SynapseConnType  conntype,
SynapseGType  gtype,
const string &  src,
const string &  trg,
const double *  p 
)

This function has been depreciated as of GeNN 2.2.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This deprecated function is provided for compatibility with the previous release of GeNN. Default values are provide for new parameters, it is strongly recommended these be selected explicity via the new version othe function

Parameters
nameThe name of the synapse population
syntypeThe type of synapse to be added (i.e. learning mode)
conntypeThe type of synaptic connectivity
gtypeThe way how the synaptic conductivity g will be defined
srcName of the (existing!) pre-synaptic neuron population
trgName of the (existing!) post-synaptic neuron population
pA C-type array of doubles that contains synapse parameter values (common to all synapses of the population) which will be used for the defined synapses.

◆ addSynapsePopulation() [2/7]

SynapseGroup * NNmodel::addSynapsePopulation ( const string &  name,
unsigned int  syntype,
SynapseConnType  conntype,
SynapseGType  gtype,
unsigned int  delaySteps,
unsigned int  postsyn,
const string &  src,
const string &  trg,
const double *  p,
const double *  PSVini,
const double *  ps 
)

Overloaded version without initial variables for synapses.

Overloaded old version (deprecated)

Parameters
nameThe name of the synapse population
syntypeThe type of synapse to be added (i.e. learning mode)
conntypeThe type of synaptic connectivity
gtypeThe way how the synaptic conductivity g will be defined
delayStepsNumber of delay slots
postsynPostsynaptic integration method
srcName of the (existing!) pre-synaptic neuron population
trgName of the (existing!) post-synaptic neuron population
pA C-type array of doubles that contains synapse parameter values (common to all synapses of the population) which will be used for the defined synapses.
PSViniA C-type array of doubles that contains the initial values for postsynaptic mechanism variables (common to all synapses of the population) which will be used for the defined synapses.
psA C-type array of doubles that contains postsynaptic mechanism parameter values (common to all synapses of the population) which will be used for the defined synapses.

◆ addSynapsePopulation() [3/7]

SynapseGroup * NNmodel::addSynapsePopulation ( const string &  name,
unsigned int  syntype,
SynapseConnType  conntype,
SynapseGType  gtype,
unsigned int  delaySteps,
unsigned int  postsyn,
const string &  src,
const string &  trg,
const double *  synini,
const double *  p,
const double *  PSVini,
const double *  ps 
)

Method for adding a synapse population to a neuronal network model, using C++ string for the name of the population.

This function adds a synapse population to a neuronal network model, assigning the name, the synapse type, the connectivity type, the type of conductance specification, the source and destination neuron populations, and the synaptic parameters.

Parameters
nameThe name of the synapse population
syntypeThe type of synapse to be added (i.e. learning mode)
conntypeThe type of synaptic connectivity
gtypeThe way how the synaptic conductivity g will be defined
delayStepsNumber of delay slots
postsynPostsynaptic integration method
srcName of the (existing!) pre-synaptic neuron population
trgName of the (existing!) post-synaptic neuron population
syniniA C-type array of doubles that contains the initial values for synapse variables (common to all synapses of the population) which will be used for the defined synapses.
pA C-type array of doubles that contains synapse parameter values (common to all synapses of the population) which will be used for the defined synapses.
PSViniA C-type array of doubles that contains the initial values for postsynaptic mechanism variables (common to all synapses of the population) which will be used for the defined synapses.
psA C-type array of doubles that contains postsynaptic mechanism parameter values (common to all synapses of the population) which will be used for the defined synapses.

◆ addSynapsePopulation() [4/7]

SynapseGroup * NNmodel::addSynapsePopulation ( const string &  name,
unsigned int  syntype,
SynapseConnType  conntype,
SynapseGType  gtype,
unsigned int  delaySteps,
unsigned int  postsyn,
const string &  src,
const string &  trg,
const vector< double > &  synini,
const vector< double > &  p,
const vector< double > &  PSVini,
const vector< double > &  ps 
)

Method for adding a synapse population to a neuronal network model, using C++ string for the name of the population.

This function adds a synapse population to a neuronal network model, assigning the name, the synapse type, the connectivity type, the type of conductance specification, the source and destination neuron populations, and the synaptic parameters.

Parameters
nameThe name of the synapse population
syntypeThe type of synapse to be added (i.e. learning mode)
conntypeThe type of synaptic connectivity
gtypeThe way how the synaptic conductivity g will be defined
delayStepsNumber of delay slots
postsynPostsynaptic integration method
srcName of the (existing!) pre-synaptic neuron population
trgName of the (existing!) post-synaptic neuron population
syniniA C-type array of doubles that contains the initial values for synapse variables (common to all synapses of the population) which will be used for the defined synapses.
pA C-type array of doubles that contains synapse parameter values (common to all synapses of the population) which will be used for the defined synapses.
PSViniA C-type array of doubles that contains the initial values for postsynaptic mechanism variables (common to all synapses of the population) which will be used for the defined synapses.
psA C-type array of doubles that contains postsynaptic mechanism parameter values (common to all synapses of the population) which will be used for the defined synapses.

◆ addSynapsePopulation() [5/7]

template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroup* NNmodel::addSynapsePopulation ( const string &  name,
SynapseMatrixType  mtype,
unsigned int  delaySteps,
const string &  src,
const string &  trg,
const WeightUpdateModel *  wum,
const typename WeightUpdateModel::ParamValues &  weightParamValues,
const typename WeightUpdateModel::VarValues &  weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &  weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &  weightPostVarInitialisers,
const PostsynapticModel *  psm,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers,
const InitSparseConnectivitySnippet::Init connectivityInitialiser = uninitialisedConnectivity() 
)
inline

Adds a synapse population to the model using weight update and postsynaptic models managed by the user.

Template Parameters
WeightUpdateModeltype of weight update model (derived from WeightUpdateModels::Base).
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of neuron population.
mtypehow the synaptic matrix associated with this synapse population should be represented.
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
wumweight update model to use for synapse group.
weightParamValuesparameters for weight update model wrapped in WeightUpdateModel::ParamValues object.
weightVarInitialisersweight update model state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPreVarInitialisersweight update model presynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPostVarInitialisersweight update model postsynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
psmpostsynaptic model to use for synapse group.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
Returns
pointer to newly created SynapseGroup

◆ addSynapsePopulation() [6/7]

template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroup* NNmodel::addSynapsePopulation ( const string &  name,
SynapseMatrixType  mtype,
unsigned int  delaySteps,
const string &  src,
const string &  trg,
const typename WeightUpdateModel::ParamValues &  weightParamValues,
const typename WeightUpdateModel::VarValues &  weightVarInitialisers,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers,
const InitSparseConnectivitySnippet::Init connectivityInitialiser = uninitialisedConnectivity() 
)
inline

Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
WeightUpdateModeltype of weight update model (derived from WeightUpdateModels::Base).
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of neuron population.
mtypehow the synaptic matrix associated with this synapse population should be represented.
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
weightParamValuesparameters for weight update model wrapped in WeightUpdateModel::ParamValues object.
weightVarInitialisersweight update model state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
Returns
pointer to newly created SynapseGroup

◆ addSynapsePopulation() [7/7]

template<typename WeightUpdateModel , typename PostsynapticModel >
SynapseGroup* NNmodel::addSynapsePopulation ( const string &  name,
SynapseMatrixType  mtype,
unsigned int  delaySteps,
const string &  src,
const string &  trg,
const typename WeightUpdateModel::ParamValues &  weightParamValues,
const typename WeightUpdateModel::VarValues &  weightVarInitialisers,
const typename WeightUpdateModel::PreVarValues &  weightPreVarInitialisers,
const typename WeightUpdateModel::PostVarValues &  weightPostVarInitialisers,
const typename PostsynapticModel::ParamValues &  postsynapticParamValues,
const typename PostsynapticModel::VarValues &  postsynapticVarInitialisers,
const InitSparseConnectivitySnippet::Init connectivityInitialiser = uninitialisedConnectivity() 
)
inline

Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.

Template Parameters
WeightUpdateModeltype of weight update model (derived from WeightUpdateModels::Base).
PostsynapticModeltype of postsynaptic model (derived from PostsynapticModels::Base).
Parameters
namestring containing unique name of neuron population.
mtypehow the synaptic matrix associated with this synapse population should be represented.
delayStepsinteger specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none)
srcstring specifying name of presynaptic (source) population
trgstring specifying name of postsynaptic (target) population
weightParamValuesparameters for weight update model wrapped in WeightUpdateModel::ParamValues object.
weightVarInitialisersweight update model per-synapse state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPreVarInitialisersweight update model presynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
weightPostVarInitialisersweight update model postsynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object.
postsynapticParamValuesparameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object.
postsynapticVarInitialiserspostsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object.
Returns
pointer to newly created SynapseGroup

◆ canRunOnCPU()

bool NNmodel::canRunOnCPU ( ) const

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

◆ finalize()

void NNmodel::finalize ( )

Declare that the model specification is finalised in modelDefinition().

◆ findCurrentSource() [1/2]

const CurrentSource * NNmodel::findCurrentSource ( const std::string &  name) const

Find a current source by name.

This function attempts to find an existing current source.

◆ findCurrentSource() [2/2]

CurrentSource * NNmodel::findCurrentSource ( const std::string &  name)

Find a current source by name.

◆ findNeuronGroup() [1/2]

const NeuronGroup * NNmodel::findNeuronGroup ( const std::string &  name) const

Find a neuron group by name.

◆ findNeuronGroup() [2/2]

NeuronGroup * NNmodel::findNeuronGroup ( const std::string &  name)

Find a neuron group by name.

◆ findSynapseGroup() [1/2]

const SynapseGroup * NNmodel::findSynapseGroup ( const std::string &  name) const

Find a synapse group by name.

◆ findSynapseGroup() [2/2]

SynapseGroup * NNmodel::findSynapseGroup ( const std::string &  name)

Find a synapse group by name.

◆ getCurrentSourceKernelParameters()

const map<string, string>& NNmodel::getCurrentSourceKernelParameters ( ) const
inline

Gets std::map containing names and types of each parameter that should be passed through to the current source kernel.

◆ getDT()

double NNmodel::getDT ( ) const
inline

Gets the model integration step size.

◆ getGeneratedCodePath()

std::string NNmodel::getGeneratedCodePath ( const std::string &  path,
const std::string &  filename 
) const

Generate path for generated code.

◆ getInitKernelParameters()

const map<string, string>& NNmodel::getInitKernelParameters ( ) const
inline

◆ getLocalCurrentSources()

const map<string, CurrentSource>& NNmodel::getLocalCurrentSources ( ) const
inline

Get std::map containing local named CurrentSource objects in model.

◆ getLocalNeuronGroups()

const map<string, NeuronGroup>& NNmodel::getLocalNeuronGroups ( ) const
inline

Get std::map containing local named NeuronGroup objects in model.

◆ getLocalSynapseGroups()

const map<string, SynapseGroup>& NNmodel::getLocalSynapseGroups ( ) const
inline

Get std::map containing local named SynapseGroup objects in model.

◆ getName()

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

Gets the name of the neuronal network model.

◆ getNeuronGridSize()

unsigned int NNmodel::getNeuronGridSize ( ) const

Gets the size of the neuron kernel thread grid.

This is calculated by adding together the number of threads required by each neuron population, padded to be a multiple of GPU's thread block size.

◆ getNeuronKernelParameters()

const map<string, string>& NNmodel::getNeuronKernelParameters ( ) const
inline

Gets std::map containing names and types of each parameter that should be passed through to the neuron kernel.

◆ getNumLocalNeurons()

unsigned int NNmodel::getNumLocalNeurons ( ) const

How many neurons are simulated locally in this model.

◆ getNumNeurons()

unsigned int NNmodel::getNumNeurons ( ) const
inline

How many neurons make up the entire model.

◆ getNumPreSynapseResetRequiredGroups()

unsigned int NNmodel::getNumPreSynapseResetRequiredGroups ( ) const

Return number of synapse groups which require a presynaptic reset kernel to be run.

◆ getNumRemoteNeurons()

unsigned int NNmodel::getNumRemoteNeurons ( ) const

How many neurons are simulated remotely in this model.

◆ getPrecision()

const std::string& NNmodel::getPrecision ( ) const
inline

Gets the floating point numerical precision.

◆ getRemoteCurrentSources()

const map<string, CurrentSource>& NNmodel::getRemoteCurrentSources ( ) const
inline

Get std::map containing remote named CurrentSource objects in model.

◆ getRemoteNeuronGroups()

const map<string, NeuronGroup>& NNmodel::getRemoteNeuronGroups ( ) const
inline

Get std::map containing remote named NeuronGroup objects in model.

◆ getRemoteSynapseGroups()

const map<string, SynapseGroup>& NNmodel::getRemoteSynapseGroups ( ) const
inline

Get std::map containing remote named SynapseGroup objects in model.

◆ getResetKernel()

unsigned int NNmodel::getResetKernel ( ) const
inline

Which kernel should contain the reset logic? Specified in terms of GENN_FLAGS.

◆ getRNType()

const std::string& NNmodel::getRNType ( ) const
inline

Gets the underlying type for random number generation (default: uint64_t)

◆ getSeed()

unsigned int NNmodel::getSeed ( ) const
inline

Get the random seed.

◆ getSimLearnPostKernelParameters()

const map<string, string>& NNmodel::getSimLearnPostKernelParameters ( ) const
inline

Gets std::map containing names and types of each parameter that should be passed through to the postsynaptic learning kernel.

◆ getSynapseDynamicsGridSize()

unsigned int NNmodel::getSynapseDynamicsGridSize ( ) const

Gets the size of the synapse dynamics kernel thread grid.

This is calculated by adding together the number of threads required by each synapse population's synapse dynamics kernel, padded to be a multiple of GPU's thread block size.

◆ getSynapseDynamicsGroups()

const map<string, std::pair<unsigned int, unsigned int> >& NNmodel::getSynapseDynamicsGroups ( ) const
inline

Get std::map containing names of synapse groups which require synapse dynamics and their thread IDs within the synapse dynamics kernel (padded to multiples of the GPU thread block size)

◆ getSynapseDynamicsKernelParameters()

const map<string, string>& NNmodel::getSynapseDynamicsKernelParameters ( ) const
inline

Gets std::map containing names and types of each parameter that should be passed through to the synapse dynamics kernel.

◆ getSynapseKernelGridSize()

unsigned int NNmodel::getSynapseKernelGridSize ( ) const

Gets the size of the synapse kernel thread grid.

This is calculated by adding together the number of threads required by each synapse population's synapse kernel, padded to be a multiple of GPU's thread block size.

◆ getSynapseKernelParameters()

const map<string, string>& NNmodel::getSynapseKernelParameters ( ) const
inline

Gets std::map containing names and types of each parameter that should be passed through to the synapse kernel.

◆ getSynapsePostLearnGridSize()

unsigned int NNmodel::getSynapsePostLearnGridSize ( ) const

Gets the size of the post-synaptic learning kernel thread grid.

This is calculated by adding together the number of threads required by each synapse population's postsynaptic learning kernel, padded to be a multiple of GPU's thread block size.

◆ getSynapsePostLearnGroups()

const map<string, std::pair<unsigned int, unsigned int> >& NNmodel::getSynapsePostLearnGroups ( ) const
inline

Get std::map containing names of synapse groups which require postsynaptic learning and their thread IDs within the postsynaptic learning kernel (padded to multiples of the GPU thread block size)

◆ getTimePrecision()

std::string NNmodel::getTimePrecision ( ) const

Gets the floating point numerical precision used to represent time.

◆ isDeviceInitRequired()

bool NNmodel::isDeviceInitRequired ( int  localHostID) const

Does this model require device initialisation kernel.

NOTE this is for neuron groups and densely connected synapse groups only

◆ isDeviceRNGRequired()

bool NNmodel::isDeviceRNGRequired ( ) const

Do any populations or initialisation code in this model require a device RNG?

NOTE some model code will use per-neuron RNGs instead

◆ isDeviceSparseInitRequired()

bool NNmodel::isDeviceSparseInitRequired ( ) const

Does this model require a device sparse initialisation kernel.

NOTE this is for sparsely connected synapse groups only

◆ isFinalized()

bool NNmodel::isFinalized ( ) const
inline

Is the model specification finalized.

◆ isHostRNGRequired()

bool NNmodel::isHostRNGRequired ( ) const

Do any populations or initialisation code in this model require a host RNG?

◆ isPreSynapseResetRequired()

bool NNmodel::isPreSynapseResetRequired ( ) const
inline

Is there reset logic to be run before the synapse kernel i.e. for dendritic delays.

◆ isSynapseGroupDynamicsRequired()

bool NNmodel::isSynapseGroupDynamicsRequired ( const std::string &  name) const

Does named synapse group have synapse dynamics.

◆ isSynapseGroupPostLearningRequired()

bool NNmodel::isSynapseGroupPostLearningRequired ( const std::string &  name) const

Does named synapse group have post-synaptic learning.

◆ isTimingEnabled()

bool NNmodel::isTimingEnabled ( ) const
inline

Are timers and timing commands enabled.

◆ scalarExpr()

string NNmodel::scalarExpr ( const double  val) const

Get the string literal that should be used to represent a value in the model's floating-point type.

◆ setConstInp()

void NNmodel::setConstInp ( const string &  ,
double   
)

This function has been deprecated in GeNN 2.2.

This function sets a global input value to the specified neuron group.

◆ setDT()

void NNmodel::setDT ( double  newDT)

Set the integration step size of the model.

This function sets the integration time step DT of the model.

◆ setGPUDevice()

void NNmodel::setGPUDevice ( int  device)

Sets the underlying type for random number generation (default: uint64_t)

This function defines the way how the GPU is chosen. If "AUTODEVICE" (-1) is given as the argument, GeNN will use internal heuristics to choose the device. Otherwise the argument is the device number and the indicated device will be used.

Method to choose the GPU to be used for the model. If "AUTODEVICE' (-1), GeNN will choose the device based on a heuristic rule.

◆ setMaxConn()

void NNmodel::setMaxConn ( const string &  sname,
unsigned int  maxConnP 
)

This function defines the maximum number of connections for a neuron in the population.

◆ setName()

void NNmodel::setName ( const std::string &  )

Method to set the neuronal network model name.

◆ setNeuronClusterIndex()

void NNmodel::setNeuronClusterIndex ( const string &  neuronGroup,
int  hostID,
int  deviceID 
)

This function has been deprecated in GeNN 3.1.0.

This function is for setting which host and which device a neuron group will be simulated on.

◆ setPopulationSums()

void NNmodel::setPopulationSums ( )

Set the accumulated sums of lowest multiple of kernel block size >= group sizes for all simulated groups.

Accumulate the sums and block-size-padded sums of all simulation groups.

This method saves the neuron numbers of the populations rounded to the next multiple of the block size as well as the sums s(i) = sum_{1...i} n_i of the rounded population sizes. These are later used to determine the branching structure for the generated neuron kernel code.

◆ setPrecision()

void NNmodel::setPrecision ( FloatType  floattype)

Set numerical precision for floating point.

This function sets the numerical precision of floating type variables. By default, it is GENN_GENN_FLOAT.

◆ setRNType()

void NNmodel::setRNType ( const std::string &  type)

Sets the underlying type for random number generation (default: uint64_t)

◆ setSeed()

void NNmodel::setSeed ( unsigned int  inseed)

Set the random seed (disables automatic seeding if argument not 0).

This function sets the random seed. If the passed argument is > 0, automatic seeding is disabled. If the argument is 0, the underlying seed is obtained from the time() function.

Parameters
inseedthe new seed

◆ setSpanTypeToPre()

void NNmodel::setSpanTypeToPre ( const string &  sname)

Method for switching the execution order of synapses to pre-to-post.

This function defines the execution order of the synapses in the kernels (0 : execute for every postsynaptic neuron 1: execute for every presynaptic neuron)

Parameters
snamename of the synapse group to which to apply the pre-synaptic span type

◆ setSynapseG()

void NNmodel::setSynapseG ( const string &  ,
double   
)

This function has been depreciated as of GeNN 2.2.

This functions sets the global value of the maximal synaptic conductance for a synapse population that was idfentified as conductance specifcation method "GLOBALG".

◆ setTimePrecision()

void NNmodel::setTimePrecision ( TimePrecision  timePrecision)

Set numerical precision for time.

◆ setTiming()

void NNmodel::setTiming ( bool  theTiming)

Set whether timers and timing commands are to be included.

This function sets a flag to determine whether timers and timing commands are to be included in generated code.

◆ zeroCopyInUse()

bool NNmodel::zeroCopyInUse ( ) const

Are any variables in any populations in this model using zero-copy memory?


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