GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
CodeGenerator::NeuronInitGroupMerged Class Reference

#include <initGroupMerged.h>

Inheritance diagram for CodeGenerator::NeuronInitGroupMerged:
CodeGenerator::NeuronGroupMergedBase CodeGenerator::GroupMerged< NeuronGroupInternal >

Public Member Functions

 NeuronInitGroupMerged (size_t index, const std::string &precision, const std::string &timePrecision, const BackendBase &backend, const std::vector< std::reference_wrapper< const NeuronGroupInternal >> &groups)
 
bool isInSynWUMVarInitParamHeterogeneous (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Should the incoming synapse weight update model var init parameter be implemented heterogeneously? More...
 
bool isInSynWUMVarInitDerivedParamHeterogeneous (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Should the incoming synapse weight update model var init derived parameter be implemented heterogeneously? More...
 
bool isOutSynWUMVarInitParamHeterogeneous (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Should the outgoing synapse weight update model var init parameter be implemented heterogeneously? More...
 
bool isOutSynWUMVarInitDerivedParamHeterogeneous (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Should the outgoing synapse weight update model var init derived parameter be implemented heterogeneously? More...
 
const std::vector< SynapseGroupInternal * > & getSortedArchetypeInSynWithPostVars () const
 Get sorted vectors of incoming synapse groups with postsynaptic variables belonging to archetype group. More...
 
const std::vector< SynapseGroupInternal * > & getSortedArchetypeOutSynWithPreVars () const
 Get sorted vectors of outgoing synapse groups with presynaptic variables belonging to archetype group. More...
 
boost::uuids::detail::sha1::digest_type getHashDigest () const
 Get hash digest used for detecting changes. More...
 
void generateRunner (const BackendBase &backend, CodeStream &definitionsInternal, CodeStream &definitionsInternalFunc, CodeStream &definitionsInternalVar, CodeStream &runnerVarDecl, CodeStream &runnerMergedStructAlloc) const
 
void generateInit (const BackendBase &backend, CodeStream &os, const ModelSpecMerged &modelMerged, Substitutions &popSubs) const
 
- Public Member Functions inherited from CodeGenerator::NeuronGroupMergedBase
bool isParamHeterogeneous (size_t index) const
 Should the parameter be implemented heterogeneously? More...
 
bool isDerivedParamHeterogeneous (size_t index) const
 Should the derived parameter be implemented heterogeneously? More...
 
bool isVarInitParamHeterogeneous (size_t varIndex, size_t paramIndex) const
 Should the var init parameter be implemented heterogeneously? More...
 
bool isVarInitDerivedParamHeterogeneous (size_t varIndex, size_t paramIndex) const
 Should the var init derived parameter be implemented heterogeneously? More...
 
bool isCurrentSourceParamHeterogeneous (size_t childIndex, size_t paramIndex) const
 Should the current source parameter be implemented heterogeneously? More...
 
bool isCurrentSourceDerivedParamHeterogeneous (size_t childIndex, size_t paramIndex) const
 Should the current source derived parameter be implemented heterogeneously? More...
 
bool isCurrentSourceVarInitParamHeterogeneous (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Should the current source var init parameter be implemented heterogeneously? More...
 
bool isCurrentSourceVarInitDerivedParamHeterogeneous (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Should the current source var init derived parameter be implemented heterogeneously? More...
 
bool isPSMParamHeterogeneous (size_t childIndex, size_t paramIndex) const
 Should the postsynaptic model parameter be implemented heterogeneously? More...
 
bool isPSMDerivedParamHeterogeneous (size_t childIndex, size_t varIndex) const
 Should the postsynaptic model derived parameter be implemented heterogeneously? More...
 
bool isPSMGlobalVarHeterogeneous (size_t childIndex, size_t paramIndex) const
 Should the GLOBALG postsynaptic model variable be implemented heterogeneously? More...
 
bool isPSMVarInitParamHeterogeneous (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Should the postsynaptic model var init parameter be implemented heterogeneously? More...
 
bool isPSMVarInitDerivedParamHeterogeneous (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Should the postsynaptic model var init derived parameter be implemented heterogeneously? More...
 
const std::vector< SynapseGroupInternal * > & getSortedArchetypeMergedInSyns () const
 Get sorted vectors of merged incoming synapse groups belonging to archetype group. More...
 
const std::vector< SynapseGroupInternal * > & getSortedArchetypeMergedPreOutputOutSyns () const
 Get sorted vectors of merged outgoing synapse groups with presynaptic output belonging to archetype group. More...
 
const std::vector< CurrentSourceInternal * > & getSortedArchetypeCurrentSources () const
 Get sorted vectors of current sources belonging to archetype group. More...
 
- Public Member Functions inherited from CodeGenerator::GroupMerged< NeuronGroupInternal >
 GroupMerged (size_t index, const std::string &precision, const std::vector< std::reference_wrapper< const GroupInternal >> groups)
 
size_t getIndex () const
 
const GroupInternalgetArchetype () const
 Get 'archetype' neuron group - it's properties represent those of all other merged neuron groups. More...
 
const std::string & getMemorySpace () const
 Get name of memory space assigned to group. More...
 
const std::vector< std::reference_wrapper< const GroupInternal > > & getGroups () const
 Gets access to underlying vector of neuron groups which have been merged. More...
 
const std::vector< Field > & getFields () const
 Get group fields. More...
 
std::vector< FieldgetSortedFields (const BackendBase &backend) const
 Get group fields, sorted into order they will appear in struct. More...
 
void generateStruct (CodeStream &os, const BackendBase &backend, const std::string &name, bool host=false) const
 Generate declaration of struct to hold this merged group. More...
 
void generateStructFieldArgumentDefinitions (CodeStream &os, const BackendBase &backend) const
 
size_t getStructArraySize (const BackendBase &backend) const
 
void assignMemorySpaces (const BackendBase &backend, BackendBase::MemorySpaces &memorySpaces)
 Assign memory spaces to group. More...
 

Static Public Attributes

static const std::string name = "NeuronInit"
 

Additional Inherited Members

- Public Types inherited from CodeGenerator::GroupMerged< NeuronGroupInternal >
enum  FieldType
 
typedef NeuronGroupInternal GroupInternal
 
typedef std::function< std::string(const NeuronGroupInternal &, size_t)> GetFieldValueFunc
 
typedef std::tuple< std::string, std::string, GetFieldValueFunc, FieldTypeField
 
- Protected Member Functions inherited from CodeGenerator::NeuronGroupMergedBase
 NeuronGroupMergedBase (size_t index, const std::string &precision, const std::string &timePrecision, const BackendBase &backend, bool init, const std::vector< std::reference_wrapper< const NeuronGroupInternal >> &groups)
 
void updateBaseHash (bool init, boost::uuids::detail::sha1 &hash) const
 
template<typename T , typename G , typename H >
void orderNeuronGroupChildren (std::vector< std::vector< T *>> &sortedGroupChildren, G getVectorFunc, H getHashDigestFunc) const
 
bool isVarInitParamReferenced (size_t varIndex, size_t paramIndex) const
 Is the var init parameter referenced? More...
 
bool isVarInitDerivedParamReferenced (size_t varIndex, size_t paramIndex) const
 Is the var init derived parameter referenced? More...
 
bool isCurrentSourceParamReferenced (size_t childIndex, size_t paramIndex) const
 Is the current source parameter referenced? More...
 
bool isCurrentSourceDerivedParamReferenced (size_t childIndex, size_t paramIndex) const
 Is the current source derived parameter referenced? More...
 
bool isCurrentSourceVarInitParamReferenced (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Is the current source var init parameter referenced? More...
 
bool isCurrentSourceVarInitDerivedParamReferenced (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Is the current source var init derived parameter referenced? More...
 
bool isPSMParamReferenced (size_t childIndex, size_t paramIndex) const
 Is the postsynaptic model parameter referenced? More...
 
bool isPSMDerivedParamReferenced (size_t childIndex, size_t varIndex) const
 Is the postsynaptic model derived parameter referenced? More...
 
bool isPSMGlobalVarReferenced (size_t childIndex, size_t varIndex) const
 Is the GLOBALG postsynaptic model variable referenced? More...
 
bool isPSMVarInitParamReferenced (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Is the postsynaptic model var init parameter referenced? More...
 
bool isPSMVarInitDerivedParamReferenced (size_t childIndex, size_t varIndex, size_t paramIndex) const
 Is the postsynaptic model var init derived parameter referenced? More...
 
template<typename T , typename G >
bool isChildParamValueHeterogeneous (size_t childIndex, size_t paramIndex, const std::vector< std::vector< T >> &sortedGroupChildren, G getParamValuesFn) const
 
template<typename T = NeuronGroupMergedBase, typename C , typename H , typename V >
void addHeterogeneousChildParams (const Snippet::Base::StringVec &paramNames, const std::vector< std::vector< C >> &sortedGroupChildren, size_t childIndex, const std::string &prefix, H isChildParamHeterogeneousFn, V getValueFn)
 
template<typename T = NeuronGroupMergedBase, typename C , typename H , typename V >
void addHeterogeneousChildDerivedParams (const Snippet::Base::DerivedParamVec &derivedParams, const std::vector< std::vector< C >> &sortedGroupChildren, size_t childIndex, const std::string &prefix, H isChildDerivedParamHeterogeneousFn, V getValueFn)
 
template<typename T = NeuronGroupMergedBase, typename C , typename H , typename V >
void addHeterogeneousChildVarInitParams (const Snippet::Base::StringVec &paramNames, const std::vector< std::vector< C >> &sortedGroupChildren, size_t childIndex, size_t varIndex, const std::string &prefix, H isChildParamHeterogeneousFn, V getVarInitialiserFn)
 
template<typename T = NeuronGroupMergedBase, typename C , typename H , typename V >
void addHeterogeneousChildVarInitDerivedParams (const Snippet::Base::DerivedParamVec &derivedParams, const std::vector< std::vector< C >> &sortedGroupChildren, size_t childIndex, size_t varIndex, const std::string &prefix, H isChildDerivedParamHeterogeneousFn, V getVarInitialiserFn)
 
template<typename S >
void addChildEGPs (const std::vector< Snippet::Base::EGP > &egps, size_t childIndex, const std::string &arrayPrefix, const std::string &prefix, S getEGPSuffixFn)
 
template<typename T = NeuronGroupMergedBase, typename C , typename V , typename R >
void updateChildParamHash (const std::vector< std::vector< C >> &sortedGroupChildren, size_t childIndex, R isChildParamReferencedFn, V getValueFn, boost::uuids::detail::sha1 &hash) const
 
template<typename T = NeuronGroupMergedBase, typename C , typename V , typename R >
void updateChildDerivedParamHash (const std::vector< std::vector< C >> &sortedGroupChildren, size_t childIndex, R isChildDerivedParamReferencedFn, V getValueFn, boost::uuids::detail::sha1 &hash) const
 
template<typename T = NeuronGroupMergedBase, typename C , typename R , typename V >
void updateChildVarInitParamsHash (const std::vector< std::vector< C >> &sortedGroupChildren, size_t childIndex, size_t varIndex, R isChildParamReferencedFn, V getVarInitialiserFn, boost::uuids::detail::sha1 &hash) const
 
template<typename T = NeuronGroupMergedBase, typename C , typename R , typename V >
void updateChildVarInitDerivedParamsHash (const std::vector< std::vector< C >> &sortedGroupChildren, size_t childIndex, size_t varIndex, R isChildDerivedParamReferencedFn, V getVarInitialiserFn, boost::uuids::detail::sha1 &hash) const
 
void addMergedInSynPointerField (const std::string &type, const std::string &name, size_t archetypeIndex, const std::string &prefix)
 
void addMergedPreOutputOutSynPointerField (const std::string &type, const std::string &name, size_t archetypeIndex, const std::string &prefix)
 
- Protected Member Functions inherited from CodeGenerator::GroupMerged< NeuronGroupInternal >
bool isParamReferenced (const std::vector< std::string > &codeStrings, const std::string &paramName) const
 Helper to test whether parameter is referenced in vector of codestrings. More...
 
bool isParamValueHeterogeneous (size_t index, P getParamValuesFn) const
 Helper to test whether parameter values are heterogeneous within merged group. More...
 
void addField (const std::string &type, const std::string &name, GetFieldValueFunc getFieldValue, FieldType fieldType=FieldType::Standard)
 
void addScalarField (const std::string &name, GetFieldValueFunc getFieldValue, FieldType fieldType=FieldType::Standard)
 
void addPointerField (const std::string &type, const std::string &name, const std::string &prefix)
 
void addVars (const Models::Base::VarVec &vars, const std::string &arrayPrefix)
 
void addVarReferences (const Models::Base::VarRefVec &varReferences, const std::string &arrayPrefix, V getVarRefFn)
 
void addEGPs (const Snippet::Base::EGPVec &egps, const std::string &arrayPrefix, const std::string &varName="")
 
void addEGPReferences (const Models::Base::EGPRefVec &egpRefs, const std::string &arrayPrefix, E getEGPRefFn)
 
void addHeterogeneousParams (const Snippet::Base::StringVec &paramNames, const std::string &suffix, P getParamValues, H isHeterogeneous)
 
void addHeterogeneousDerivedParams (const Snippet::Base::DerivedParamVec &derivedParams, const std::string &suffix, D getDerivedParamValues, H isHeterogeneous)
 
void addHeterogeneousVarInitParams (const Models::Base::VarVec &vars, V getVarInitialisers, H isHeterogeneous)
 
void addHeterogeneousVarInitDerivedParams (const Models::Base::VarVec &vars, V getVarInitialisers, H isHeterogeneous)
 
void updateHash (H getHashableFn, boost::uuids::detail::sha1 &hash) const
 Helper to update hash with the hash of calling getHashableFn on each group. More...
 
void updateParamHash (R isParamReferencedFn, V getValueFn, boost::uuids::detail::sha1 &hash) const
 
void updateVarInitParamHash (V getVarInitialisers, R isParamReferencedFn, boost::uuids::detail::sha1 &hash) const
 
void updateVarInitDerivedParamHash (V getVarInitialisers, R isDerivedParamReferencedFn, boost::uuids::detail::sha1 &hash) const
 
void generateRunnerBase (const BackendBase &backend, CodeStream &definitionsInternal, CodeStream &definitionsInternalFunc, CodeStream &definitionsInternalVar, CodeStream &runnerVarDecl, CodeStream &runnerMergedStructAlloc, const std::string &name, bool host=false) const
 

Constructor & Destructor Documentation

◆ NeuronInitGroupMerged()

NeuronInitGroupMerged::NeuronInitGroupMerged ( size_t  index,
const std::string &  precision,
const std::string &  timePrecision,
const BackendBase backend,
const std::vector< std::reference_wrapper< const NeuronGroupInternal >> &  groups 
)

Member Function Documentation

◆ generateInit()

void NeuronInitGroupMerged::generateInit ( const BackendBase backend,
CodeStream os,
const ModelSpecMerged modelMerged,
Substitutions popSubs 
) const

◆ generateRunner()

void CodeGenerator::NeuronInitGroupMerged::generateRunner ( const BackendBase backend,
CodeStream definitionsInternal,
CodeStream definitionsInternalFunc,
CodeStream definitionsInternalVar,
CodeStream runnerVarDecl,
CodeStream runnerMergedStructAlloc 
) const
inline

◆ getHashDigest()

boost::uuids::detail::sha1::digest_type NeuronInitGroupMerged::getHashDigest ( ) const

Get hash digest used for detecting changes.

◆ getSortedArchetypeInSynWithPostVars()

const std::vector<SynapseGroupInternal*>& CodeGenerator::NeuronInitGroupMerged::getSortedArchetypeInSynWithPostVars ( ) const
inline

Get sorted vectors of incoming synapse groups with postsynaptic variables belonging to archetype group.

◆ getSortedArchetypeOutSynWithPreVars()

const std::vector<SynapseGroupInternal*>& CodeGenerator::NeuronInitGroupMerged::getSortedArchetypeOutSynWithPreVars ( ) const
inline

Get sorted vectors of outgoing synapse groups with presynaptic variables belonging to archetype group.

◆ isInSynWUMVarInitDerivedParamHeterogeneous()

bool NeuronInitGroupMerged::isInSynWUMVarInitDerivedParamHeterogeneous ( size_t  childIndex,
size_t  varIndex,
size_t  paramIndex 
) const

Should the incoming synapse weight update model var init derived parameter be implemented heterogeneously?

◆ isInSynWUMVarInitParamHeterogeneous()

bool NeuronInitGroupMerged::isInSynWUMVarInitParamHeterogeneous ( size_t  childIndex,
size_t  varIndex,
size_t  paramIndex 
) const

Should the incoming synapse weight update model var init parameter be implemented heterogeneously?

◆ isOutSynWUMVarInitDerivedParamHeterogeneous()

bool NeuronInitGroupMerged::isOutSynWUMVarInitDerivedParamHeterogeneous ( size_t  childIndex,
size_t  varIndex,
size_t  paramIndex 
) const

Should the outgoing synapse weight update model var init derived parameter be implemented heterogeneously?

◆ isOutSynWUMVarInitParamHeterogeneous()

bool NeuronInitGroupMerged::isOutSynWUMVarInitParamHeterogeneous ( size_t  childIndex,
size_t  varIndex,
size_t  paramIndex 
) const

Should the outgoing synapse weight update model var init parameter be implemented heterogeneously?

Member Data Documentation

◆ name

const std::string NeuronInitGroupMerged::name = "NeuronInit"
static

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