PetaVision  Alpha
MomentumLCALayer.hpp
1 /*
2  * MomentumLCALayer.hpp
3  *
4  * Created on: Mar 15, 2016
5  * Author: slundquist
6  */
7 
8 #ifndef MOMENTUMLCALAYER_HPP_
9 #define MOMENTUMLCALAYER_HPP_
10 
11 #include "HyPerLCALayer.hpp"
12 
13 namespace PV {
14 
16  public:
17  MomentumLCALayer(const char *name, HyPerCol *hc);
18  virtual ~MomentumLCALayer();
19 
20  protected:
22  int initialize(const char *name, HyPerCol *hc);
23  virtual Response::Status allocateDataStructures() override;
24  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
25 
32  virtual void ioParam_LCAMomentumRate(enum ParamsIOFlag ioFlag);
33 
36  virtual Response::Status registerData(Checkpointer *checkpointer) override;
37  virtual Response::Status processCheckpointRead() override;
38  virtual Response::Status prepareCheckpointWrite() override;
39 
40  virtual Response::Status updateState(double time, double dt) override;
41 
42 #ifdef PV_USE_CUDA
43  virtual Response::Status updateStateGpu(double time, double dt) override;
44  virtual int allocateUpdateKernel() override;
45 #endif
46 
47  float LCAMomentumRate;
48  float *prevDrive;
49 #ifdef PV_USE_CUDA
50  PVCuda::CudaBuffer *d_prevDrive;
51 #endif
52 
53  private:
54  int initialize_base();
55 }; // class MomentumLCALayer
56 
57 } /* namespace PV */
58 #endif /* MOMENTUMLCALAYER_HPP_ */
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override