PetaVision  Alpha
HyPerLayer.hpp
1 
11 #ifndef HYPERLAYER_HPP_
12 #define HYPERLAYER_HPP_
13 
14 #include "checkpointing/CheckpointableFileStream.hpp"
15 #include "columns/Communicator.hpp"
16 #include "columns/DataStore.hpp"
17 #include "columns/HyPerCol.hpp"
18 #include "columns/Publisher.hpp"
19 #include "columns/Random.hpp"
20 #include "include/pv_common.h"
21 #include "include/pv_types.h"
22 #include "initv/BaseInitV.hpp"
23 #include "io/fileio.hpp"
24 #include "layers/BaseLayer.hpp"
25 #include "layers/PVLayerCube.hpp"
26 #include "probes/LayerProbe.hpp"
27 #include "utils/Timer.hpp"
28 
29 #ifdef PV_USE_CUDA
30 #undef PV_USE_CUDA
31 #include <layers/updateStateFunctions.h>
32 #define PV_USE_CUDA
33 #else
34 #include <layers/updateStateFunctions.h>
35 #endif // PV_USE_CUDA
36 
37 #ifdef PV_USE_OPENMP_THREADS
38 #include <omp.h>
39 #endif // PV_USE_OPENMP_THREADS
40 
41 #ifdef PV_USE_CUDA
42 #include <arch/cuda/CudaBuffer.hpp>
43 #include <arch/cuda/CudaKernel.hpp>
44 #include <arch/cuda/CudaTimer.hpp>
45 #endif // PV_USE_CUDA
46 
47 #include <vector>
48 
49 // default constants
50 #define HYPERLAYER_FEEDBACK_DELAY 1
51 #define HYPERLAYER_FEEDFORWARD_DELAY 0
52 
53 namespace PV {
54 
55 class PVParams;
56 class BaseConnection;
57 
58 typedef enum TriggerBehaviorTypeEnum {
59  NO_TRIGGER,
60  UPDATEONLY_TRIGGER,
61  RESETSTATE_TRIGGER
62 } TriggerBehaviorType;
63 
64 class HyPerLayer : public BaseLayer {
65 
66  protected:
73  virtual void ioParam_dataType(enum ParamsIOFlag ioFlag);
74 
80  virtual void ioParam_updateGpu(enum ParamsIOFlag ioFlag);
81 
86  virtual void ioParam_nxScale(enum ParamsIOFlag ioFlag);
91  virtual void ioParam_nyScale(enum ParamsIOFlag ioFlag);
95  virtual void ioParam_nf(enum ParamsIOFlag ioFlag);
96 
100  virtual void ioParam_phase(enum ParamsIOFlag ioFlag);
101 
105  virtual void ioParam_mirrorBCflag(enum ParamsIOFlag ioFlag);
106 
110  virtual void ioParam_valueBC(enum ParamsIOFlag ioFlag);
111 
117  virtual void ioParam_initializeFromCheckpointFlag(enum ParamsIOFlag ioFlag);
118 
132  virtual void ioParam_InitVType(enum ParamsIOFlag ioFlag);
133 
141  virtual void ioParam_triggerFlag(enum ParamsIOFlag ioFlag);
142 
148  virtual void ioParam_triggerLayerName(enum ParamsIOFlag ioFlag);
149 
150  // TODO: triggerOffset is measured in units of simulation time, not timesteps. How does
151  // adaptTimeStep affect
152  // the triggering time?
158  virtual void ioParam_triggerOffset(enum ParamsIOFlag ioFlag);
159 
171  virtual void ioParam_triggerBehavior(enum ParamsIOFlag ioFlag);
172 
178  virtual void ioParam_triggerResetLayerName(enum ParamsIOFlag ioFlag);
179 
184  virtual void ioParam_writeStep(enum ParamsIOFlag ioFlag);
185 
189  virtual void ioParam_initialWriteTime(enum ParamsIOFlag ioFlag);
190 
195  virtual void ioParam_sparseLayer(enum ParamsIOFlag ioFlag);
196 
200  virtual void ioParam_writeSparseValues(enum ParamsIOFlag ioFlag); // obsolete March 14, 2017.
203  private:
204  int initialize_base();
205 
206  protected:
207  // only subclasses can be constructed directly
208  HyPerLayer();
209  int initialize(const char *name, HyPerCol *hc);
210  virtual int initClayer();
211 
212  virtual int allocateClayerBuffers();
213  int setLayerLoc(PVLayerLoc *layerLoc, float nxScale, float nyScale, int nf, int numBatches);
214  virtual void allocateBuffers();
215  virtual void allocateGSyn();
216  void addPublisher();
217 
218  /*
219  * Allocates a buffer of the given length. The membrane potential and activity buffer, among
220  * others, are created using allocateBuffer.
221  * To free a buffer created with this method, call freeBuffer().
222  */
223  template <typename T>
224  void allocateBuffer(T **buf, int bufsize, const char *bufname);
225 
229  void allocateRestrictedBuffer(float **buf, const char *bufname);
230 
234  void allocateExtendedBuffer(float **buf, const char *bufname);
235 
236  virtual void allocateV();
237  virtual void allocateActivity();
238  virtual void allocatePrevActivity();
239 
240  void checkpointPvpActivityFloat(
241  Checkpointer *checkpointer,
242  char const *bufferName,
243  float *pvpBuffer,
244  bool extended);
245 
246  void checkpointRandState(
247  Checkpointer *checkpointer,
248  char const *bufferName,
249  Random *randState,
250  bool extendedFlag);
251 
252  virtual void initializeV();
253  virtual void initializeActivity();
254  virtual Response::Status readStateFromCheckpoint(Checkpointer *checkpointer) override;
255  virtual void readActivityFromCheckpoint(Checkpointer *checkpointer);
256  virtual void readVFromCheckpoint(Checkpointer *checkpointer);
257  virtual void readDelaysFromCheckpoint(Checkpointer *checkpointer);
258 #ifdef PV_USE_CUDA
259  virtual Response::Status copyInitialStateToGPU() override;
260 #endif // PV_USE_CUDA
261 
262  // readBufferFile and readDataStoreFromFile were removed Jan 23, 2017.
263  // They were only used by checkpointing, which is now handled by the
264  // CheckpointEntry class hierarchy.
265 
266  void updateNBands(int numCalls);
267 
268  virtual Response::Status processCheckpointRead() override;
269 
270  void calcNumExtended();
271 
275  virtual bool needReset(double timed, double dt);
276 
282  virtual void resetStateOnTrigger();
283 
284  /*
285  * Frees a buffer created by allocateBuffer(). Note that the address to the buffer
286  * is passed as the argument; on return, the address contains NULL.
287  * Note that there is no checking whether the buffer was created by allocateBuffer(),
288  * or any other allocateBuffer()-related method.
289  */
290  template <typename T>
291  int freeBuffer(T **buf);
292 
298  int freeRestrictedBuffer(float **buf);
299 
305  int freeExtendedBuffer(float **buf);
306 
312  bool isAllInputReady();
313 
314  public:
315  HyPerLayer(const char *name, HyPerCol *hc);
316  float *getActivity() {
317  return clayer->activity->data;
318  } // TODO: access to clayer->activity->data should not be public
319  virtual double getTimeScale(int batchIdx) { return -1.0; };
320  virtual bool activityIsSpiking() { return false; }
321  PVDataType getDataType() { return dataType; }
322  virtual Response::Status respond(std::shared_ptr<BaseMessage const> message) override;
323 
324  protected:
328  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
329 
330  static int equalizeMargins(HyPerLayer *layer1, HyPerLayer *layer2);
331 
332  int freeClayer();
333 
334  public:
335  virtual ~HyPerLayer();
336 
337  void synchronizeMarginWidth(HyPerLayer *layer);
338 
339  // TODO - make protected
340  PVLayer *clayer;
341 
342  // ************************************************************************************//
343  // interface for public methods for controlling HyPerLayer cellular and synaptic dynamics
344  // (i.e. methods for receiving synaptic input, updating internal state, publishing output)
345  // ************************************************************************************//
346  virtual int recvAllSynapticInput(); // Calls recvSynapticInput for each conn and each arborID
347 
348  // An updateState wrapper that determines if updateState needs to be called
349  Response::Status callUpdateState(double simTime, double dt);
362  virtual bool needUpdate(double simTime, double dt);
363 
367  virtual double getDeltaUpdateTime();
368 
374  virtual double getDeltaTriggerTime();
375 
376  Response::Status respondLayerSetMaxPhase(std::shared_ptr<LayerSetMaxPhaseMessage const> message);
377  Response::Status respondLayerWriteParams(std::shared_ptr<LayerWriteParamsMessage const> message);
378  Response::Status
379  respondLayerProbeWriteParams(std::shared_ptr<LayerProbeWriteParamsMessage const> message);
380  Response::Status
381  respondLayerClearProgressFlags(std::shared_ptr<LayerClearProgressFlagsMessage const> message);
382  Response::Status
383  respondLayerRecvSynapticInput(std::shared_ptr<LayerRecvSynapticInputMessage const> message);
384  Response::Status respondLayerUpdateState(std::shared_ptr<LayerUpdateStateMessage const> message);
385 #ifdef PV_USE_CUDA
386  Response::Status respondLayerCopyFromGpu(std::shared_ptr<LayerCopyFromGpuMessage const> message);
387 #endif // PV_USE_CUDA
388  Response::Status
389  respondLayerAdvanceDataStore(std::shared_ptr<LayerAdvanceDataStoreMessage const> message);
390  Response::Status respondLayerPublish(std::shared_ptr<LayerPublishMessage const> message);
391  Response::Status
392  respondLayerCheckNotANumber(std::shared_ptr<LayerCheckNotANumberMessage const> message);
393  // respondLayerUpdateActiveIndices removed Feb 3, 2017. Layers update active indices
394  // in response to other messages, when needed.
395  Response::Status respondLayerOutputState(std::shared_ptr<LayerOutputStateMessage const> message);
396  virtual int publish(Communicator *comm, double simTime);
397  virtual int resetGSynBuffers(double timef, double dt);
398  // ************************************************************************************//
399 
400  // mpi public wait method to ensure all targets have received synaptic input before proceeding to
401  // next time step
402  virtual int waitOnPublish(Communicator *comm);
403 
404  virtual void updateAllActiveIndices();
405  void updateActiveIndices();
406  int resetBuffer(float *buf, int numItems);
407 
408  static bool localDimensionsEqual(PVLayerLoc const *loc1, PVLayerLoc const *loc2);
409  int mirrorInteriorToBorder(PVLayerCube *cube, PVLayerCube *borderCube);
410 
411  virtual Response::Status outputState(double timef);
412  virtual int writeActivity(double timed);
413  virtual int writeActivitySparse(double timed);
414 
415  virtual int insertProbe(LayerProbe *probe);
416  Response::Status outputProbeParams();
417 
422  bool isExchangeFinished(int delay = 0);
423 
424  void clearProgressFlags();
425 
426  int getNumProbes() { return numProbes; }
427  LayerProbe *getProbe(int n) { return (n >= 0 && n < numProbes) ? probes[n] : NULL; }
428 
429  // TODO: should the mirroring functions be static? Why are they virtual?
430  virtual int mirrorToNorthWest(PVLayerCube *dest, PVLayerCube *src);
431  virtual int mirrorToNorth(PVLayerCube *dest, PVLayerCube *src);
432  virtual int mirrorToNorthEast(PVLayerCube *dest, PVLayerCube *src);
433  virtual int mirrorToWest(PVLayerCube *dest, PVLayerCube *src);
434  virtual int mirrorToEast(PVLayerCube *dest, PVLayerCube *src);
435  virtual int mirrorToSouthWest(PVLayerCube *dest, PVLayerCube *src);
436  virtual int mirrorToSouth(PVLayerCube *dest, PVLayerCube *src);
437  virtual int mirrorToSouthEast(PVLayerCube *dest, PVLayerCube *src);
438 
444  void addRecvConn(BaseConnection *conn);
445 
446  // Public access functions:
447 
448  int getNumNeurons() { return clayer->numNeurons; }
449  int getNumExtended() { return clayer->numExtended; }
450  int getNumNeuronsAllBatches() { return clayer->numNeuronsAllBatches; }
451  int getNumExtendedAllBatches() { return clayer->numExtendedAllBatches; }
452 
453  int getNumGlobalNeurons() {
454  const PVLayerLoc *loc = getLayerLoc();
455  return loc->nxGlobal * loc->nyGlobal * loc->nf;
456  }
457  int getNumGlobalExtended() {
458  const PVLayerLoc *loc = getLayerLoc();
459  return (loc->nxGlobal + loc->halo.lt + loc->halo.rt)
460  * (loc->nyGlobal + loc->halo.dn + loc->halo.up) * loc->nf;
461  }
462  int getNumDelayLevels() { return numDelayLevels; }
463 
464  int increaseDelayLevels(int neededDelay);
465  virtual int requireMarginWidth(int marginWidthNeeded, int *marginWidthResult, char axis);
466  virtual int requireChannel(int channelNeeded, int *numChannelsResult);
467 
468  PVLayer *getCLayer() { return clayer; }
469  float *getV() { return clayer->V; } // name query
470  int getNumChannels() { return numChannels; }
471  float *getChannel(ChannelType ch) { // name query
472  return (ch < this->numChannels && ch >= 0) ? GSyn[ch] : NULL;
473  }
474  virtual float getChannelTimeConst(enum ChannelType channel_type) { return 0.0f; }
475  int getXScale() { return clayer->xScale; }
476  int getYScale() { return clayer->yScale; }
477 
478  bool useMirrorBCs() { return this->mirrorBCflag; }
479  float getValueBC() { return this->valueBC; }
480 
481  bool getSparseFlag() { return this->sparseLayer; }
482 
483  int getPhase() { return this->phase; }
484 
485  // implementation of LayerDataInterface interface
486  //
487  const float *getLayerData(int delay = 0);
488  PVLayerLoc const *getLayerLoc() const { return &(clayer->loc); }
489  bool isExtended() { return true; }
490 
491  double getLastUpdateTime() { return mLastUpdateTime; }
492  double getNextUpdateTime() { return mLastUpdateTime + getDeltaUpdateTime(); }
493 
494  Publisher *getPublisher() { return publisher; }
495 
496  protected:
497  virtual Response::Status
498  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
499  virtual Response::Status allocateDataStructures() override;
500  virtual Response::Status setMaxPhase(int *maxPhase);
501  virtual Response::Status registerData(Checkpointer *checkpointer) override;
502  virtual Response::Status initializeState() override;
503 
504  int openOutputStateFile(Checkpointer *checkpointer);
505 /* static methods called by updateState({long_argument_list})*/
506 
507 #ifdef PV_USE_CUDA
508  virtual int runUpdateKernel();
509  virtual Response::Status updateStateGpu(double timef, double dt);
510 #endif
511  virtual Response::Status updateState(double timef, double dt);
512  virtual int setActivity();
513  void freeChannels();
514 
515  bool mNeedToPublish = true;
516 
517  int numChannels; // number of channels
518  float **GSyn; // of dynamic length numChannels
519  Publisher *publisher = nullptr;
520 
521  float nxScale, nyScale; // Size of layer relative to column
522  int numFeatures;
523  int xmargin, ymargin;
524 
525  bool initializeFromCheckpointFlag = true;
526  // If parent HyPerCol sets initializeFromCheckpointDir and this flag is set,
527  // the initial state is loaded from the initializeFromCheckpointDir.
528  // If the flag is false or the parent's initializeFromCheckpointDir is empty,
529  // the initial siate is calculated using setInitialValues().
530 
531  int numProbes;
532  LayerProbe **probes;
533 
534  int phase; // All layers with phase 0 get updated before any with phase 1, etc.
535  int numDelayLevels; // The number of timesteps in the datastore ring buffer to store older
536  // timesteps for connections with delays
537 
538  bool mirrorBCflag; // true when mirror BC are to be applied
539  float valueBC; // If mirrorBCflag is false, the value of A to fill extended cells with
540 
541  double initialWriteTime; // time of next output
542  double writeTime; // time of next output
543  double writeStep; // output time interval
544  CheckpointableFileStream *mOutputStateStream = nullptr; // activity generated by outputState
545 
546  bool sparseLayer; // if true, only nonzero activities are saved; if false, all values are saved.
547  // bool writeSparseValues; // removed March 14, 2017
548  int writeActivityCalls; // Number of calls to writeActivity (written to nbands in the header of
549  // the a%d.pvp file)
550  int writeActivitySparseCalls; // Number of calls to writeActivitySparse (written to nbands in the
551  // header of the a%d.pvp file)
552 
553  int *marginIndices; // indices of neurons in margin
554  int numMargin; // number of neurons in margin
555 
556  unsigned int rngSeedBase; // The starting seed for rng. The parent HyPerCol reserves
557  // {rngSeedbase, rngSeedbase+1,...rngSeedbase+neededRNGSeeds-1} for use
558  // by this layer
559 
560  char *initVTypeString = nullptr;
561  BaseInitV *mInitVObject = nullptr;
562 
563  HyPerLayer **synchronizedMarginWidthLayers;
564  int numSynchronizedMarginWidthLayers;
565 
566  // Trigger-related parameters
567  // Although triggerFlag was deprecated as a params file parameter, it remains as a member
568  // variable to allow quick testing of whether we're triggering. It is set during
569  // ioParam_triggerLayerName.
570  bool triggerFlag; // Whether the layer has different behavior in response to another layer's
571  // update.
572  char *triggerLayerName; // The layer that triggers different behavior. To turn triggering off,
573  // set this parameter to NULL or ""
574  char *triggerBehavior; // Specifies how to respond to a trigger. Current values are
575  // "updateOnlyOnTrigger" or "resetStateOnTrigger"
576  TriggerBehaviorType triggerBehaviorType;
577  char *triggerResetLayerName; // If triggerBehavior is "resetStateOnTrigger", specifies the layer
578  // to use in resetting values.
579  double triggerOffset; // Adjust the timestep when the trigger is receieved by this amount; must
580  // be >=0. A positive value means the trigger occurs before the
581  // triggerLayerName layer updates.
582  HyPerLayer *triggerLayer;
583  HyPerLayer *triggerResetLayer;
584 
585  char *dataTypeString;
586  PVDataType dataType;
587 
588  double mLastUpdateTime;
589  double mLastTriggerTime;
590 
591  float **thread_gSyn; // Accumulate buffer for each thread, only used if numThreads > 1
592  std::vector<BaseConnection *> recvConns;
593 
594  bool mHasReceived = false;
595  bool mHasUpdated = false;
596 
597 // GPU variables
598 #ifdef PV_USE_CUDA
599  public:
600  virtual void syncGpu();
601  virtual double addGpuTimers();
602 
603  void copyAllGSynToDevice();
604  void copyAllGSynFromDevice();
605  void copyAllVFromDevice();
606  void copyAllActivityFromDevice();
607  PVCuda::CudaBuffer *getDeviceV() { return d_V; }
608  PVCuda::CudaBuffer *getDeviceGSyn() { return d_GSyn; }
609 
610 #ifdef PV_USE_CUDNN
611  PVCuda::CudaBuffer *getCudnnGSyn() { return cudnn_GSyn; }
612 #endif // PV_USE_CUDNN
613  PVCuda::CudaBuffer *getDeviceActivity() { return d_Activity; }
614 
615  PVCuda::CudaBuffer *getDeviceDatastore() { return d_Datastore; }
616 
617  PVCuda::CudaBuffer *getDeviceActiveIndices() { return d_ActiveIndices; }
618 
619  PVCuda::CudaBuffer *getDeviceNumActive() { return d_numActive; }
620 
621 #ifdef PV_USE_CUDNN
622  PVCuda::CudaBuffer *getCudnnDatastore() { return cudnn_Datastore; }
623 #endif // PV_USE_CUDNN
624 
625  void setAllocDeviceV() { allocDeviceV = true; }
626  void setAllocDeviceGSyn() { allocDeviceGSyn = true; }
627 
628  void setAllocDeviceActivity() { allocDeviceActivity = true; }
629 
630  void setAllocDeviceDatastore() { allocDeviceDatastore = true; }
631 
632  void setAllocDeviceActiveIndices() { allocDeviceActiveIndices = true; }
633 
634  bool getUpdatedDeviceActivityFlag() { return updatedDeviceActivity; }
635 
636  void setUpdatedDeviceActivityFlag(bool in) { updatedDeviceActivity = in; }
637 
638  bool getUpdatedDeviceDatastoreFlag() { return updatedDeviceDatastore; }
639 
640  void setUpdatedDeviceDatastoreFlag(bool in) { updatedDeviceDatastore = in; }
641 
642  bool getUpdatedDeviceGSynFlag() { return updatedDeviceGSyn; }
643 
644  void setUpdatedDeviceGSynFlag(bool in) { updatedDeviceGSyn = in; }
645 
646  protected:
647  virtual int allocateUpdateKernel();
648  virtual int allocateDeviceBuffers();
649  // OpenCL buffers and their corresponding flags
650  //
651 
652  bool allocDeviceV;
653  bool allocDeviceGSyn; // array of channels to allocate
654  bool allocDeviceActivity;
655  bool allocDeviceDatastore;
656  bool allocDeviceActiveIndices;
657  bool updatedDeviceActivity;
658  bool updatedDeviceDatastore;
659  bool updatedDeviceGSyn;
660  bool mRecvGpu;
661  bool mUpdateGpu;
662 
663  PVCuda::CudaBuffer *d_V;
664  PVCuda::CudaBuffer *d_GSyn;
665  PVCuda::CudaBuffer *d_Activity;
666  PVCuda::CudaBuffer *d_Datastore;
667  PVCuda::CudaBuffer *d_numActive;
668  PVCuda::CudaBuffer *d_ActiveIndices;
669  PVCuda::CudaKernel *krUpdate;
670 #ifdef PV_USE_CUDNN
671  PVCuda::CudaBuffer *cudnn_GSyn;
672  PVCuda::CudaBuffer *cudnn_Datastore;
673 #endif // PV_USE_CUDNN
674 #endif // PV_USE_CUDA
675 
676  protected:
677  Timer *update_timer;
678  Timer *recvsyn_timer;
679  Timer *publish_timer;
680  Timer *timescale_timer;
681  Timer *io_timer;
682 
683 #ifdef PV_USE_CUDA
684  PVCuda::CudaTimer *gpu_recvsyn_timer;
685  PVCuda::CudaTimer *gpu_update_timer;
686 #endif
687 };
688 
689 } // namespace PV
690 
691 #endif /* HYPERLAYER_HPP_ */
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
Definition: HyPerLayer.cpp:571
virtual void ioParam_triggerOffset(enum ParamsIOFlag ioFlag)
triggerOffset: If triggerLayer is set, triggers <triggerOffset> timesteps before target trigger ...
Definition: HyPerLayer.cpp:761
virtual void resetStateOnTrigger()
virtual void ioParam_triggerBehavior(enum ParamsIOFlag ioFlag)
triggerBehavior: If triggerLayerName is set, this parameter specifies how the trigger is handled...
Definition: HyPerLayer.cpp:774
virtual int allocateDeviceBuffers()
virtual void ioParam_writeStep(enum ParamsIOFlag ioFlag)
writeStep: Specifies how often to output a pvp file for this layer
Definition: HyPerLayer.cpp:825
virtual void ioParam_phase(enum ParamsIOFlag ioFlag)
phase: Defines the ordering in which each layer is updated
Definition: HyPerLayer.cpp:651
bool isAllInputReady()
void allocateRestrictedBuffer(float **buf, const char *bufname)
Definition: HyPerLayer.cpp:325
virtual void ioParam_initializeFromCheckpointFlag(enum ParamsIOFlag ioFlag)
initializeFromCheckpointFlag: If set to true, initialize using checkpoint direcgtory set in HyPerCol...
Definition: HyPerLayer.cpp:671
bool isExchangeFinished(int delay=0)
virtual void ioParam_sparseLayer(enum ParamsIOFlag ioFlag)
sparseLayer: Specifies if the layer should be considered sparese for optimization and output ...
Definition: HyPerLayer.cpp:852
virtual void ioParam_nf(enum ParamsIOFlag ioFlag)
nf: Defines how many features this layer has
Definition: HyPerLayer.cpp:647
virtual void ioParam_triggerLayerName(enum ParamsIOFlag ioFlag)
triggerLayerName: Specifies the name of the layer that this layer triggers off of. If set to NULL or the empty string, the layer does not trigger but updates its state on every timestep.
Definition: HyPerLayer.cpp:702
virtual double getDeltaUpdateTime()
int initialize(const char *name, HyPerCol *hc)
Definition: HyPerLayer.cpp:129
virtual void ioParam_valueBC(enum ParamsIOFlag ioFlag)
valueBC: If mirrorBC is set to true, Uses the specified value for the margin area ...
Definition: HyPerLayer.cpp:664
void allocateExtendedBuffer(float **buf, const char *bufname)
Definition: HyPerLayer.cpp:329
virtual bool needUpdate(double simTime, double dt)
virtual void ioParam_mirrorBCflag(enum ParamsIOFlag ioFlag)
mirrorBCflag: If set to true, the margin will mirror the data
Definition: HyPerLayer.cpp:660
virtual void ioParam_triggerResetLayerName(enum ParamsIOFlag ioFlag)
triggerResetLayerName: If triggerLayerName is set, this parameter specifies the layer to use for upda...
Definition: HyPerLayer.cpp:814
void addRecvConn(BaseConnection *conn)
virtual void ioParam_InitVType(enum ParamsIOFlag ioFlag)
initVType: Specifies how to initialize the V buffer.
Definition: HyPerLayer.cpp:681
int freeExtendedBuffer(float **buf)
Definition: HyPerLayer.cpp:256
int freeRestrictedBuffer(float **buf)
Definition: HyPerLayer.cpp:254
virtual void ioParam_triggerFlag(enum ParamsIOFlag ioFlag)
triggerFlag: (Deprecated) Specifies if this layer is being triggered
Definition: HyPerLayer.cpp:724
virtual double getDeltaTriggerTime()
const float * getLayerData(int delay=0)
virtual void ioParam_writeSparseValues(enum ParamsIOFlag ioFlag)
writeSparseValues: No longer used.
Definition: HyPerLayer.cpp:862
virtual void ioParam_updateGpu(enum ParamsIOFlag ioFlag)
updateGpu: When compiled using CUDA or OpenCL GPU acceleration, this flag tells whether this layer&#39;s ...
Definition: HyPerLayer.cpp:621
virtual void ioParam_nxScale(enum ParamsIOFlag ioFlag)
nxScale: Defines the relationship between the x column size and the layer size.
Definition: HyPerLayer.cpp:639
virtual bool needReset(double timed, double dt)
virtual void ioParam_nyScale(enum ParamsIOFlag ioFlag)
nyScale: Defines the relationship between the y column size and the layer size.
Definition: HyPerLayer.cpp:643
virtual void ioParam_initialWriteTime(enum ParamsIOFlag ioFlag)
initialWriteTime: Specifies the first timestep to start outputing pvp files
Definition: HyPerLayer.cpp:830