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

Removed asserts in copy


Signed-off-by: default avatarericwait <ericwait@drexel.edu>
parent a2ff815a
No related branches found
No related tags found
No related merge requests found
......@@ -174,7 +174,17 @@ public:
*/
void copyROI(const CudaImageBuffer<ImagePixelType>& bufferIn, Vec<unsigned int> starts, Vec<unsigned int> sizes)
{
assert(sizes.product()<=bufferSize);
if (sizes.product()>bufferSize)
{
bool wasColumnMajor = isColumnMajor;
int device = this->device;
clean();
isColumnMajor = wasColumnMajor;
this->device = device;
imageDims = bufferIn.getDimension();
deviceSetup();
memoryAllocation();
}
imageDims = sizes;
device = bufferIn.getDevice();
......@@ -185,7 +195,17 @@ public:
void copyImage(const CudaImageBuffer<ImagePixelType>& bufferIn)
{
assert(bufferIn.getDimension().product()<=bufferSize);
if (bufferIn.getDimension().product()>bufferSize)
{
bool wasColumnMajor = isColumnMajor;
int device = this->device;
clean();
isColumnMajor = wasColumnMajor;
this->device = device;
imageDims = bufferIn.getDimension();
deviceSetup();
memoryAllocation();
}
imageDims = bufferIn.getDimension();
device = bufferIn.getDevice();
......
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