GeNN  2.2.3
GPU enhanced Neuronal Networks (GeNN)
simulation_test_vars.h
Go to the documentation of this file.
1 #pragma once
2 
3 // Test includes
4 #include "simulation_test.h"
5 
6 #define ASSIGN_ARRAY_VARS(ARRAY_NAME, VAR_PREFIX, COUNT) \
7  for(int i_##__LINE__ = 0; i_##__LINE__ < COUNT; i++) \
8  { \
9  ARRAY_NAME[i_##__LINE__] = VAR_PREFIX##i_##__LINE__; \
10  }
11 //----------------------------------------------------------------------------
12 // SimulationTestVars
13 //----------------------------------------------------------------------------
14 template<typename NeuronPolicy, typename SynapsePolicy>
16 {
17 protected:
18  //--------------------------------------------------------------------------
19  // SimulationTest virtuals
20  //--------------------------------------------------------------------------
21  virtual void Init()
22  {
23  m_NeuronPolicy.Init();
24  m_SynapsePolicy.Init();
25  }
26 
27  // -------------------------------------------------------------------------
28  // Public API
29  // -------------------------------------------------------------------------
30  template<typename UpdateFn>
31  float Simulate(UpdateFn update)
32  {
33  return m_SynapsePolicy.Simulate(update,
34  [this](){ StepGeNN(); });
35  }
36 
37 private:
38  // -------------------------------------------------------------------------
39  // Members
40  // -------------------------------------------------------------------------
41  NeuronPolicy m_NeuronPolicy;
42  SynapsePolicy m_SynapsePolicy;
43 };
virtual void Init()
Definition: simulation_test_vars.h:21
Definition: simulation_test.h:9
Definition: simulation_test_vars.h:15
float Simulate(UpdateFn update)
Definition: simulation_test_vars.h:31
void StepGeNN()
Definition: simulation_test.h:44