23 const std::vector<double> ¶ms,
const std::vector<NewModels::VarInit> &varInitialisers,
int hostID,
int deviceID) :
24 m_Name(name), m_NumNeurons(numNeurons), m_IDRange(0, 0), m_PaddedIDRange(0, 0),
25 m_NeuronModel(neuronModel), m_Params(params), m_VarInitialisers(varInitialisers),
26 m_SpikeTimeRequired(false), m_TrueSpikeRequired(false), m_SpikeEventRequired(false),
27 m_NumDelaySlots(1), m_VarQueueRequired(varInitialisers.size(), false),
30 m_HostID(hostID), m_DeviceID(deviceID)
102 void calcSizes(
unsigned int blockSize,
unsigned int &idStart,
unsigned int &paddedIDStart);
113 const std::string &
getName()
const{
return m_Name; }
117 const std::pair<unsigned int, unsigned int> &
getPaddedIDRange()
const{
return m_PaddedIDRange; }
118 const std::pair<unsigned int, unsigned int> &
getIDRange()
const{
return m_IDRange; }
123 const std::vector<double> &
getParams()
const{
return m_Params; }
128 const std::vector<SynapseGroup*> &
getInSyn()
const{
return m_InSyn; }
129 const std::vector<std::pair<SynapseGroup*, std::vector<SynapseGroup*>>> &
getMergedInSyn()
const{
return m_MergedInSyn; }
132 const std::vector<SynapseGroup*> &
getOutSyn()
const{
return m_OutSyn; }
213 void updateVarQueues(
const std::string &code,
const std::string &suffix);
220 unsigned int m_NumNeurons;
221 std::pair<unsigned int, unsigned int> m_IDRange;
222 std::pair<unsigned int, unsigned int> m_PaddedIDRange;
225 std::vector<double> m_Params;
226 std::vector<double> m_DerivedParams;
227 std::vector<NewModels::VarInit> m_VarInitialisers;
228 std::vector<SynapseGroup*> m_InSyn;
229 std::vector<SynapseGroup*> m_OutSyn;
230 std::vector<std::pair<SynapseGroup*, std::vector<SynapseGroup*>>> m_MergedInSyn;
231 bool m_SpikeTimeRequired;
232 bool m_TrueSpikeRequired;
233 bool m_SpikeEventRequired;
234 std::set<std::pair<std::string, std::string>> m_SpikeEventCondition;
235 unsigned int m_NumDelaySlots;
236 std::vector<CurrentSource*> m_CurrentSources;
239 std::vector<bool> m_VarQueueRequired;
251 std::vector<VarMode> m_VarMode;
const std::pair< unsigned int, unsigned int > & getIDRange() const
Definition: neuronGroup.h:118
void setSpikeTimeZeroCopyEnabled(bool enabled)
Function to enable the use of zero-copied memory for spike times (deprecated use NeuronGroup::setSpik...
Definition: neuronGroup.h:68
void addInSyn(SynapseGroup *synapseGroup)
Definition: neuronGroup.h:98
Definition: neuronGroup.h:19
VarMode getVarMode(size_t index) const
Get variable mode used by neuron model state variable.
Definition: neuronGroup.h:172
void setSpikeEventZeroCopyEnabled(bool enabled)
Function to enable the use of zero-copied memory for spike-like events (deprecated use NeuronGroup::s...
Definition: neuronGroup.h:61
const std::vector< SynapseGroup * > & getInSyn() const
Gets pointers to all synapse groups which provide input to this neuron group.
Definition: neuronGroup.h:128
void setSpikeEventVarMode(VarMode mode)
Set variable mode used for variables containing this neuron group's output spike events.
Definition: neuronGroup.h:86
bool isDelayRequired() const
Definition: neuronGroup.h:151
bool isSpikeTimeZeroCopyEnabled() const
Definition: neuronGroup.h:155
NeuronGroup(const std::string &name, int numNeurons, const NeuronModels::Base *neuronModel, const std::vector< double > ¶ms, const std::vector< NewModels::VarInit > &varInitialisers, int hostID, int deviceID)
Definition: neuronGroup.h:22
const std::vector< CurrentSource * > & getCurrentSources() const
Gets pointers to all current sources which provide input to this neuron group.
Definition: neuronGroup.h:135
void addExtraGlobalParams(std::map< std::string, std::string > &kernelParameters) const
Definition: neuronGroup.cc:191
unsigned int getNumNeurons() const
Gets number of neurons in group.
Definition: neuronGroup.h:116
const std::vector< SynapseGroup * > & getOutSyn() const
Gets pointers to all synapse groups emanating from this neuron group.
Definition: neuronGroup.h:132
bool isDeviceInitRequired() const
Is any form of device initialisation required?
Definition: neuronGroup.cc:311
VarMode getSpikeVarMode() const
Get variable mode used for variables containing this neuron group's output spikes.
Definition: neuronGroup.h:160
bool isSimRNGRequired() const
Does this neuron group require an RNG to simulate?
Definition: neuronGroup.cc:216
class for specifying a neuron model.
Definition: neuronModels.h:16
const std::pair< unsigned int, unsigned int > & getPaddedIDRange() const
Definition: neuronGroup.h:117
bool canRunOnCPU() const
Can this neuron group run on the CPU?
Definition: neuronGroup.cc:316
unsigned int getNumDelaySlots() const
Definition: neuronGroup.h:150
void calcSizes(unsigned int blockSize, unsigned int &idStart, unsigned int &paddedIDStart)
Definition: neuronGroup.cc:68
bool isVarQueueRequired(const std::string &var) const
Definition: neuronGroup.cc:154
bool isSpikeTimeRequired() const
Definition: neuronGroup.h:141
bool isDeviceVarInitRequired() const
Is device var init code required for any variables in this neuron group?
Definition: neuronGroup.cc:263
VarMode
Definition: variableMode.h:25
Global header file containing a few global variables. Part of the code generation section...
int getClusterDeviceID() const
Definition: neuronGroup.h:139
name
Definition: setup.py:112
std::string getPrevQueueOffset(const std::string &devPrefix) const
Get the expression to calculate the queue offset for accessing state of variables in previous timeste...
Definition: neuronGroup.cc:356
bool isTrueSpikeRequired() const
Definition: neuronGroup.h:142
VarMode getSpikeTimeVarMode() const
Get variable mode used for variables containing this neuron group's output spike times.
Definition: neuronGroup.h:166
void updatePostVarQueues(const std::string &code)
Update which postsynaptic variables require queues based on piece of code.
Definition: neuronGroup.cc:30
bool isVarQueueRequired(size_t index) const
Definition: neuronGroup.h:146
void setSpikeVarMode(VarMode mode)
Set variable mode used for variables containing this neuron group's output spikes.
Definition: neuronGroup.h:82
bool hasOutputToHost(int targetHostID) const
Does this neuron group have outgoing connections specified host id?
Definition: neuronGroup.cc:338
const NeuronModels::Base * getNeuronModel() const
Gets the neuron model used by this group.
Definition: neuronGroup.h:121
void updatePreVarQueues(const std::string &code)
Update which presynaptic variables require queues based on piece of code.
Definition: neuronGroup.cc:25
void addSpkEventCondition(const std::string &code, const std::string &supportCodeNamespace)
Definition: neuronGroup.cc:45
VarMode defaultVarMode
What is the default behaviour for model state variables? Historically, everything was allocated on bo...
Definition: global.cc:43
void setSpikeTimeVarMode(VarMode mode)
Set variable mode used for variables containing this neuron group's output spike times.
Definition: neuronGroup.h:90
const std::vector< NewModels::VarInit > & getVarInitialisers() const
Definition: neuronGroup.h:125
Definition: synapseGroup.h:19
void setSpikeZeroCopyEnabled(bool enabled)
Function to enable the use of zero-copied memory for spikes (deprecated use NeuronGroup::setSpikeVarM...
Definition: neuronGroup.h:54
const std::vector< std::pair< SynapseGroup *, std::vector< SynapseGroup * > > > & getMergedInSyn() const
Definition: neuronGroup.h:129
bool isZeroCopyEnabled() const
Definition: neuronGroup.cc:160
void checkNumDelaySlots(unsigned int requiredDelay)
Checks delay slots currently provided by the neuron group against a required delay and extends if req...
Definition: neuronGroup.cc:17
void setTrueSpikeRequired(bool req)
Definition: neuronGroup.h:49
bool isVarZeroCopyEnabled(const std::string &var) const
Definition: neuronGroup.h:157
const std::vector< double > & getParams() const
Definition: neuronGroup.h:123
bool isSpikeEventRequired() const
Definition: neuronGroup.h:143
VarMode getSpikeEventVarMode() const
Get variable mode used for variables containing this neuron group's output spike events.
Definition: neuronGroup.h:163
void addOutSyn(SynapseGroup *synapseGroup)
Definition: neuronGroup.h:99
bool isSpikeEventZeroCopyEnabled() const
Definition: neuronGroup.h:154
int getClusterHostID() const
Definition: neuronGroup.h:137
void setSpikeEventRequired(bool req)
Definition: neuronGroup.h:50
bool isInitRNGRequired(VarInit varInitMode) const
Does this neuron group require an RNG for it's init code?
Definition: neuronGroup.cc:243
void setVarMode(const std::string &varName, VarMode mode)
Set variable mode of neuron model state variable.
Definition: neuronGroup.cc:35
void injectCurrent(CurrentSource *source)
add input current source
Definition: neuronGroup.cc:363
std::string getCurrentQueueOffset(const std::string &devPrefix) const
Get the expression to calculate the queue offset for accessing state of variables this timestep...
Definition: neuronGroup.cc:349
bool isInitCodeRequired() const
Does this neuron group require any initialisation code to be run?
Definition: neuronGroup.cc:206
void mergeIncomingPSM()
Merge incoming postsynaptic models.
Definition: neuronGroup.cc:86
void initDerivedParams(double dt)
Definition: neuronGroup.cc:50
const std::string & getName() const
Definition: neuronGroup.h:113
const std::vector< double > & getDerivedParams() const
Definition: neuronGroup.h:124
bool isSpikeZeroCopyEnabled() const
Definition: neuronGroup.h:153
Base class for all neuron models.
Definition: newNeuronModels.h:31
bool isParamRequiredBySpikeEventCondition(const std::string &pnamefull) const
Do any of the spike event conditions tested by this neuron require specified parameter?
Definition: neuronGroup.cc:177
const std::set< std::pair< std::string, std::string > > & getSpikeEventCondition() const
Definition: neuronGroup.h:148
void setSpikeTimeRequired(bool req)
Definition: neuronGroup.h:48
VarMode getVarMode(const std::string &varName) const
Get variable mode used by neuron model state variable.
Definition: neuronGroup.cc:40
void setVarZeroCopyEnabled(const std::string &varName, bool enabled)
Function to enable the use zero-copied memory for a particular state variable (deprecated use NeuronG...
Definition: neuronGroup.h:75
VarInit
Definition: variableMode.h:18
Definition: currentSource.h:17