PetaVision  Alpha
PV::ImageFromMemoryBuffer Class Reference
Inheritance diagram for PV::ImageFromMemoryBuffer:
PV::ImageLayer PV::InputLayer PV::HyPerLayer PV::BaseLayer PV::BaseObject PV::CheckpointerDataInterface PV::Observer

HyPerLayer Parameters

List of parameters needed from the HyPerLayer class

virtual void ioParam_dataType (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_updateGpu (enum ParamsIOFlag ioFlag)
 updateGpu: When compiled using CUDA or OpenCL GPU acceleration, this flag tells whether this layer's updateState method should use the GPU. If PetaVision was compiled without GPU acceleration, it is an error to set this flag to true.
 
virtual void ioParam_nxScale (enum ParamsIOFlag ioFlag)
 nxScale: Defines the relationship between the x column size and the layer size. More...
 
virtual void ioParam_nyScale (enum ParamsIOFlag ioFlag)
 nyScale: Defines the relationship between the y column size and the layer size. More...
 
virtual void ioParam_nf (enum ParamsIOFlag ioFlag)
 nf: Defines how many features this layer has
 
virtual void ioParam_phase (enum ParamsIOFlag ioFlag)
 phase: Defines the ordering in which each layer is updated
 
virtual void ioParam_mirrorBCflag (enum ParamsIOFlag ioFlag)
 mirrorBCflag: If set to true, the margin will mirror the data
 
virtual void ioParam_valueBC (enum ParamsIOFlag ioFlag)
 valueBC: If mirrorBC is set to true, Uses the specified value for the margin area
 
virtual void ioParam_initializeFromCheckpointFlag (enum ParamsIOFlag ioFlag)
 initializeFromCheckpointFlag: If set to true, initialize using checkpoint direcgtory set in HyPerCol. More...
 
virtual void ioParam_triggerFlag (enum ParamsIOFlag ioFlag)
 triggerFlag: (Deprecated) Specifies if this layer is being triggered More...
 
virtual void ioParam_triggerOffset (enum ParamsIOFlag ioFlag)
 triggerOffset: If triggerLayer is set, triggers <triggerOffset> timesteps before target trigger More...
 
virtual void ioParam_triggerBehavior (enum ParamsIOFlag ioFlag)
 triggerBehavior: If triggerLayerName is set, this parameter specifies how the trigger is handled. More...
 
virtual void ioParam_triggerResetLayerName (enum ParamsIOFlag ioFlag)
 triggerResetLayerName: If triggerLayerName is set, this parameter specifies the layer to use for updating the state when the trigger happens. If set to NULL or the empty string, use triggerLayerName.
 
virtual void ioParam_writeStep (enum ParamsIOFlag ioFlag)
 writeStep: Specifies how often to output a pvp file for this layer More...
 
virtual void ioParam_initialWriteTime (enum ParamsIOFlag ioFlag)
 initialWriteTime: Specifies the first timestep to start outputing pvp files
 
virtual void ioParam_sparseLayer (enum ParamsIOFlag ioFlag)
 sparseLayer: Specifies if the layer should be considered sparese for optimization and output
 
virtual void ioParam_writeSparseValues (enum ParamsIOFlag ioFlag)
 writeSparseValues: No longer used.
 

Image Parameters

List of parameters needed from the ImageFromMemoryBuffer class

bool hasNewImageFlag
 
virtual void ioParam_inputPath (enum ParamsIOFlag ioFlag) override
 inputPath: Not used by ImageFromMemoryBuffer. More...
 
virtual int initializeActivity (double time, double dt)
 
int initialize_base ()
 
template<typename pixeltype >
float pixelTypeConvert (pixeltype q, pixeltype zeroval, pixeltype oneval)
 

Public Member Functions

 ImageFromMemoryBuffer (char const *name, HyPerCol *hc)
 
virtual bool activityIsSpiking () override
 
virtual double addGpuTimers ()
 
void addRecvConn (BaseConnection *conn)
 
virtual int allocateDataStructures () override
 
int callUpdateState (double simTime, double dt)
 
void clearProgressFlags ()
 
void copyAllActivityFromDevice ()
 
void copyAllGSynFromDevice ()
 
void copyAllGSynToDevice ()
 
void copyAllVFromDevice ()
 
float * getActivity ()
 
float * getChannel (ChannelType ch)
 
virtual float getChannelTimeConst (enum ChannelType channel_type)
 
PVLayergetCLayer ()
 
virtual std::string const & getCurrentFilename (int localBatchElement, int mpiBatchIndex) const override
 
bool getDataStructuresAllocatedFlag ()
 
PVDataType getDataType ()
 
virtual double getDeltaTriggerTime ()
 
virtual double getDeltaUpdateTime () override
 
std::string const & getDescription () const
 
char const * getDescription_c () const
 
PVCuda::CudaBuffer * getDeviceActiveIndices ()
 
PVCuda::CudaBuffer * getDeviceActivity ()
 
PVCuda::CudaBuffer * getDeviceDatastore ()
 
PVCuda::CudaBuffer * getDeviceGSyn ()
 
PVCuda::CudaBuffer * getDeviceNumActive ()
 
PVCuda::CudaBuffer * getDeviceV ()
 
int getDisplayPeriod ()
 
bool getHasReceived ()
 
bool getHasUpdated ()
 
bool getInitialValuesSetFlag ()
 
bool getInitInfoCommunicatedFlag ()
 
const std::string & getInputPath () const
 
char const * getKeyword () const
 
double getLastUpdateTime ()
 
const float * getLayerData (int delay=0)
 
PVLayerLoc const * getLayerLoc () const
 
float getMaxRate ()
 
MPIBlock const * getMPIBlock ()
 
char const * getName () const
 
double getNextUpdateTime ()
 
int getNumChannels ()
 
int getNumDelayLevels ()
 
int getNumExtended ()
 
int getNumExtendedAllBatches ()
 
int getNumGlobalExtended ()
 
int getNumGlobalNeurons ()
 
int getNumNeurons ()
 
int getNumNeuronsAllBatches ()
 
int getNumProbes ()
 
int getPhase ()
 
LayerProbegetProbe (int n)
 
PublishergetPublisher ()
 
bool getRecvGpu ()
 
int getSkipIndex (int batchIndex)
 
bool getSparseFlag ()
 
int getStartIndex (int batchIndex)
 
virtual double getTimeScale (int batchIdx)
 
bool getUpdatedDeviceActivityFlag ()
 
bool getUpdatedDeviceDatastoreFlag ()
 
bool getUpdatedDeviceGSynFlag ()
 
bool getUpdateGpu ()
 
float * getV ()
 
float getValueBC ()
 
int getXScale ()
 
int getYScale ()
 
int increaseDelayLevels (int neededDelay)
 
virtual int insertProbe (LayerProbe *probe)
 
int ioParams (enum ParamsIOFlag ioFlag)
 
bool isAllInputReady ()
 
bool isExchangeFinished (int delay=0)
 
bool isExtended ()
 
bool isUsingGPU () const
 
int mirrorInteriorToBorder (PVLayerCube *cube, PVLayerCube *borderCube)
 
virtual int mirrorToEast (PVLayerCube *dest, PVLayerCube *src)
 
virtual int mirrorToNorth (PVLayerCube *dest, PVLayerCube *src)
 
virtual int mirrorToNorthEast (PVLayerCube *dest, PVLayerCube *src)
 
virtual int mirrorToNorthWest (PVLayerCube *dest, PVLayerCube *src)
 
virtual int mirrorToSouth (PVLayerCube *dest, PVLayerCube *src)
 
virtual int mirrorToSouthEast (PVLayerCube *dest, PVLayerCube *src)
 
virtual int mirrorToSouthWest (PVLayerCube *dest, PVLayerCube *src)
 
virtual int mirrorToWest (PVLayerCube *dest, PVLayerCube *src)
 
virtual bool needUpdate (double time, double dt) override
 
int outputProbeParams ()
 
virtual int outputState (double timef)
 
virtual int publish (Communicator *comm, double simTime)
 
virtual int recvAllSynapticInput ()
 
virtual int requireChannel (int channelNeeded, int *numChannelsResult) override
 
virtual int requireMarginWidth (int marginWidthNeeded, int *marginWidthResult, char axis)
 
int resetBuffer (float *buf, int numItems)
 
virtual int resetGSynBuffers (double timef, double dt)
 
virtual int respond (std::shared_ptr< BaseMessage const > message) override
 
virtual int respondLayerAdvanceDataStore (LayerAdvanceDataStoreMessage const *message)
 
virtual int respondLayerCheckNotANumber (LayerCheckNotANumberMessage const *message)
 
virtual int respondLayerCopyFromGpu (LayerCopyFromGpuMessage const *message)
 
virtual int respondLayerOutputState (LayerOutputStateMessage const *message)
 
virtual int respondLayerPublish (LayerPublishMessage const *message)
 
virtual int respondLayerRecvSynapticInput (LayerRecvSynapticInputMessage const *message)
 
virtual int respondLayerUpdateState (LayerUpdateStateMessage const *message)
 
void setAllocDeviceActiveIndices ()
 
void setAllocDeviceActivity ()
 
void setAllocDeviceDatastore ()
 
void setAllocDeviceGSyn ()
 
void setAllocDeviceV ()
 
template<typename pixeltype >
int setMemoryBuffer (pixeltype const *externalBuffer, int height, int width, int numbands, int xstride, int ystride, int bandstride, pixeltype zeroval, pixeltype oneval)
 
template<typename pixeltype >
int setMemoryBuffer (pixeltype const *externalBuffer, int height, int width, int numbands, int xstride, int ystride, int bandstride, pixeltype zeroval, pixeltype oneval, int offsetX, int offsetY, char const *offsetAnchor)
 
void setUpdatedDeviceActivityFlag (bool in)
 
void setUpdatedDeviceDatastoreFlag (bool in)
 
void setUpdatedDeviceGSynFlag (bool in)
 
virtual void syncGpu ()
 
void synchronizeMarginWidth (HyPerLayer *layer)
 
virtual int updateActiveIndices ()
 
virtual int updateAllActiveIndices ()
 
virtual int updateState (double time, double dt) override
 
bool useMirrorBCs ()
 
virtual int waitOnPublish (Communicator *comm)
 
virtual int writeActivity (double timed)
 
virtual int writeActivitySparse (double timed)
 

Static Public Member Functions

static bool localDimensionsEqual (PVLayerLoc const *loc1, PVLayerLoc const *loc2)
 

Data Fields

PVLayerclayer
 

Protected Member Functions

void addPublisher ()
 
virtual int allocateActivity ()
 
template<typename T >
int allocateBuffer (T **buf, int bufsize, const char *bufname)
 
virtual int allocateBuffers ()
 
virtual int allocateClayerBuffers ()
 
int allocateCube ()
 
virtual int allocateDeviceBuffers ()
 
int allocateExtendedBuffer (float **buf, const char *bufname)
 
virtual int allocateGSyn ()
 
virtual int allocatePrevActivity ()
 
int allocateRestrictedBuffer (float **buf, const char *bufname)
 
virtual int allocateUpdateKernel ()
 
virtual int allocateV () override
 
void calcNumExtended ()
 
void checkpointPvpActivityFloat (Checkpointer *checkpointer, char const *bufferName, float *pvpBuffer, bool extended)
 
void checkpointRandState (Checkpointer *checkpointer, char const *bufferName, Random *randState, bool extendedFlag)
 
int checkValidAnchorString (const char *offsetAnchor)
 
virtual int cleanup ()
 
virtual int communicateInitInfo (CommunicateInitInfoMessage const *message) override
 
virtual int copyInitialStateToGPU () override
 
virtual int countInputImages () override
 
virtual std::string describeInput (int index) override
 
template<typename T >
int freeBuffer (T **buf)
 
void freeChannels ()
 
int freeClayer ()
 
int freeExtendedBuffer (float **buf)
 
int freeRestrictedBuffer (float **buf)
 
virtual int initClayer ()
 
int initialize (char const *name, HyPerCol *hc)
 
virtual int initializeActivity () override
 
void initializeBatchIndexer ()
 
virtual int initializeState () overridefinal
 
virtual int initializeV () override
 
virtual void ioParam_aspectRatioAdjustment (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_autoResizeFlag (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_batchMethod (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_displayPeriod (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_InitVType (enum ParamsIOFlag ioFlag) override
 initVType: Specifies how to initialize the V buffer. More...
 
virtual void ioParam_interpolationMethod (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_inverseFlag (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_normalizeLuminanceFlag (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_normalizeStdDev (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_offsetAnchor (enum ParamsIOFlag ioFlag)
 
virtual int ioParam_offsets (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_padValue (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_randomSeed (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_resetToStartOnLoop (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_skip_frame_index (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_start_frame_index (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_triggerLayerName (enum ParamsIOFlag ioFlag) override
 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.
 
virtual void ioParam_useInputBCflag (enum ParamsIOFlag ioFlag)
 
virtual void ioParam_writeFrameToTimestamp (enum ParamsIOFlag ioFlag)
 
virtual int ioParamsFillGroup (enum ParamsIOFlag ioFlag) override
 
virtual bool needReset (double timed, double dt)
 
virtual void normalizePixels (Buffer< float > &buffer)
 
int openOutputStateFile (Checkpointer *checkpointer)
 
void populateFileList ()
 
virtual int prepareCheckpointWrite ()
 
virtual int processCheckpointRead () override
 
virtual int readActivityFromCheckpoint (Checkpointer *checkpointer)
 
virtual int readDelaysFromCheckpoint (Checkpointer *checkpointer)
 
void readImage (std::string filename)
 
virtual int readStateFromCheckpoint (Checkpointer *checkpointer) override
 
virtual int readVFromCheckpoint (Checkpointer *checkpointer)
 
virtual bool readyForNextFile ()
 
virtual int registerData (Checkpointer *checkpointer) override
 
virtual int resetStateOnTrigger ()
 
int respondAllocateData (AllocateDataMessage const *message)
 
int respondCleanup (CleanupMessage const *message)
 
int respondCommunicateInitInfo (CommunicateInitInfoMessage const *message)
 
int respondCopyInitialStateToGPUMessage (CopyInitialStateToGPUMessage const *message)
 
int respondInitializeState (InitializeStateMessage const *message)
 
int respondPrepareCheckpointWrite (PrepareCheckpointWriteMessage const *message)
 
int respondProcessCheckpointRead (ProcessCheckpointReadMessage const *message)
 
int respondReadStateFromCheckpoint (ReadStateFromCheckpointMessage< Checkpointer > const *message)
 
int respondRegisterData (RegisterDataMessage< Checkpointer > const *message)
 
virtual Buffer< float > retrieveData (int inputIndex) override
 
void retrieveInput (double timef, double dt)
 
void retrieveInputAndAdvanceIndex (double timef, double dt)
 
virtual int runUpdateKernel ()
 
int scatterInput (int localBatchIndex, int mpiBatchIndex)
 
virtual int setActivity ()
 
void setDataStructuresAllocatedFlag ()
 
virtual int setDescription ()
 
virtual int setInitialValues ()
 
void setInitialValuesSetFlag ()
 
void setInitInfoCommunicatedFlag ()
 
int setLayerLoc (PVLayerLoc *layerLoc, float nxScale, float nyScale, int nf, int numBatches)
 
int setName (char const *name)
 
int setParent (HyPerCol *hc)
 
void updateNBands (int numCalls)
 
virtual int updateStateGpu (double timef, double dt)
 

Static Protected Member Functions

static int equalizeMargins (HyPerLayer *layer1, HyPerLayer *layer2)
 

Protected Attributes

bool allocDeviceActiveIndices
 
bool allocDeviceActivity
 
bool allocDeviceDatastore
 
bool allocDeviceGSyn
 
bool allocDeviceV
 
PVCuda::CudaBuffer * d_ActiveIndices
 
PVCuda::CudaBuffer * d_Activity
 
PVCuda::CudaBuffer * d_Datastore
 
PVCuda::CudaBuffer * d_GSyn
 
PVCuda::CudaBuffer * d_numActive
 
PVCuda::CudaBuffer * d_V
 
PVDataType dataType
 
char * dataTypeString
 
std::string description
 
PVCuda::CudaTimer * gpu_recvsyn_timer
 
PVCuda::CudaTimer * gpu_update_timer
 
float ** GSyn
 
bool initializeFromCheckpointFlag = true
 
double initialWriteTime
 
char * initVTypeString = nullptr
 
Timerio_timer
 
PVCuda::CudaKernel * krUpdate
 
Buffer< float >::Anchor mAnchor = Buffer<float>::CENTER
 
int * marginIndices
 
bool mAutoResizeFlag = false
 
float maxRate
 
std::unique_ptr< BatchIndexermBatchIndexer
 
BatchIndexer::BatchMethod mBatchMethod
 
bool mDataStructuresAllocatedFlag = false
 
std::vector< std::string > mFileList
 
bool mHasReceived = false
 
bool mHasUpdated = false
 
std::unique_ptr< ImagemImage = nullptr
 
bool mInitialValuesSetFlag = false
 
bool mInitInfoCommunicatedFlag = false
 
BaseInitVmInitVObject = nullptr
 
BufferUtils::InterpolationMethod mInterpolationMethod = BufferUtils::BICUBIC
 
bool mInverseFlag = false
 
bool mirrorBCflag
 
double mLastTriggerTime
 
double mLastUpdateTime
 
bool mNeedToPublish = true
 
bool mNormalizeLuminanceFlag = false
 
bool mNormalizeStdDev = true
 
int mOffsetX = 0
 
int mOffsetY = 0
 
CheckpointableFileStreammOutputStateStream = nullptr
 
int mRandomSeed = 123456789
 
BufferUtils::RescaleMethod mRescaleMethod
 
std::string mURLDownloadTemplate
 
bool mUseInputBCflag = false
 
bool mUsingFileList = false
 
bool mUsingGPUFlag = false
 
char * name = nullptr
 
int numChannels
 
int numDelayLevels
 
int numFeatures
 
int numMargin
 
int numProbes
 
int numSynchronizedMarginWidthLayers
 
float nxScale
 
float nyScale
 
HyPerColparent = nullptr
 
int phase
 
LayerProbe ** probes
 
Timerpublish_timer
 
Publisherpublisher = nullptr
 
std::vector< BaseConnection * > recvConns
 
bool recvGpu
 
Timerrecvsyn_timer
 
unsigned int rngSeedBase
 
bool sparseLayer
 
HyPerLayer ** synchronizedMarginWidthLayers
 
float ** thread_gSyn
 
Timertimescale_timer
 
char * triggerBehavior
 
TriggerBehaviorType triggerBehaviorType
 
bool triggerFlag
 
HyPerLayertriggerLayer
 
char * triggerLayerName
 
double triggerOffset
 
HyPerLayertriggerResetLayer
 
char * triggerResetLayerName
 
Timerupdate_timer
 
bool updatedDeviceActivity
 
bool updatedDeviceDatastore
 
bool updatedDeviceGSyn
 
bool updateGpu
 
float valueBC
 
int writeActivityCalls
 
int writeActivitySparseCalls
 
double writeStep
 
double writeTime
 
int xmargin
 
int ymargin
 

Detailed Description

Definition at line 21 of file ImageFromMemoryBuffer.hpp.

Member Function Documentation

void PV::HyPerLayer::addRecvConn ( BaseConnection conn)
inherited

Adds the given connection to the vector of connections to receive input from. The connection's post-synaptic layer must be the layer for which this member function is called.

Definition at line 1224 of file HyPerLayer.cpp.

int PV::HyPerLayer::allocateDeviceBuffers ( )
protectedvirtualinherited

Allocate GPU buffers. This must be called after PVLayer data have been allocated.

Definition at line 1085 of file HyPerLayer.cpp.

int PV::HyPerLayer::allocateExtendedBuffer ( float **  buf,
const char *  bufname 
)
protectedinherited

Allocates an extended buffer (that is, buffer's length is getNumExtendedAllBatches()).

Definition at line 340 of file HyPerLayer.cpp.

int PV::HyPerLayer::allocateRestrictedBuffer ( float **  buf,
const char *  bufname 
)
protectedinherited

Allocates a restricted buffer (that is, buffer's length is getNumNeuronsAllBatches()).

Definition at line 336 of file HyPerLayer.cpp.

int PV::ImageLayer::countInputImages ( )
overrideprotectedvirtualinherited

This pure virtual function gets called by initializeBatchIndexer in order to give the BatchIndexer the number of input images.

Implements PV::InputLayer.

Definition at line 14 of file ImageLayer.cpp.

std::string PV::ImageLayer::describeInput ( int  index)
overrideprotectedvirtualinherited

This function is called by updateState if writeFrameToTimestamp is used. It provides the opportunity for a subclass to insert a description of the input, along with the timestamp and the name of the InputLayer. The input argument is the index into the list of input frames. The default is to return the empty string. However, ImageLayer overrides this so that, when a list of filenames is used, it returns the name of the filename for that index.

Reimplemented from PV::InputLayer.

Definition at line 155 of file ImageLayer.cpp.

int PV::HyPerLayer::freeExtendedBuffer ( float **  buf)
protectedinherited

Frees a buffer created by allocateRestrictedBuffer(). Note that there is no checking whether the buffer was created by allocateExtendedBuffer(), or any other allocateBuffer()-related method.

Definition at line 264 of file HyPerLayer.cpp.

int PV::HyPerLayer::freeRestrictedBuffer ( float **  buf)
protectedinherited

Frees a buffer created by allocateRestrictedBuffer(). Note that there is no checking whether the buffer was created by allocateRestrictedBuffer(), or any other allocateBuffer()-related method.

Definition at line 262 of file HyPerLayer.cpp.

std::string const & PV::ImageLayer::getCurrentFilename ( int  localBatchElement,
int  mpiBatchIndex 
) const
overridevirtualinherited

A virtual method to return the filename containing the input of the current batch index. Caveats: updateState advances the batch indices after loading data, so this typically returns the filename that will belong to the next input to be loaded, not the current input. Since only the processes with MPIBlock rank zero do input/output, the result of this method is only reliable for those processes.

Reimplemented from PV::InputLayer.

Definition at line 32 of file ImageLayer.cpp.

bool PV::BaseObject::getDataStructuresAllocatedFlag ( )
inlineinherited

Get-method for mDataStructuresAllocatedFlag, which is false on initialization and then becomes true once setDataStructuresAllocatedFlag() is called.

Definition at line 65 of file BaseObject.hpp.

double PV::HyPerLayer::getDeltaTriggerTime ( )
virtualinherited

A function to return the interval between triggering times. A negative value means that the layer never triggers (either there is no triggerLayer or the triggerLayer never updates).

Definition at line 1673 of file HyPerLayer.cpp.

double PV::ImageFromMemoryBuffer::getDeltaUpdateTime ( )
overridevirtual

For ImageFromMemoryBuffer, the updateTime is the parent->getStopTime() - parent->getStartTime(). Implemented to allow triggering off of an ImageFromMemoryBuffer layer.

Reimplemented from PV::InputLayer.

Definition at line 171 of file ImageFromMemoryBuffer.cpp.

bool PV::BaseObject::getInitialValuesSetFlag ( )
inlineinherited

Get-method for mInitialValuesSetFlag, which is false on initialization and then becomes true once setInitialValuesSetFlag() is called.

Definition at line 71 of file BaseObject.hpp.

bool PV::BaseObject::getInitInfoCommunicatedFlag ( )
inlineinherited

Get-method for mInitInfoCommunicatedFlag, which is false on initialization and then becomes true once setInitInfoCommunicatedFlag() is called.

Definition at line 58 of file BaseObject.hpp.

const float * PV::HyPerLayer::getLayerData ( int  delay = 0)
inherited

Returns the activity data for the layer. This data is in the extended space (with margins).

Definition at line 1563 of file HyPerLayer.cpp.

int PV::ImageFromMemoryBuffer::initializeActivity ( double  time,
double  dt 
)
protectedvirtual

Called by HyPerLayer::setActivity() during setInitialValues stage; calls copyBuffer()

Definition at line 157 of file ImageFromMemoryBuffer.cpp.

void PV::HyPerLayer::ioParam_initializeFromCheckpointFlag ( enum ParamsIOFlag  ioFlag)
protectedvirtualinherited

initializeFromCheckpointFlag: If set to true, initialize using checkpoint direcgtory set in HyPerCol.

Checkpoint read directory must be set in HyPerCol to initialize from checkpoint.

Definition at line 705 of file HyPerLayer.cpp.

void PV::InputLayer::ioParam_InitVType ( enum ParamsIOFlag  ioFlag)
overrideprotectedvirtualinherited

initVType: Specifies how to initialize the V buffer.

Possible choices include

Further parameters are needed depending on initialization type.

Reimplemented from PV::HyPerLayer.

Definition at line 622 of file InputLayer.cpp.

virtual void PV::ImageFromMemoryBuffer::ioParam_inputPath ( enum ParamsIOFlag  ioFlag)
inlineoverrideprotectedvirtual

inputPath: Not used by ImageFromMemoryBuffer.

ImageFromMemoryBuffer does not read the input from a path. Instead, call setMemoryBuffer()

Reimplemented from PV::InputLayer.

Definition at line 118 of file ImageFromMemoryBuffer.hpp.

void PV::HyPerLayer::ioParam_nxScale ( enum ParamsIOFlag  ioFlag)
protectedvirtualinherited

nxScale: Defines the relationship between the x column size and the layer size.

Must be 2^n or 1/2^n

Definition at line 673 of file HyPerLayer.cpp.

void PV::HyPerLayer::ioParam_nyScale ( enum ParamsIOFlag  ioFlag)
protectedvirtualinherited

nyScale: Defines the relationship between the y column size and the layer size.

Must be 2^n or 1/2^n

Definition at line 677 of file HyPerLayer.cpp.

void PV::HyPerLayer::ioParam_triggerBehavior ( enum ParamsIOFlag  ioFlag)
protectedvirtualinherited

triggerBehavior: If triggerLayerName is set, this parameter specifies how the trigger is handled.

The possible values of triggerBehavior are:

  • "updateOnlyOnTrigger": updateState is called (computing activity buffer from GSyn) only on triggering timesteps. On other timesteps the layer's state remains unchanged.
  • "resetStateOnTrigger": On timesteps where the trigger occurs, the membrane potential is copied from the layer specified in triggerResetLayerName and setActivity is called. On nontriggering timesteps, updateState is called. For backward compatibility, this parameter defaults to updateOnlyOnTrigger.

Definition at line 803 of file HyPerLayer.cpp.

void PV::HyPerLayer::ioParam_triggerFlag ( enum ParamsIOFlag  ioFlag)
protectedvirtualinherited

triggerFlag: (Deprecated) Specifies if this layer is being triggered

Defaults to false. This flag is deprecated. To turn triggering off, set triggerLayer to NULL or the empty string. It is an error to set this flag to false and triggerLayer to a nonempty string.

Definition at line 753 of file HyPerLayer.cpp.

void PV::HyPerLayer::ioParam_triggerOffset ( enum ParamsIOFlag  ioFlag)
protectedvirtualinherited

triggerOffset: If triggerLayer is set, triggers <triggerOffset> timesteps before target trigger

Defaults to 0

Definition at line 790 of file HyPerLayer.cpp.

void PV::HyPerLayer::ioParam_writeStep ( enum ParamsIOFlag  ioFlag)
protectedvirtualinherited

writeStep: Specifies how often to output a pvp file for this layer

Defaults to every timestep. -1 specifies not to write at all.

Definition at line 854 of file HyPerLayer.cpp.

int PV::ImageFromMemoryBuffer::ioParamsFillGroup ( enum ParamsIOFlag  ioFlag)
overrideprotectedvirtual

The function that calls all ioParam functions

Reimplemented from PV::InputLayer.

Definition at line 41 of file ImageFromMemoryBuffer.cpp.

bool PV::HyPerLayer::isAllInputReady ( )
inherited

Returns true if each layer that delivers input to this layer has finished its MPI exchange for its delay; false if any of them has not.

Definition at line 1911 of file HyPerLayer.cpp.

bool PV::HyPerLayer::isExchangeFinished ( int  delay = 0)
inherited

Returns true if the MPI exchange for the specified delay has finished; false if it is still in process.

Definition at line 1909 of file HyPerLayer.cpp.

bool PV::BaseObject::isUsingGPU ( ) const
inlineinherited

Returns true if the object requires the GPU; false otherwise. HyPerCol will not initialize the GPU unless one of the objects in its hierarchy returns true

Definition at line 79 of file BaseObject.hpp.

bool PV::HyPerLayer::needReset ( double  timed,
double  dt 
)
protectedvirtualinherited

Returns true if the trigger behavior is resetStateOnTrigger and the layer was triggered.

Definition at line 1705 of file HyPerLayer.cpp.

virtual bool PV::ImageFromMemoryBuffer::needUpdate ( double  time,
double  dt 
)
inlineoverridevirtual

Returns true if a new image has been set by a call to setMemoryBuffer without having been copied to the activity buffer by a call to copyBuffer() (which is called by either updateState or initializeActivity)

Reimplemented from PV::HyPerLayer.

Definition at line 86 of file ImageFromMemoryBuffer.hpp.

void PV::InputLayer::normalizePixels ( Buffer< float > &  buffer)
protectedvirtualinherited

normalizePixels transforms the image based on the normalizeLuminanceFlag, normalizeStdDev, and inverseFlag parameters. Overload this to add additional post process steps in subclasses.

Definition at line 223 of file InputLayer.cpp.

int PV::HyPerLayer::resetStateOnTrigger ( )
protectedvirtualinherited

Called instead of updateState when triggerBehavior is "resetStateOnTrigger" and a triggering event occurs. Copies the membrane potential V from triggerResetLayer and then calls setActivity to update A.

Definition at line 1756 of file HyPerLayer.cpp.

Buffer< float > PV::ImageLayer::retrieveData ( int  inputIndex)
overrideprotectedvirtualinherited

This pure virtual function gets called by the root process during initializeActivity and during updateState. It loads the entire input (scattering to nonroot processes is done by the scatterInput method) into a buffer. inputIndex is the (zero-indexed) index into the list of inputs.

Implements PV::InputLayer.

Definition at line 72 of file ImageLayer.cpp.

void PV::InputLayer::retrieveInput ( double  timef,
double  dt 
)
protectedinherited

Each batch element loads its data with the input specified by the current index for that batch element. The indices are not modified.

Definition at line 97 of file InputLayer.cpp.

void PV::InputLayer::retrieveInputAndAdvanceIndex ( double  timef,
double  dt 
)
protectedinherited

Each batch element loads its input by calling retrieveInput(), and then advances its index by the amount specified by skip_frame_index.

Definition at line 116 of file InputLayer.cpp.

int PV::InputLayer::scatterInput ( int  localBatchIndex,
int  mpiBatchIndex 
)
protectedinherited

This method scatters the mInputData buffer to the activity buffers of the several MPI processes.

Definition at line 126 of file InputLayer.cpp.

void PV::BaseObject::setDataStructuresAllocatedFlag ( )
inlineprotectedinherited

This method sets mDataStructuresAllocatedFlag to true.

Definition at line 111 of file BaseObject.hpp.

void PV::BaseObject::setInitialValuesSetFlag ( )
inlineprotectedinherited

This method sets the flag returned by getInitialValuesSetFlag to true.

Definition at line 116 of file BaseObject.hpp.

void PV::BaseObject::setInitInfoCommunicatedFlag ( )
inlineprotectedinherited

This method sets mInitInfoCommunicatedFlag to true.

Definition at line 106 of file BaseObject.hpp.

template<typename pixeltype >
int PV::ImageFromMemoryBuffer::setMemoryBuffer ( pixeltype const *  externalBuffer,
int  height,
int  width,
int  numbands,
int  xstride,
int  ystride,
int  bandstride,
pixeltype  zeroval,
pixeltype  oneval 
)

Sets the image. Under MPI, nonroot processes ignore the externalBuffer argument; all other arguments must be the same across all processes.

Inputs: buffer A pointer to the beffer containing the image. Under MPI, only the root process uses buffer and the root process scatters the image to the other processes. height The height in pixels of the entire image width The width in pixels of the entire image numbands The number of bands in the image: i.e., grayscale=1, RGB=3, etc. xstride The difference between the memory locations, as pointers of type pixeltype, between two pixels adjacent in the x-direction, with the same y-coordinate and band number. ystride The difference between the memory locations, as pointers of type pixeltype, between two pixels adjacent in the y-direction, with the same x-coordinate and band number. bandstride The difference between the memory locations, as pointers of type pixeltype, between two pixels from adjacent bands, with the same x- and y-coordinates. zeroval The value that should be converted to 0.0f internally. oneval The value that should be converted to 1.0f internally. Values other than zeroval and oneval are converted to floats using a linear transformation.

Definition at line 49 of file ImageFromMemoryBuffer.cpp.

template<typename pixeltype >
int PV::ImageFromMemoryBuffer::setMemoryBuffer ( pixeltype const *  externalBuffer,
int  height,
int  width,
int  numbands,
int  xstride,
int  ystride,
int  bandstride,
pixeltype  zeroval,
pixeltype  oneval,
int  offsetX,
int  offsetY,
char const *  offsetAnchor 
)

Sets the image. Overloads setMemoryBuffer to also change the parameters offsetX, offsetY, and offsetAnchor.

Definition at line 100 of file ImageFromMemoryBuffer.cpp.

int PV::ImageFromMemoryBuffer::updateState ( double  time,
double  dt 
)
overridevirtual

Overrides updateState

Reimplemented from PV::InputLayer.

Definition at line 162 of file ImageFromMemoryBuffer.cpp.


The documentation for this class was generated from the following files: