GeNN
3.3.0
GPU enhanced Neuronal Networks (GeNN)
|
#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 NeuronGroup * | findNeuronGroup (const std::string &name) const |
Find a neuron group by name. More... | |
NeuronGroup * | findNeuronGroup (const std::string &name) |
Find a neuron group by name. More... | |
NeuronGroup * | addNeuronPopulation (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... | |
NeuronGroup * | addNeuronPopulation (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 > | |
NeuronGroup * | addNeuronPopulation (const string &name, unsigned int size, const NeuronModel *model, const typename NeuronModel::ParamValues ¶mValues, 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 > | |
NeuronGroup * | addNeuronPopulation (const string &name, unsigned int size, const typename NeuronModel::ParamValues ¶mValues, 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 SynapseGroup * | findSynapseGroup (const std::string &name) const |
Find a synapse group by name. More... | |
SynapseGroup * | findSynapseGroup (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... | |
SynapseGroup * | 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. More... | |
SynapseGroup * | addSynapsePopulation (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... | |
SynapseGroup * | addSynapsePopulation (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... | |
SynapseGroup * | addSynapsePopulation (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 > | |
SynapseGroup * | 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()) |
Adds a synapse population to the model using weight update and postsynaptic models managed by the user. More... | |
template<typename WeightUpdateModel , typename PostsynapticModel > | |
SynapseGroup * | 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()) |
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 > | |
SynapseGroup * | 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()) |
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 CurrentSource * | findCurrentSource (const std::string &name) const |
Find a current source by name. More... | |
CurrentSource * | findCurrentSource (const std::string &name) |
Find a current source by name. More... | |
template<typename CurrentSourceModel > | |
CurrentSource * | addCurrentSource (const string ¤tSourceName, const CurrentSourceModel *model, const string &targetNeuronGroupName, const typename CurrentSourceModel::ParamValues ¶mValues, 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 > | |
CurrentSource * | addCurrentSource (const string ¤tSourceName, const string &targetNeuronGroupName, const typename CurrentSourceModel::ParamValues ¶mValues, 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... | |
typedef map<string, NeuronGroup>::value_type NNmodel::NeuronGroupValueType |
typedef map<string, std::pair<unsigned int, unsigned int> >::value_type NNmodel::SynapseGroupSubsetValueType |
typedef map<string, SynapseGroup>::value_type NNmodel::SynapseGroupValueType |
NNmodel::NNmodel | ( | ) |
NNmodel::~NNmodel | ( | ) |
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.
type | Type of input: 1 if common input, 2 if custom input from file, 3 if custom input as a rule |
|
inline |
Adds a new current source to the model using a current source model managed by the user.
CurrentSourceModel | type of current source model (derived from CurrentSourceModels::Base). |
name | string containing unique name of current source. |
model | current source model to use for current source. |
targetNeuronGroupName | string name of the target neuron group |
paramValues | parameters for model wrapped in CurrentSourceModel::ParamValues object. |
varInitialisers | state variable initialiser snippets and parameters wrapped in CurrentSource::VarValues object. |
|
inline |
Adds a new current source to the model using a singleton current source model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.
CurrentSourceModel | type of neuron model (derived from CurrentSourceModel::Base). |
currentSourceName | string containing unique name of current source. |
targetNeuronGroupName | string name of the target neuron group |
paramValues | parameters for model wrapped in CurrentSourceModel::ParamValues object. |
varInitialisers | state variable initialiser snippets and parameters wrapped in CurrentSourceModel::VarValues object. |
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 *
name | The name of the neuron population |
nNo | Number of neurons in the population |
type | Type of the neurons, refers to either a standard type or user-defined type |
p | Parameters of this neuron type |
ini | Initial values for variables of this neuron type |
hostID | host ID for neuron group |
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.
name | The name of the neuron population |
nNo | Number of neurons in the population |
type | Type of the neurons, refers to either a standard type or user-defined type |
p | Parameters of this neuron type |
ini | Initial values for variables of this neuron type |
|
inline |
Adds a new neuron group to the model using a neuron model managed by the user.
NeuronModel | type of neuron model (derived from NeuronModels::Base). |
name | string containing unique name of neuron population. |
size | integer specifying how many neurons are in the population. |
model | neuron model to use for neuron group. |
paramValues | parameters for model wrapped in NeuronModel::ParamValues object. |
varInitialisers | state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object. |
|
inline |
Adds a new neuron group to the model using a singleton neuron model created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.
NeuronModel | type of neuron model (derived from NeuronModels::Base). |
name | string containing unique name of neuron population. |
size | integer specifying how many neurons are in the population. |
paramValues | parameters for model wrapped in NeuronModel::ParamValues object. |
varInitialisers | state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object. |
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
name | The name of the synapse population |
syntype | The type of synapse to be added (i.e. learning mode) |
conntype | The type of synaptic connectivity |
gtype | The way how the synaptic conductivity g will be defined |
src | Name of the (existing!) pre-synaptic neuron population |
trg | Name of the (existing!) post-synaptic neuron population |
p | A 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. |
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)
name | The name of the synapse population |
syntype | The type of synapse to be added (i.e. learning mode) |
conntype | The type of synaptic connectivity |
gtype | The way how the synaptic conductivity g will be defined |
delaySteps | Number of delay slots |
postsyn | Postsynaptic integration method |
src | Name of the (existing!) pre-synaptic neuron population |
trg | Name of the (existing!) post-synaptic neuron population |
p | A 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. |
PSVini | A 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. |
ps | A 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. |
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.
name | The name of the synapse population |
syntype | The type of synapse to be added (i.e. learning mode) |
conntype | The type of synaptic connectivity |
gtype | The way how the synaptic conductivity g will be defined |
delaySteps | Number of delay slots |
postsyn | Postsynaptic integration method |
src | Name of the (existing!) pre-synaptic neuron population |
trg | Name of the (existing!) post-synaptic neuron population |
synini | A 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. |
p | A 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. |
PSVini | A 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. |
ps | A 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. |
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.
name | The name of the synapse population |
syntype | The type of synapse to be added (i.e. learning mode) |
conntype | The type of synaptic connectivity |
gtype | The way how the synaptic conductivity g will be defined |
delaySteps | Number of delay slots |
postsyn | Postsynaptic integration method |
src | Name of the (existing!) pre-synaptic neuron population |
trg | Name of the (existing!) post-synaptic neuron population |
synini | A 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. |
p | A 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. |
PSVini | A 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. |
ps | A 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. |
|
inline |
Adds a synapse population to the model using weight update and postsynaptic models managed by the user.
WeightUpdateModel | type of weight update model (derived from WeightUpdateModels::Base). |
PostsynapticModel | type of postsynaptic model (derived from PostsynapticModels::Base). |
name | string containing unique name of neuron population. |
mtype | how the synaptic matrix associated with this synapse population should be represented. |
delaySteps | integer specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none) |
src | string specifying name of presynaptic (source) population |
trg | string specifying name of postsynaptic (target) population |
wum | weight update model to use for synapse group. |
weightParamValues | parameters for weight update model wrapped in WeightUpdateModel::ParamValues object. |
weightVarInitialisers | weight update model state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object. |
weightPreVarInitialisers | weight update model presynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object. |
weightPostVarInitialisers | weight update model postsynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object. |
psm | postsynaptic model to use for synapse group. |
postsynapticParamValues | parameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object. |
postsynapticVarInitialisers | postsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object. |
|
inline |
Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.
WeightUpdateModel | type of weight update model (derived from WeightUpdateModels::Base). |
PostsynapticModel | type of postsynaptic model (derived from PostsynapticModels::Base). |
name | string containing unique name of neuron population. |
mtype | how the synaptic matrix associated with this synapse population should be represented. |
delaySteps | integer specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none) |
src | string specifying name of presynaptic (source) population |
trg | string specifying name of postsynaptic (target) population |
weightParamValues | parameters for weight update model wrapped in WeightUpdateModel::ParamValues object. |
weightVarInitialisers | weight update model state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object. |
postsynapticParamValues | parameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object. |
postsynapticVarInitialisers | postsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object. |
|
inline |
Adds a synapse population to the model using singleton weight update and postsynaptic models created using standard DECLARE_MODEL and IMPLEMENT_MODEL macros.
WeightUpdateModel | type of weight update model (derived from WeightUpdateModels::Base). |
PostsynapticModel | type of postsynaptic model (derived from PostsynapticModels::Base). |
name | string containing unique name of neuron population. |
mtype | how the synaptic matrix associated with this synapse population should be represented. |
delaySteps | integer specifying number of timesteps delay this synaptic connection should incur (or NO_DELAY for none) |
src | string specifying name of presynaptic (source) population |
trg | string specifying name of postsynaptic (target) population |
weightParamValues | parameters for weight update model wrapped in WeightUpdateModel::ParamValues object. |
weightVarInitialisers | weight update model per-synapse state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object. |
weightPreVarInitialisers | weight update model presynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object. |
weightPostVarInitialisers | weight update model postsynaptic state variable initialiser snippets and parameters wrapped in WeightUpdateModel::VarValues object. |
postsynapticParamValues | parameters for postsynaptic model wrapped in PostsynapticModel::ParamValues object. |
postsynapticVarInitialisers | postsynaptic model state variable initialiser snippets and parameters wrapped in NeuronModel::VarValues object. |
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.
void NNmodel::finalize | ( | ) |
Declare that the model specification is finalised in modelDefinition().
const CurrentSource * NNmodel::findCurrentSource | ( | const std::string & | name | ) | const |
Find a current source by name.
This function attempts to find an existing current source.
CurrentSource * NNmodel::findCurrentSource | ( | const std::string & | name | ) |
Find a current source by name.
const NeuronGroup * NNmodel::findNeuronGroup | ( | const std::string & | name | ) | const |
Find a neuron group by name.
NeuronGroup * NNmodel::findNeuronGroup | ( | const std::string & | name | ) |
Find a neuron group by name.
const SynapseGroup * NNmodel::findSynapseGroup | ( | const std::string & | name | ) | const |
Find a synapse group by name.
SynapseGroup * NNmodel::findSynapseGroup | ( | const std::string & | name | ) |
Find a synapse group by name.
|
inline |
Gets std::map containing names and types of each parameter that should be passed through to the current source kernel.
|
inline |
Gets the model integration step size.
std::string NNmodel::getGeneratedCodePath | ( | const std::string & | path, |
const std::string & | filename | ||
) | const |
Generate path for generated code.
|
inline |
|
inline |
Get std::map containing local named CurrentSource objects in model.
|
inline |
Get std::map containing local named NeuronGroup objects in model.
|
inline |
Get std::map containing local named SynapseGroup objects in model.
|
inline |
Gets the name of the neuronal network model.
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.
|
inline |
Gets std::map containing names and types of each parameter that should be passed through to the neuron kernel.
unsigned int NNmodel::getNumLocalNeurons | ( | ) | const |
How many neurons are simulated locally in this model.
|
inline |
How many neurons make up the entire model.
unsigned int NNmodel::getNumPreSynapseResetRequiredGroups | ( | ) | const |
Return number of synapse groups which require a presynaptic reset kernel to be run.
unsigned int NNmodel::getNumRemoteNeurons | ( | ) | const |
How many neurons are simulated remotely in this model.
|
inline |
Gets the floating point numerical precision.
|
inline |
Get std::map containing remote named CurrentSource objects in model.
|
inline |
Get std::map containing remote named NeuronGroup objects in model.
|
inline |
Get std::map containing remote named SynapseGroup objects in model.
|
inline |
Which kernel should contain the reset logic? Specified in terms of GENN_FLAGS.
|
inline |
Gets the underlying type for random number generation (default: uint64_t)
|
inline |
Get the random seed.
|
inline |
Gets std::map containing names and types of each parameter that should be passed through to the postsynaptic learning kernel.
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.
|
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)
|
inline |
Gets std::map containing names and types of each parameter that should be passed through to the synapse dynamics kernel.
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.
|
inline |
Gets std::map containing names and types of each parameter that should be passed through to the synapse kernel.
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.
|
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)
std::string NNmodel::getTimePrecision | ( | ) | const |
Gets the floating point numerical precision used to represent time.
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
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
bool NNmodel::isDeviceSparseInitRequired | ( | ) | const |
Does this model require a device sparse initialisation kernel.
NOTE this is for sparsely connected synapse groups only
|
inline |
Is the model specification finalized.
bool NNmodel::isHostRNGRequired | ( | ) | const |
Do any populations or initialisation code in this model require a host RNG?
|
inline |
Is there reset logic to be run before the synapse kernel i.e. for dendritic delays.
bool NNmodel::isSynapseGroupDynamicsRequired | ( | const std::string & | name | ) | const |
Does named synapse group have synapse dynamics.
bool NNmodel::isSynapseGroupPostLearningRequired | ( | const std::string & | name | ) | const |
Does named synapse group have post-synaptic learning.
|
inline |
Are timers and timing commands enabled.
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.
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.
void NNmodel::setDT | ( | double | newDT | ) |
Set the integration step size of the model.
This function sets the integration time step DT of the model.
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.
void NNmodel::setMaxConn | ( | const string & | sname, |
unsigned int | maxConnP | ||
) |
This function defines the maximum number of connections for a neuron in the population.
void NNmodel::setName | ( | const std::string & | ) |
Method to set the neuronal network model name.
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.
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.
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.
void NNmodel::setRNType | ( | const std::string & | type | ) |
Sets the underlying type for random number generation (default: uint64_t)
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.
inseed | the new seed |
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)
sname | name of the synapse group to which to apply the pre-synaptic span type |
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".
void NNmodel::setTimePrecision | ( | TimePrecision | timePrecision | ) |
Set numerical precision for time.
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.
bool NNmodel::zeroCopyInUse | ( | ) | const |
Are any variables in any populations in this model using zero-copy memory?