Skip to content
Snippets Groups Projects
Commit 525c408c authored by Eric Wait's avatar Eric Wait
Browse files

KernelIterator now indicates when it is switching channels and frames

parent 86abbbf0
No related branches found
No related tags found
No related merge requests found
......@@ -50,9 +50,11 @@ __device__ KernelIterator& KernelIterator::operator++()
if(++iterator.dims.z>kernelEndIdx.z)
{
iterator.dims.z = kernelEndIdx.z;
isChannelEnd = true;
if(++iterator.chan>numChans)
{
iterator.chan = 0;
isFrameEnd = true;
if(++iterator.frame>numFrames)
{
iterator.frame = 0;
......
......@@ -10,8 +10,14 @@ public:
__device__ __host__ ~KernelIterator();
__device__ KernelIterator& operator++();
__device__ bool end() { return isEnd; }
__device__ bool end() const { return isEnd; }
__device__ bool channelEnd() const { return isChannelEnd; }
__device__ bool frameEnd() const { return isFrameEnd; }
__device__ void nextChannel() { isChannelEnd = false; }
__device__ void nextFrame() { isFrameEnd = false; }
__device__ void reset();
__device__ Vec<float> getImageCoordinate() const;
__device__ unsigned int getChannel() const;
__device__ unsigned int getFrame() const;
......@@ -38,6 +44,8 @@ private:
// This indicates the current position
ImageDimensions iterator;
bool isChannelEnd;
bool isFrameEnd;
bool isEnd;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment