GeNN  2.2.3
GPU enhanced Neuronal Networks (GeNN)
MBody_userdef_project/model/map_classol.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------
2  Author: Thomas Nowotny
3 
4  Institute: Institute for Nonlinear Dynamics
5  University of California San Diego
6  La Jolla, CA 92093-0402
7 
8  email to: tnowotny@ucsd.edu
9 
10  initial version: 2002-09-26
11 
12 --------------------------------------------------------------------------*/
13 
14 
15 #ifndef CLASSOL_H
16 #define CLASSOL_H
17 
18 #include <stdint.h>
19 
20 //--------------------------------------------------------------------------
29 //--------------------------------------------------------------------------
30 
31 
32 //--------------------------------------------------------------------------
35 //--------------------------------------------------------------------------
36 
37 class classol
38 {
39  private:
40  void importArray(scalar *, double *, int);
41  void exportArray(double *, scalar *, int);
42  public:
43  NNmodel model;
44  scalar *p_pattern;
45  uint64_t *pattern;
46  uint64_t *baserates;
47  //------------------------------------------------------------------------
48  // on the device:
49  uint64_t *d_pattern;
50  uint64_t *d_baserates;
51  //------------------------------------------------------------------------
52  unsigned int sumPN, sumKC, sumLHI, sumDN;
53  unsigned int size_g; //number of connections
54  // end of data fields
55 
56  classol();
57  ~classol();
58  void init(unsigned int);
59 #ifndef CPU_ONLY
61  void free_device_mem();
62 #endif
63  void read_pnkcsyns(FILE *);
64  template <class DATATYPE>
65  void read_sparsesyns_par(DATATYPE *, int, struct SparseProjection, FILE *,FILE *,FILE *);
66  void write_pnkcsyns(FILE *);
67  void read_pnlhisyns(FILE *);
68  void write_pnlhisyns(FILE *);
69  void read_kcdnsyns(FILE *);
70  void write_kcdnsyns(FILE *);
71  void read_input_patterns(FILE *);
72  void generate_baserates();
73 #ifndef CPU_ONLY
74  void runGPU(scalar);
75 #endif
76  void runCPU(scalar);
77  void output_state(FILE *, unsigned int);
78  void getSpikesFromGPU();
79  void getSpikeNumbersFromGPU();
80  void output_spikes(FILE *, unsigned int);
81  void sum_spikes();
82 #ifndef CPU_ONLY
83  void get_kcdnsyns();
84 #endif
85 };
86 
87 #endif
void output_state(FILE *, unsigned int)
Method for copying from device and writing out to file of the entire state of the model...
Definition: MBody1_project/model/map_classol.cc:392
void write_pnkcsyns(FILE *)
Method for writing the conenctivity between PNs and KCs back into file.
Definition: MBody1_project/model/map_classol.cc:162
unsigned int size_g
Definition: MBody1_project/model/map_classol.h:55
void write_kcdnsyns(FILE *)
Method to write the connectivity between KCs and DNs (detector neurons) to a file.
Definition: MBody1_project/model/map_classol.cc:250
void free_device_mem()
Methods for unallocating the memory for input patterns on the GPU device.
Definition: MBody1_project/model/map_classol.cc:90
Definition: modelSpec.h:85
unsigned int sumKC
Definition: MBody1_project/model/map_classol.h:54
void generate_baserates()
Method for calculating the baseline rates of the Poisson input neurons.
Definition: MBody1_project/model/map_classol.cc:319
NNmodel model
Definition: MBody1_project/model/map_classol.h:43
unsigned int sumDN
Definition: MBody1_project/model/map_classol.h:54
void runGPU(scalar)
Method for simulating the model for a given period of time on the GPU.
Definition: MBody1_project/model/map_classol.cc:338
void init(unsigned int)
Method for initialising variables.
Definition: MBody1_project/model/map_classol.cc:50
void output_spikes(FILE *, unsigned int)
Method for writing the spikes occurred in the last time step to a file.
Definition: MBody1_project/model/map_classol.cc:499
void get_kcdnsyns()
Method for copying the synaptic conductances of the learning synapses between KCs and DNs (detector n...
Definition: MBody1_project/model/map_classol.cc:538
void allocate_device_mem_patterns()
Method for allocating memory on the GPU device to hold the input patterns.
Definition: MBody1_project/model/map_classol.cc:71
unsigned int sumLHI
Definition: MBody1_project/model/map_classol.h:54
uint64_t * d_baserates
Definition: MBody1_project/model/map_classol.h:52
void sum_spikes()
Method for summing up spike numbers.
Definition: MBody1_project/model/map_classol.cc:524
unsigned int sumPN
Definition: MBody1_project/model/map_classol.h:54
classol()
Definition: MBody1_project/model/map_classol.cc:30
void read_pnkcsyns(FILE *)
Method for reading the connectivity between PNs and KCs from a file.
Definition: MBody1_project/model/map_classol.cc:127
void read_kcdnsyns(FILE *)
Method for reading the connectivity between KCs and DNs (detector neurons) from a file...
Definition: MBody1_project/model/map_classol.cc:217
void read_input_patterns(FILE *)
Method for reading the input patterns from a file.
Definition: MBody1_project/model/map_classol.cc:296
void getSpikeNumbersFromGPU()
Method for copying the number of spikes in all neuron populations that have occurred during the last ...
Definition: MBody1_project/model/map_classol.cc:488
~classol()
Destructor for olfaction model.
Definition: MBody1_project/model/map_classol.cc:101
scalar * p_pattern
Definition: MBody1_project/model/map_classol.h:46
void write_pnlhisyns(FILE *)
Method for writing the connectivity between PNs and LHIs to a file.
Definition: MBody1_project/model/map_classol.cc:200
void read_pnlhisyns(FILE *)
Method for reading the connectivity between PNs and LHIs from a file.
Definition: MBody1_project/model/map_classol.cc:179
void getSpikesFromGPU()
Method for copying all spikes of the last time step from the GPU.
Definition: MBody1_project/model/map_classol.cc:476
class (struct) for defining a spars connectivity projection
Definition: sparseProjection.h:18
#define scalar
Definition: HHVClampParameters.h:4
uint64_t * d_pattern
Definition: MBody1_project/model/map_classol.h:51
void read_sparsesyns_par(int, struct SparseProjection, scalar *, FILE *, FILE *, FILE *)
Read sparse connectivity from a file.
Definition: MBody1_project/model/map_classol.cc:261
uint64_t * pattern
Definition: MBody1_project/model/map_classol.h:47
void runCPU(scalar)
Method for simulating the model for a given period of time on the CPU.
Definition: MBody1_project/model/map_classol.cc:364
uint64_t * baserates
Definition: MBody1_project/model/map_classol.h:48
This class cpontains the methods for running the MBody1 example model.
Definition: MBody1_project/model/map_classol.h:37