1 #include "CudaUpdateStateFunctions.hpp" 5 CudaUpdateHyPerLCALayer::CudaUpdateHyPerLCALayer(CudaDevice *inDevice) : CudaKernel(inDevice) {
6 kernelName =
"HyPerLCALayer";
9 CudaUpdateHyPerLCALayer::~CudaUpdateHyPerLCALayer() {}
11 CudaUpdateMomentumLCALayer::CudaUpdateMomentumLCALayer(CudaDevice *inDevice)
12 : CudaKernel(inDevice) {
13 kernelName =
"MomentumLCALayer";
16 CudaUpdateMomentumLCALayer::~CudaUpdateMomentumLCALayer() {}
18 CudaUpdateISTALayer::CudaUpdateISTALayer(CudaDevice *inDevice) : CudaKernel(inDevice) {
19 kernelName =
"ISTALayer";
22 CudaUpdateISTALayer::~CudaUpdateISTALayer() {}
24 void CudaUpdateHyPerLCALayer::setArgs(
34 const int numChannels,
38 const int numVertices,
39 CudaBuffer *verticesV,
40 CudaBuffer *verticesA,
42 const bool selfInteract,
47 CudaBuffer *activity) {
48 params.nbatch = nbatch;
49 params.numNeurons = numNeurons;
57 params.numChannels = numChannels;
59 params.V = (
float *)V->getPointer();
61 params.numVertices = numVertices;
62 params.verticesV = (
float *)verticesV->getPointer();
63 params.verticesA = (
float *)verticesA->getPointer();
64 params.slopes = (
float *)slopes->getPointer();
65 params.selfInteract = selfInteract;
66 params.dtAdapt = (
double *)dtAdapt->getPointer();
69 params.GSynHead = (
float *)GSynHead->getPointer();
70 params.activity = (
float *)activity->getPointer();
75 void CudaUpdateMomentumLCALayer::setArgs(
85 const int numChannels,
88 CudaBuffer *prevDrive,
90 const int numVertices,
91 CudaBuffer *verticesV,
92 CudaBuffer *verticesA,
94 const bool selfInteract,
97 const float LCAMomentumRate,
100 CudaBuffer *activity) {
101 params.nbatch = nbatch;
102 params.numNeurons = numNeurons;
110 params.numChannels = numChannels;
112 params.V = (
float *)V->getPointer();
113 params.prevDrive = (
float *)prevDrive->getPointer();
115 params.numVertices = numVertices;
116 params.verticesV = (
float *)verticesV->getPointer();
117 params.verticesA = (
float *)verticesA->getPointer();
118 params.slopes = (
float *)slopes->getPointer();
119 params.selfInteract = selfInteract;
120 params.dtAdapt = (
double *)dtAdapt->getPointer();
122 params.LCAMomentumRate = LCAMomentumRate;
124 params.GSynHead = (
float *)GSynHead->getPointer();
125 params.activity = (
float *)activity->getPointer();
130 void CudaUpdateISTALayer::setArgs(
132 const int numNeurons,
140 const int numChannels,
148 CudaBuffer *GSynHead,
149 CudaBuffer *activity) {
150 params.nbatch = nbatch;
151 params.numNeurons = numNeurons;
159 params.numChannels = numChannels;
161 params.V = (
float *)V->getPointer();
164 params.dtAdapt = (
double *)dtAdapt->getPointer();
167 params.GSynHead = (
float *)GSynHead->getPointer();
168 params.activity = (
float *)activity->getPointer();