PetaVision  Alpha
PostsynapticPerspectiveGPUDelivery.hpp
1 /*
2  * PostsynapticPerspectiveGPUDelivery.hpp
3  *
4  * Created on: Aug 24, 2017
5  * Author: Pete Schultz
6  */
7 
8 #ifndef POSTSYNAPTICPERSPECTIVEGPUDELIVERY_HPP_
9 #define POSTSYNAPTICPERSPECTIVEGPUDELIVERY_HPP_
10 
11 #include "HyPerDelivery.hpp"
12 #include "arch/cuda/CudaBuffer.hpp"
13 #include "cudakernels/CudaRecvPost.hpp"
14 
15 namespace PV {
16 
22  protected:
34  virtual void ioParam_receiveGpu(enum ParamsIOFlag ioFlag) override; // End of list of BaseDelivery parameters.
36 
37  public:
38  PostsynapticPerspectiveGPUDelivery(char const *name, HyPerCol *hc);
39 
41 
53  virtual void deliver() override;
54 
55  virtual void deliverUnitInput(float *recvBuffer) override;
56 
57  protected:
59 
60  int initialize(char const *name, HyPerCol *hc);
61 
62  virtual void setObjectType() override;
63 
64  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
65 
66  virtual Response::Status
67  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
68 
69  virtual Response::Status
70  setCudaDevice(std::shared_ptr<SetCudaDeviceMessage const> message) override;
71 
72  virtual Response::Status allocateDataStructures() override;
73 
74  void initializeRecvKernelArgs();
75 
76  // Data members
77  protected:
78  PVCuda::CudaRecvPost *mRecvKernel = nullptr;
79  PVCuda::CudaBuffer *mDevicePostToPreActivity = nullptr;
80 }; // end class PostsynapticPerspectiveGPUDelivery
81 
82 } // end namespace PV
83 
84 #endif // POSTSYNAPTICPERSPECTIVEGPUDELIVERY_HPP_
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual void ioParam_receiveGpu(enum ParamsIOFlag ioFlag) override
receiveGpu: PostsynapticPerspectiveGPUDelivery always sets receiveGpu to true. The receiveGpu=false c...