11 #include "include/pv_arch.h" 12 #include "include/pv_types.h" 13 #include "layers/PVLayerCube.hpp" 14 #include "structures/RingBuffer.hpp" 15 #include "structures/SparseList.hpp" 23 DataStore(
int numBuffers,
int numItems,
int numLevels,
bool isSparse);
27 delete mLastUpdateTimes;
29 delete mActiveIndices;
32 int getNumLevels()
const {
return mNumLevels; }
33 int getNumBuffers()
const {
return mNumBuffers; }
34 void newLevelIndex() {
36 mLastUpdateTimes->newLevel();
38 mNumActive->newLevel();
39 mActiveIndices->newLevel();
41 mCurrentLevel = (mNumLevels + mCurrentLevel - 1) % mNumLevels;
46 float *buffer(
int bufferId,
int level) {
47 return mBuffer->getBuffer(level, bufferId * mNumItems);
50 float *buffer(
int bufferId) {
return mBuffer->getBuffer(bufferId * mNumItems); }
52 double getLastUpdateTime(
int bufferId,
int level)
const {
53 return *mLastUpdateTimes->getBuffer(level, bufferId);
56 double getLastUpdateTime(
int bufferId)
const {
return *mLastUpdateTimes->getBuffer(bufferId); }
58 void setLastUpdateTime(
int bufferId,
int level,
double t) {
59 *mLastUpdateTimes->getBuffer(level, bufferId) = t;
62 void setLastUpdateTime(
int bufferId,
double t) { *mLastUpdateTimes->getBuffer(bufferId) = t; }
64 bool isSparse()
const {
return mSparseFlag; }
67 return mActiveIndices->getBuffer(level, bufferId * mNumItems);
71 return mActiveIndices->getBuffer(bufferId * mNumItems);
74 void setNumActive(
int bufferId,
long numActive) { *mNumActive->getBuffer(bufferId) = numActive; }
76 long *numActiveBuffer(
int bufferId,
int level) {
return mNumActive->getBuffer(level, bufferId); }
78 long *numActiveBuffer(
int bufferId) {
return mNumActive->getBuffer(bufferId); }
80 void markActiveIndicesOutOfSync(
int bufferId,
int level);
82 void updateActiveIndices(
int bufferId,
int level);
84 int getNumItems()
const {
return mNumItems; }
PVLayerCube createCube(PVLayerLoc const &loc, int delay)