23 #ifndef BASEOBJECT_HPP_ 24 #define BASEOBJECT_HPP_ 26 #include "checkpointing/Checkpointer.hpp" 27 #include "checkpointing/CheckpointerDataInterface.hpp" 28 #include "columns/Messages.hpp" 29 #include "include/pv_common.h" 30 #include "observerpattern/Observer.hpp" 31 #include "utils/PVAlloc.hpp" 32 #include "utils/PVAssert.hpp" 33 #include "utils/PVLog.hpp" 37 #include "arch/cuda/CudaDevice.hpp" 46 inline char const *getName()
const {
return name; }
50 inline std::string
const &getObjectType()
const {
return mObjectType; }
83 void ioParams(
enum ParamsIOFlag ioFlag,
bool printHeader,
bool printFooter);
85 virtual Response::Status respond(std::shared_ptr<BaseMessage const> message)
override;
117 #endif // PV_USE_CUDA 121 int initialize(
char const *name,
HyPerCol *hc);
122 int setName(
char const *name);
124 virtual void setObjectType();
125 void setDescription();
142 respondCommunicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message);
144 Response::Status respondSetCudaDevice(std::shared_ptr<SetCudaDeviceMessage const> message);
145 #endif // PV_USE_CUDA 146 Response::Status respondAllocateData(std::shared_ptr<AllocateDataMessage const> message);
147 Response::Status respondInitializeState(std::shared_ptr<InitializeStateMessage const> message);
149 respondCopyInitialStateToGPU(std::shared_ptr<CopyInitialStateToGPUMessage const> message);
150 Response::Status respondCleanup(std::shared_ptr<CleanupMessage const> message);
152 virtual Response::Status
153 communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) {
154 return Response::SUCCESS;
157 virtual Response::Status setCudaDevice(std::shared_ptr<SetCudaDeviceMessage const> message);
158 #endif // PV_USE_CUDA 159 virtual Response::Status allocateDataStructures() {
return Response::NO_ACTION; }
160 virtual Response::Status initializeState() {
return Response::NO_ACTION; }
161 virtual Response::Status readStateFromCheckpoint(
Checkpointer *checkpointer)
override {
162 return Response::NO_ACTION;
164 virtual Response::Status copyInitialStateToGPU() {
return Response::SUCCESS; }
165 virtual Response::Status cleanup() {
return Response::NO_ACTION; }
184 char *name =
nullptr;
185 std::string mObjectType;
188 bool mInitInfoCommunicatedFlag =
false;
189 bool mDataStructuresAllocatedFlag =
false;
190 bool mInitialValuesSetFlag =
false;
192 bool mUsingGPUFlag =
false;
193 PVCuda::CudaDevice *mCudaDevice =
nullptr;
194 #endif // PV_USE_CUDA 197 int initialize_base();
bool getInitialValuesSetFlag() const
bool getDataStructuresAllocatedFlag() const
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag)
char const * lookupKeyword() const
void setInitInfoCommunicatedFlag()
void setDataStructuresAllocatedFlag()
void ioParams(enum ParamsIOFlag ioFlag, bool printHeader, bool printFooter)
void setInitialValuesSetFlag()
bool getInitInfoCommunicatedFlag() const