![]() |
GeNN
1.1
GPU enhanced Neuronal Networks (GeNN)
|
#include <modelSpec.h>
Public Member Functions | |
NNmodel () | |
~NNmodel () | |
void | setName (const string) |
Method to set the neuronal network model name. More... | |
void | setPrecision (unsigned int) |
This function sets the numerical precision of floating type variables. By default, it is float. More... | |
void | checkSizes (unsigned int *, unsigned int *, unsigned int *) |
This function checks if the number of parameters and variables that are defined by the user are of correct size with respect to the selected neuron and synapse type. More... | |
void | resetPaddedSums () |
Re-calculates the block-size-padded sum of threads needed to compute the groups of neurons and synapses assigned to each device. Must be called after changing the hostID:deviceID of any group. More... | |
void | setGPUDevice (int) |
Method to choose the GPU to be used for the model. If "AUTODEVICE' (-1), GeNN will choose the device based on a heuristic rule. More... | |
void | addNeuronPopulation (const char *, unsigned int, unsigned int, float *, float *) |
Method for adding a neuron population to a neuronal network model, using C style character array for the name of the population. More... | |
void | addNeuronPopulation (const string, unsigned int, unsigned int, float *, float *) |
Method for adding a neuron population to a neuronal network model, using C++ string for the name of the population. More... | |
void | activateDirectInput (const string, unsigned int) |
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, float) |
Method for setting the global input value for a neuron population if CONSTINP. More... | |
void | setNeuronClusterIndex (const string neuronGroup, int hostID, int deviceID) |
Function for setting which host and which device a neuron group will be simulated on. More... | |
void | addSynapsePopulation (const string name, unsigned int syntype, unsigned int conntype, unsigned int gtype, const string src, const string trg, float *p) __attribute__((deprecated)) |
Overload of method for backwards compatibility. More... | |
void | addSynapsePopulation (const char *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, const char *, const char *, float *, float *, float *) |
Method for adding a synapse population to a neuronal network model, using C style character array for the name of the population. More... | |
void | addSynapsePopulation (const string, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, const string, const string, float *, float *, float *) |
Method for adding a synapse population to a neuronal network model, using C++ string for the name of the population. More... | |
void | setSynapseG (const string, float) |
Method for setting the conductance (g) value for a synapse population with "GLOBALG" charactertistic. More... | |
void | setMaxConn (const string, unsigned int) |
This function defines the maximum number of connections for a neuron in the population. More... | |
void | setSynapseClusterIndex (const string synapseGroup, int hostID, int deviceID) |
Function for setting which host and which device a synapse group will be simulated on. More... | |
Public Attributes | |
string | name |
Name of the neuronal newtwork model. More... | |
string | ftype |
Numerical precision of the floating point variables. More... | |
int | valid |
Flag for whether the model has been validated (unused?) More... | |
unsigned int | needSt |
Whether last spike times are needed at all in this network model (related to STDP) More... | |
unsigned int | needSynapseDelay |
Whether delayed synapse conductance is required in the network. More... | |
int | chooseGPUDevice |
vector< string > | neuronName |
Names of neuron groups. More... | |
unsigned int | neuronGrpN |
Number of neuron groups. More... | |
vector< unsigned int > | neuronN |
Number of neurons in group. More... | |
vector< unsigned int > | sumNeuronN |
Summed neuron numbers. More... | |
vector< unsigned int > | padSumNeuronN |
Padded summed neuron numbers. More... | |
vector< unsigned int > | neuronPostSyn |
vector< unsigned int > | neuronType |
Postsynaptic methods to the neuron. More... | |
vector< vector< float > > | neuronPara |
Parameters of neurons. More... | |
vector< vector< float > > | dnp |
Derived neuron parameters. More... | |
vector< vector< float > > | neuronIni |
Initial values of neurons. More... | |
vector< vector< unsigned int > > | inSyn |
The ids of the incoming synapse groups. More... | |
vector< int > | receivesInputCurrent |
flags whether neurons of a population receive explicit input currents More... | |
vector< unsigned int > | neuronNeedSt |
Whether last spike time needs to be saved for each indivual neuron type. More... | |
vector< unsigned int > | neuronDelaySlots |
The number of slots needed in the synapse delay queues of a neuron group. More... | |
vector< int > | neuronHostID |
The ID of the cluster node which the neuron groups are computed on. More... | |
vector< int > | neuronDeviceID |
The ID of the CUDA device which the neuron groups are comnputed on. More... | |
vector< float > | nSpkEvntThreshold |
vector< string > | synapseName |
Names of synapse groups. More... | |
unsigned int | synapseGrpN |
Number of synapse groups. More... | |
vector< unsigned int > | sumSynapseTrgN |
Summed naumber of target neurons. More... | |
vector< unsigned int > | padSumSynapseTrgN |
"Padded" summed target neuron numbers More... | |
vector< unsigned int > | maxConn |
Padded summed maximum number of connections for a neuron in the neuron groups. More... | |
vector< unsigned int > | padSumSynapseKrnl |
vector< unsigned int > | synapseType |
Types of synapses. More... | |
vector< unsigned int > | synapseConnType |
Connectivity type of synapses. More... | |
vector< unsigned int > | synapseGType |
Type of specification method for synaptic conductance. More... | |
vector< unsigned int > | synapseSource |
Presynaptic neuron groups. More... | |
vector< unsigned int > | synapseTarget |
Postsynaptic neuron groups. More... | |
vector< unsigned int > | synapseInSynNo |
IDs of the target neurons' incoming synapse variables for each synapse group. More... | |
vector< vector< float > > | synapsePara |
parameters of synapses More... | |
vector< vector< float > > | dsp |
Derived synapse parameters. More... | |
vector< unsigned int > | postSynapseType |
Types of synapses. More... | |
vector< vector< float > > | postSynapsePara |
parameters of postsynapses More... | |
vector< vector< float > > | postSynIni |
Initial values of postsynaptic variables. More... | |
vector< vector< float > > | dpsp |
Derived postsynapse parameters. More... | |
vector< float > | g0 |
Global synapse conductance if GLOBALG is chosen. More... | |
vector< float > | globalInp |
Global explicit input if CONSTINP is chosen. More... | |
unsigned int | lrnGroups |
Number of synapse groups with learning. More... | |
vector< unsigned int > | padSumLearnN |
Padded summed neuron numbers of learn group source populations. More... | |
vector< unsigned int > | lrnSynGrp |
Enumeration of the IDs of synapse groups that learn. More... | |
vector< unsigned int > | synapseDelay |
Global synaptic conductance delay for the group (in time steps) More... | |
vector< int > | synapseHostID |
The ID of the cluster node which the synapse groups are computed on. More... | |
vector< int > | synapseDeviceID |
The ID of the CUDA device which the synapse groups are comnputed on. More... | |
NNmodel::NNmodel | ( | ) |
NNmodel::~NNmodel | ( | ) |
void NNmodel::activateDirectInput | ( | const string | name, |
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.
name | Name of the neuron population |
type | Type of input: 1 if common input, 2 if custom input from file, 3 if custom input as a rule |
void NNmodel::addNeuronPopulation | ( | const char * | name, |
unsigned int | nNo, | ||
unsigned int | type, | ||
float * | p, | ||
float * | ini | ||
) |
Method for adding a neuron population to a neuronal network model, using C style character array for the name of the population.
name | 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 |
void NNmodel::addNeuronPopulation | ( | const string | name, |
unsigned int | nNo, | ||
unsigned int | type, | ||
float * | p, | ||
float * | ini | ||
) |
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.
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 |
void NNmodel::addSynapsePopulation | ( | const string | name, |
unsigned int | syntype, | ||
unsigned int | conntype, | ||
unsigned int | gtype, | ||
const string | src, | ||
const string | target, | ||
float * | params | ||
) |
Overload of method for backwards compatibility.
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 |
target | Name of the (existing!) post-synaptic neuron population |
params | A C-type array of floats that contains synapse parameter values (common to all synapses of the population) which will be used for the defined synapses. The array must contain the right number of parameters in the right order for the chosen synapse type. If too few, segmentation faults will occur, if too many, excess will be ignored. |
void NNmodel::addSynapsePopulation | ( | const char * | name, |
unsigned int | syntype, | ||
unsigned int | conntype, | ||
unsigned int | gtype, | ||
unsigned int | delaySteps, | ||
unsigned int | postsyn, | ||
const char * | src, | ||
const char * | trg, | ||
float * | p, | ||
float * | PSVini, | ||
float * | ps | ||
) |
Method for adding a synapse population to a neuronal network model, using C style character array for the name of the population.
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 floats that contains synapse parameter values (common to all synapses of the population) which will be used for the defined synapses. The array must contain the right number of parameters in the right order for the chosen synapse type. If too few, segmentation faults will occur, if too many, excess will be ignored. |
PSVini | A C-type array of floats that contains the initial values for postsynaptic mechanism variables (common to all synapses of the population) which will be used for the defined synapses. The array must contain the right number of parameters in the right order for the chosen synapse type. If too few, segmentation faults will occur, if too many, excess will be ignored. |
ps | A C-type array of floats that contains postsynaptic mechanism parameter values (common to all synapses of the population) which will be used for the defined synapses. The array must contain the right number of parameters in the right order for the chosen synapse type. If too few, segmentation faults will occur, if too many, excess will be ignored. |
void NNmodel::addSynapsePopulation | ( | const string | name, |
unsigned int | syntype, | ||
unsigned int | conntype, | ||
unsigned int | gtype, | ||
unsigned int | delaySteps, | ||
unsigned int | postsyn, | ||
const string | src, | ||
const string | trg, | ||
float * | p, | ||
float * | PSVini, | ||
float * | 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 |
p | A C-type array of floats that contains synapse parameter values (common to all synapses of the population) which will be used for the defined synapses. The array must contain the right number of parameters in the right order for the chosen synapse type. If too few, segmentation faults will occur, if too many, excess will be ignored. |
PSVini | A C-type array of floats that contains the initial values for postsynaptic mechanism variables (common to all synapses of the population) which will be used for the defined synapses. The array must contain the right number of parameters in the right order for the chosen synapse type. If too few, segmentation faults will occur, if too many, excess will be ignored. |
ps | A C-type array of floats that contains postsynaptic mechanism parameter values (common to all synapses of the population) which will be used for the defined synapses. The array must contain the right number of parameters in the right order for the chosen synapse type. If too few, segmentation faults will occur, if too many, excess will be ignored. |
void NNmodel::checkSizes | ( | unsigned int * | NeuronpSize, |
unsigned int * | NeuronvSize, | ||
unsigned int * | SynpSize | ||
) |
This function checks if the number of parameters and variables that are defined by the user are of correct size with respect to the selected neuron and synapse type.
NeuronpSize | Array containing the number of neuron population parameters for each neuron population added, in the adding order |
NeuronvSize | Array containing the number of neuron population variables for each neuron population added, in the adding order |
SynpSize | Array containing the number of synapse population parameters for each neuron population added, in the adding order |
void NNmodel::resetPaddedSums | ( | ) |
Re-calculates the block-size-padded sum of threads needed to compute the groups of neurons and synapses assigned to each device. Must be called after changing the hostID:deviceID of any group.
This function re-calculates the block-size-padded sum of threads needed to compute the groups of neurons and synapses assigned to each device. Must be called after changing the hostID:deviceID of any neuron or synapse group.
void NNmodel::setConstInp | ( | const string | sName, |
float | globalInp0 | ||
) |
Method for setting the global input value for a neuron population if CONSTINP.
This function sets a global input value to the specified neuron group.
void NNmodel::setGPUDevice | ( | int | device | ) |
Method to choose the GPU to be used for the model. If "AUTODEVICE' (-1), GeNN will choose the device based on a heuristic rule.
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.
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 string | inname | ) |
Method to set the neuronal network model name.
void NNmodel::setNeuronClusterIndex | ( | const string | neuronGroup, |
int | hostID, | ||
int | deviceID | ||
) |
Function for setting which host and which device a neuron group will be simulated on.
This function is for setting which host and which device a neuron group will be simulated on.
neuronGroup | Name of the neuron population |
hostID | ID of the host |
deviceID | ID of the device |
void NNmodel::setPrecision | ( | unsigned int | floattype | ) |
This function sets the numerical precision of floating type variables. By default, it is float.
void NNmodel::setSynapseClusterIndex | ( | const string | synapseGroup, |
int | hostID, | ||
int | deviceID | ||
) |
Function for setting which host and which device a synapse group will be simulated on.
This function is for setting which host and which device a synapse group will be simulated on.
synapseGroup | Name of the synapse population |
hostID | ID of the host |
deviceID | ID of the device |
void NNmodel::setSynapseG | ( | const string | sName, |
float | g | ||
) |
Method for setting the conductance (g) value for a synapse population with "GLOBALG" charactertistic.
This functions sets the global value of the maximal synaptic conductance for a synapse population that was idfentified as conductance specifcation method "GLOBALG".
int NNmodel::chooseGPUDevice |
vector<vector<float> > NNmodel::dnp |
Derived neuron parameters.
vector<vector<float> > NNmodel::dpsp |
Derived postsynapse parameters.
vector<vector<float> > NNmodel::dsp |
Derived synapse parameters.
string NNmodel::ftype |
Numerical precision of the floating point variables.
vector<float> NNmodel::g0 |
Global synapse conductance if GLOBALG is chosen.
vector<float> NNmodel::globalInp |
Global explicit input if CONSTINP is chosen.
vector<vector<unsigned int> > NNmodel::inSyn |
The ids of the incoming synapse groups.
unsigned int NNmodel::lrnGroups |
Number of synapse groups with learning.
vector<unsigned int> NNmodel::lrnSynGrp |
Enumeration of the IDs of synapse groups that learn.
vector<unsigned int> NNmodel::maxConn |
Padded summed maximum number of connections for a neuron in the neuron groups.
string NNmodel::name |
Name of the neuronal newtwork model.
unsigned int NNmodel::needSt |
Whether last spike times are needed at all in this network model (related to STDP)
unsigned int NNmodel::needSynapseDelay |
Whether delayed synapse conductance is required in the network.
vector<unsigned int> NNmodel::neuronDelaySlots |
The number of slots needed in the synapse delay queues of a neuron group.
vector<int> NNmodel::neuronDeviceID |
The ID of the CUDA device which the neuron groups are comnputed on.
Threshold for detecting a spike event for each neuron type.
unsigned int NNmodel::neuronGrpN |
Number of neuron groups.
vector<int> NNmodel::neuronHostID |
The ID of the cluster node which the neuron groups are computed on.
vector<vector<float> > NNmodel::neuronIni |
Initial values of neurons.
vector<unsigned int> NNmodel::neuronN |
Number of neurons in group.
vector<string> NNmodel::neuronName |
Names of neuron groups.
vector<unsigned int> NNmodel::neuronNeedSt |
Whether last spike time needs to be saved for each indivual neuron type.
vector<vector<float> > NNmodel::neuronPara |
Parameters of neurons.
vector<unsigned int> NNmodel::neuronPostSyn |
vector<unsigned int> NNmodel::neuronType |
Postsynaptic methods to the neuron.
Types of neurons
vector<float> NNmodel::nSpkEvntThreshold |
vector<unsigned int> NNmodel::padSumLearnN |
Padded summed neuron numbers of learn group source populations.
vector<unsigned int> NNmodel::padSumNeuronN |
Padded summed neuron numbers.
vector<unsigned int> NNmodel::padSumSynapseKrnl |
vector<unsigned int> NNmodel::padSumSynapseTrgN |
"Padded" summed target neuron numbers
vector<vector<float> > NNmodel::postSynapsePara |
parameters of postsynapses
vector<unsigned int> NNmodel::postSynapseType |
Types of synapses.
vector<vector<float> > NNmodel::postSynIni |
Initial values of postsynaptic variables.
vector<int> NNmodel::receivesInputCurrent |
flags whether neurons of a population receive explicit input currents
vector<unsigned int> NNmodel::sumNeuronN |
Summed neuron numbers.
vector<unsigned int> NNmodel::sumSynapseTrgN |
Summed naumber of target neurons.
vector<unsigned int> NNmodel::synapseConnType |
Connectivity type of synapses.
vector<unsigned int> NNmodel::synapseDelay |
Global synaptic conductance delay for the group (in time steps)
vector<int> NNmodel::synapseDeviceID |
The ID of the CUDA device which the synapse groups are comnputed on.
unsigned int NNmodel::synapseGrpN |
Number of synapse groups.
vector<unsigned int> NNmodel::synapseGType |
Type of specification method for synaptic conductance.
vector<int> NNmodel::synapseHostID |
The ID of the cluster node which the synapse groups are computed on.
vector<unsigned int> NNmodel::synapseInSynNo |
IDs of the target neurons' incoming synapse variables for each synapse group.
vector<string> NNmodel::synapseName |
Names of synapse groups.
vector<vector<float> > NNmodel::synapsePara |
parameters of synapses
vector<unsigned int> NNmodel::synapseSource |
Presynaptic neuron groups.
vector<unsigned int> NNmodel::synapseTarget |
Postsynaptic neuron groups.
vector<unsigned int> NNmodel::synapseType |
Types of synapses.
int NNmodel::valid |
Flag for whether the model has been validated (unused?)