GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
synapseUpdateGroupMerged.h
Go to the documentation of this file.
1 #pragma once
2 
3 // GeNN code generator includes
5 
6 //----------------------------------------------------------------------------
7 // CodeGenerator::
8 //----------------------------------------------------------------------------
9 namespace CodeGenerator
10 {
11 
12 //----------------------------------------------------------------------------
13 // CodeGenerator::PresynapticUpdateGroupMerged
14 //----------------------------------------------------------------------------
16 {
17 public:
18  PresynapticUpdateGroupMerged(size_t index, const std::string &precision, const std::string &timePrecision, const BackendBase &backend,
19  const std::vector<std::reference_wrapper<const SynapseGroupInternal>> &groups)
20  : SynapseGroupMergedBase(index, precision, timePrecision, backend, SynapseGroupMergedBase::Role::PresynapticUpdate,
21  groups.front().get().getWUModel()->getSimCode() + groups.front().get().getWUModel()->getEventCode() + groups.front().get().getWUModel()->getEventThresholdConditionCode(), groups)
22  {}
23 
24  boost::uuids::detail::sha1::digest_type getHashDigest() const
25  {
27  }
28 
29  void generateRunner(const BackendBase &backend, CodeStream &definitionsInternal,
30  CodeStream &definitionsInternalFunc, CodeStream &definitionsInternalVar,
31  CodeStream &runnerVarDecl, CodeStream &runnerMergedStructAlloc) const
32  {
33  generateRunnerBase(backend, definitionsInternal, definitionsInternalFunc, definitionsInternalVar,
34  runnerVarDecl, runnerMergedStructAlloc, name);
35  }
36 
37  void generateSpikeEventThreshold(const BackendBase &backend, CodeStream &os, const ModelSpecMerged &modelMerged, Substitutions &popSubs) const;
38  void generateSpikeEventUpdate(const BackendBase &backend, CodeStream &os, const ModelSpecMerged &modelMerged, Substitutions &popSubs) const;
39  void generateSpikeUpdate(const BackendBase &backend, CodeStream &os, const ModelSpecMerged &modelMerged, Substitutions &popSubs) const;
40  void generateProceduralConnectivity(const BackendBase &backend, CodeStream &os, const ModelSpecMerged &modelMerged, Substitutions &popSubs) const;
41  void generateToeplitzConnectivity(const BackendBase &backend, CodeStream &os, const ModelSpecMerged &modelMerged, Substitutions &popSubs) const;
42 
43  //----------------------------------------------------------------------------
44  // Static constants
45  //----------------------------------------------------------------------------
46  static const std::string name;
47 };
48 
49 //----------------------------------------------------------------------------
50 // CodeGenerator::PostsynapticUpdateGroupMerged
51 //----------------------------------------------------------------------------
53 {
54 public:
55  PostsynapticUpdateGroupMerged(size_t index, const std::string &precision, const std::string &timePrecision, const BackendBase &backend,
56  const std::vector<std::reference_wrapper<const SynapseGroupInternal>> &groups)
57  : SynapseGroupMergedBase(index, precision, timePrecision, backend, SynapseGroupMergedBase::Role::PostsynapticUpdate,
58  groups.front().get().getWUModel()->getLearnPostCode(), groups)
59  {}
60 
61  boost::uuids::detail::sha1::digest_type getHashDigest() const
62  {
64  }
65 
66  void generateRunner(const BackendBase &backend, CodeStream &definitionsInternal,
67  CodeStream &definitionsInternalFunc, CodeStream &definitionsInternalVar,
68  CodeStream &runnerVarDecl, CodeStream &runnerMergedStructAlloc) const
69  {
70  generateRunnerBase(backend, definitionsInternal, definitionsInternalFunc, definitionsInternalVar,
71  runnerVarDecl, runnerMergedStructAlloc, name);
72  }
73 
74  void generateSynapseUpdate(const BackendBase &backend, CodeStream &os, const ModelSpecMerged &modelMerged, Substitutions &popSubs) const;
75 
76  //----------------------------------------------------------------------------
77  // Static constants
78  //----------------------------------------------------------------------------
79  static const std::string name;
80 };
81 
82 //----------------------------------------------------------------------------
83 // CodeGenerator::SynapseDynamicsGroupMerged
84 //----------------------------------------------------------------------------
86 {
87 public:
88  SynapseDynamicsGroupMerged(size_t index, const std::string &precision, const std::string &timePrecision, const BackendBase &backend,
89  const std::vector<std::reference_wrapper<const SynapseGroupInternal>> &groups)
90  : SynapseGroupMergedBase(index, precision, timePrecision, backend, SynapseGroupMergedBase::Role::SynapseDynamics,
91  groups.front().get().getWUModel()->getSynapseDynamicsCode(), groups)
92  {}
93 
94  boost::uuids::detail::sha1::digest_type getHashDigest() const
95  {
97  }
98 
99  void generateRunner(const BackendBase &backend, CodeStream &definitionsInternal,
100  CodeStream &definitionsInternalFunc, CodeStream &definitionsInternalVar,
101  CodeStream &runnerVarDecl, CodeStream &runnerMergedStructAlloc) const
102  {
103  generateRunnerBase(backend, definitionsInternal, definitionsInternalFunc, definitionsInternalVar,
104  runnerVarDecl, runnerMergedStructAlloc, name);
105  }
106 
107  void generateSynapseUpdate(const BackendBase &backend, CodeStream &os, const ModelSpecMerged &modelMerged, Substitutions &popSubs) const;
108 
109  //----------------------------------------------------------------------------
110  // Static constants
111  //----------------------------------------------------------------------------
112  static const std::string name;
113 };
114 }
GENN_EXPORT void generateSynapseUpdate(const filesystem::path &outputPath, const ModelSpecMerged &modelMerged, const BackendBase &backend, const std::string &suffix="")
Definition: generateModules.cc:236
static const std::string name
Definition: synapseUpdateGroupMerged.h:79
boost::uuids::detail::sha1::digest_type getHashDigest(Role role) const
Definition: groupMerged.cc:1188
Definition: groupMerged.h:1021
#define GENN_EXPORT
Definition: gennExport.h:13
Definition: synapseUpdateGroupMerged.h:85
Definition: modelSpecMerged.h:31
Helper class for generating code - automatically inserts brackets, indents etc.
Definition: backendBase.h:30
static const std::string name
Definition: synapseUpdateGroupMerged.h:46
Definition: codeStream.h:21
Definition: substitutions.h:21
Definition: synapseUpdateGroupMerged.h:52
Definition: backendBase.h:176
boost::uuids::detail::sha1::digest_type getHashDigest() const
Definition: synapseUpdateGroupMerged.h:94
PostsynapticUpdateGroupMerged(size_t index, const std::string &precision, const std::string &timePrecision, const BackendBase &backend, const std::vector< std::reference_wrapper< const SynapseGroupInternal >> &groups)
Definition: synapseUpdateGroupMerged.h:55
void generateRunner(const BackendBase &backend, CodeStream &definitionsInternal, CodeStream &definitionsInternalFunc, CodeStream &definitionsInternalVar, CodeStream &runnerVarDecl, CodeStream &runnerMergedStructAlloc) const
Definition: synapseUpdateGroupMerged.h:99
Role
Definition: groupMerged.h:1132
SynapseDynamicsGroupMerged(size_t index, const std::string &precision, const std::string &timePrecision, const BackendBase &backend, const std::vector< std::reference_wrapper< const SynapseGroupInternal >> &groups)
Definition: synapseUpdateGroupMerged.h:88
void generateRunner(const BackendBase &backend, CodeStream &definitionsInternal, CodeStream &definitionsInternalFunc, CodeStream &definitionsInternalVar, CodeStream &runnerVarDecl, CodeStream &runnerMergedStructAlloc) const
Definition: synapseUpdateGroupMerged.h:29
static const std::string name
Definition: synapseUpdateGroupMerged.h:112
boost::uuids::detail::sha1::digest_type getHashDigest() const
Definition: synapseUpdateGroupMerged.h:61
PresynapticUpdateGroupMerged(size_t index, const std::string &precision, const std::string &timePrecision, const BackendBase &backend, const std::vector< std::reference_wrapper< const SynapseGroupInternal >> &groups)
Definition: synapseUpdateGroupMerged.h:18
boost::uuids::detail::sha1::digest_type getHashDigest() const
Definition: synapseUpdateGroupMerged.h:24
Definition: synapseUpdateGroupMerged.h:15
void generateRunner(const BackendBase &backend, CodeStream &definitionsInternal, CodeStream &definitionsInternalFunc, CodeStream &definitionsInternalVar, CodeStream &runnerVarDecl, CodeStream &runnerMergedStructAlloc) const
Definition: synapseUpdateGroupMerged.h:66