GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
modelSpec.h File Reference

Header file that contains the class (struct) definition of neuronModel for defining a neuron model and the class definition of ModelSpec for defining a neuronal network model. Part of the code generation and generated code sections. More...

#include <map>
#include <set>
#include <string>
#include <vector>
#include "currentSourceInternal.h"
#include "customUpdateInternal.h"
#include "gennExport.h"
#include "neuronGroupInternal.h"
#include "synapseGroupInternal.h"

Go to the source code of this file.

Classes

class  ModelSpec
 Object used for specifying a neuronal network model. More...
 

Macros

#define NO_DELAY   0
 Macro used to indicate no synapse delay for the group (only one queue slot will be generated) More...
 

Typedefs

typedef ModelSpec NNmodel
 

Enumerations

enum  FloatType { , GENN_LONG_DOUBLE }
 Floating point precision to use for models. More...
 
enum  TimePrecision { TimePrecision::DEFAULT, TimePrecision::FLOAT, TimePrecision::DOUBLE }
 Precision to use for variables which store time. More...
 

Functions

template<typename S >
Models::VarInit initVar (const typename S::ParamValues &params)
 Initialise a variable using an initialisation snippet. More...
 
template<typename S >
std::enable_if< std::is_same< typename S::ParamValues, Snippet::ValueBase< 0 > >::value, Models::VarInit >::type initVar ()
 Initialise a variable using an initialisation snippet with no parameters. More...
 
Models::VarInit uninitialisedVar ()
 Mark a variable as uninitialised. More...
 
template<typename S >
InitSparseConnectivitySnippet::Init initConnectivity (const typename S::ParamValues &params)
 Initialise connectivity using a sparse connectivity snippet. More...
 
template<typename S >
std::enable_if< std::is_same< typename S::ParamValues, Snippet::ValueBase< 0 > >::value, InitSparseConnectivitySnippet::Init >::type initConnectivity ()
 Initialise connectivity using a sparse connectivity snippet with no parameters. More...
 
InitSparseConnectivitySnippet::Init uninitialisedConnectivity ()
 Mark a synapse group's sparse connectivity as uninitialised. More...
 
template<typename S >
InitToeplitzConnectivitySnippet::Init initToeplitzConnectivity (const typename S::ParamValues &params)
 Initialise toeplitz connectivity using a toeplitz connectivity snippet. More...
 
template<typename S >
std::enable_if< std::is_same< typename S::ParamValues, Snippet::ValueBase< 0 > >::value, InitToeplitzConnectivitySnippet::Init >::type initToeplitzConnectivity ()
 Initialise connectivity using a toeplitz connectivity snippet with no parameters. More...
 
Models::VarReference createVarRef (const NeuronGroup *ng, const std::string &varName)
 Creates a reference to a neuron group variable. More...
 
Models::VarReference createVarRef (const CurrentSource *cs, const std::string &varName)
 Creates a reference to a current source variable. More...
 
Models::VarReference createVarRef (const CustomUpdate *cu, const std::string &varName)
 Creates a reference to a custom update variable. More...
 
Models::VarReference createPSMVarRef (const SynapseGroup *sg, const std::string &varName)
 Creates a reference to a postsynaptic model variable. More...
 
Models::VarReference createWUPreVarRef (const SynapseGroup *sg, const std::string &varName)
 Creates a reference to a weight update model presynaptic variable. More...
 
Models::VarReference createWUPostVarRef (const SynapseGroup *sg, const std::string &varName)
 Creates a reference to a weight update model postsynapticvariable. More...
 
Models::WUVarReference createWUVarRef (const SynapseGroup *sg, const std::string &varName, const SynapseGroup *transposeSG=nullptr, const std::string &transposeVarName="")
 Creates a reference to a weight update model variable. More...
 
Models::WUVarReference createWUVarRef (const CustomUpdateWU *cu, const std::string &varName)
 Creates a reference to a custom weight update variable. More...
 
Models::EGPReference createEGPRef (const NeuronGroup *ng, const std::string &egpName)
 Creates a reference to a neuron group extra global parameter. More...
 
Models::EGPReference createEGPRef (const CurrentSource *cs, const std::string &egpName)
 Creates a reference to a current source extra global parameter. More...
 
Models::EGPReference createEGPRef (const CustomUpdate *cu, const std::string &egpName)
 Creates a reference to a custom update extra global parameter. More...
 
Models::EGPReference createEGPRef (const CustomUpdateWU *cu, const std::string &egpName)
 Creates a reference to a custom weight update extra global parameter. More...
 
Models::EGPReference createPSMEGPRef (const SynapseGroup *sg, const std::string &egpName)
 Creates a reference to a postsynaptic model extra global parameter. More...
 
Models::EGPReference createWUEGPRef (const SynapseGroup *sg, const std::string &egpName)
 Creates a reference to a weight update model extra global parameter. More...
 

Detailed Description

Header file that contains the class (struct) definition of neuronModel for defining a neuron model and the class definition of ModelSpec for defining a neuronal network model. Part of the code generation and generated code sections.

Macro Definition Documentation

◆ NO_DELAY

#define NO_DELAY   0

Macro used to indicate no synapse delay for the group (only one queue slot will be generated)

Typedef Documentation

◆ NNmodel

typedef ModelSpec NNmodel

Enumeration Type Documentation

◆ FloatType

enum FloatType

Floating point precision to use for models.

Enumerator
GENN_LONG_DOUBLE 

◆ TimePrecision

enum TimePrecision
strong

Precision to use for variables which store time.

Enumerator
DEFAULT 

Time uses default model precision.

FLOAT 

Time uses single precision - not suitable for long simulations.

DOUBLE 

Time uses double precision - may reduce performance.

Function Documentation

◆ createEGPRef() [1/4]

Models::EGPReference createEGPRef ( const NeuronGroup ng,
const std::string &  egpName 
)
inline

Creates a reference to a neuron group extra global parameter.

◆ createEGPRef() [2/4]

Models::EGPReference createEGPRef ( const CurrentSource cs,
const std::string &  egpName 
)
inline

Creates a reference to a current source extra global parameter.

◆ createEGPRef() [3/4]

Models::EGPReference createEGPRef ( const CustomUpdate cu,
const std::string &  egpName 
)
inline

Creates a reference to a custom update extra global parameter.

◆ createEGPRef() [4/4]

Models::EGPReference createEGPRef ( const CustomUpdateWU cu,
const std::string &  egpName 
)
inline

Creates a reference to a custom weight update extra global parameter.

◆ createPSMEGPRef()

Models::EGPReference createPSMEGPRef ( const SynapseGroup sg,
const std::string &  egpName 
)
inline

Creates a reference to a postsynaptic model extra global parameter.

◆ createPSMVarRef()

Models::VarReference createPSMVarRef ( const SynapseGroup sg,
const std::string &  varName 
)
inline

Creates a reference to a postsynaptic model variable.

◆ createVarRef() [1/3]

Models::VarReference createVarRef ( const NeuronGroup ng,
const std::string &  varName 
)
inline

Creates a reference to a neuron group variable.

◆ createVarRef() [2/3]

Models::VarReference createVarRef ( const CurrentSource cs,
const std::string &  varName 
)
inline

Creates a reference to a current source variable.

◆ createVarRef() [3/3]

Models::VarReference createVarRef ( const CustomUpdate cu,
const std::string &  varName 
)
inline

Creates a reference to a custom update variable.

◆ createWUEGPRef()

Models::EGPReference createWUEGPRef ( const SynapseGroup sg,
const std::string &  egpName 
)
inline

Creates a reference to a weight update model extra global parameter.

◆ createWUPostVarRef()

Models::VarReference createWUPostVarRef ( const SynapseGroup sg,
const std::string &  varName 
)
inline

Creates a reference to a weight update model postsynapticvariable.

◆ createWUPreVarRef()

Models::VarReference createWUPreVarRef ( const SynapseGroup sg,
const std::string &  varName 
)
inline

Creates a reference to a weight update model presynaptic variable.

◆ createWUVarRef() [1/2]

Models::WUVarReference createWUVarRef ( const SynapseGroup sg,
const std::string &  varName,
const SynapseGroup transposeSG = nullptr,
const std::string &  transposeVarName = "" 
)
inline

Creates a reference to a weight update model variable.

◆ createWUVarRef() [2/2]

Models::WUVarReference createWUVarRef ( const CustomUpdateWU cu,
const std::string &  varName 
)
inline

Creates a reference to a custom weight update variable.

◆ initConnectivity() [1/2]

template<typename S >
InitSparseConnectivitySnippet::Init initConnectivity ( const typename S::ParamValues &  params)
inline

Initialise connectivity using a sparse connectivity snippet.

Template Parameters
Stype of sparse connectivitiy initialisation snippet (derived from InitSparseConnectivitySnippet::Base).
Parameters
paramsparameters for snippet wrapped in S::ParamValues object.
Returns
InitSparseConnectivitySnippet::Init object for passing to ModelSpec::addSynapsePopulation

◆ initConnectivity() [2/2]

template<typename S >
std::enable_if<std::is_same<typename S::ParamValues, Snippet::ValueBase<0> >::value, InitSparseConnectivitySnippet::Init>::type initConnectivity ( )
inline

Initialise connectivity using a sparse connectivity snippet with no parameters.

Template Parameters
Stype of sparse connectivitiy initialisation snippet (derived from InitSparseConnectivitySnippet::Base).
Returns
InitSparseConnectivitySnippet::Init object for passing to ModelSpec::addSynapsePopulation

◆ initToeplitzConnectivity() [1/2]

template<typename S >
InitToeplitzConnectivitySnippet::Init initToeplitzConnectivity ( const typename S::ParamValues &  params)
inline

Initialise toeplitz connectivity using a toeplitz connectivity snippet.

Template Parameters
Stype of toeplitz connectivitiy initialisation snippet (derived from InitToeplitzConnectivitySnippet::Base).
Parameters
paramsparameters for snippet wrapped in S::ParamValues object.
Returns
InitToeplitzConnectivitySnippet::Init object for passing to ModelSpec::addSynapsePopulation

◆ initToeplitzConnectivity() [2/2]

template<typename S >
std::enable_if<std::is_same<typename S::ParamValues, Snippet::ValueBase<0> >::value, InitToeplitzConnectivitySnippet::Init>::type initToeplitzConnectivity ( )
inline

Initialise connectivity using a toeplitz connectivity snippet with no parameters.

Template Parameters
Stype of toeplitz connectivitiy initialisation snippet (derived from InitToeplitzConnectivitySnippet::Base).
Returns
InitToeplitzConnectivitySnippet::Init object for passing to ModelSpec::addSynapsePopulation

◆ initVar() [1/2]

template<typename S >
Models::VarInit initVar ( const typename S::ParamValues &  params)
inline

Initialise a variable using an initialisation snippet.

Template Parameters
Stype of variable initialisation snippet (derived from InitVarSnippet::Base).
Parameters
paramsparameters for snippet wrapped in S::ParamValues object.
Returns
Models::VarInit object for use within model's VarValues

◆ initVar() [2/2]

template<typename S >
std::enable_if<std::is_same<typename S::ParamValues, Snippet::ValueBase<0> >::value, Models::VarInit>::type initVar ( )
inline

Initialise a variable using an initialisation snippet with no parameters.

Template Parameters
Stype of variable initialisation snippet (derived from InitVarSnippet::Base).
Returns
Models::VarInit object for use within model's VarValues

◆ uninitialisedConnectivity()

InitSparseConnectivitySnippet::Init uninitialisedConnectivity ( )
inline

Mark a synapse group's sparse connectivity as uninitialised.

This means that the backend will not generate any automatic initialization code, but will instead copy the connectivity from host to device during initializeSparse function (and, if necessary generate any additional data structures it requires)

◆ uninitialisedVar()

Models::VarInit uninitialisedVar ( )
inline

Mark a variable as uninitialised.

This means that the backend will not generate any automatic initialization code, but will instead copy the variable from host to device during initializeSparse function