Skip to content

Commit

Permalink
BufferPool is used for temporary buffer, use mat create directly
Browse files Browse the repository at this point in the history
  • Loading branch information
wykvictor committed Dec 29, 2016
1 parent 5fad2a3 commit c6f666a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions modules/cudafilters/src/filtering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1100,13 +1100,9 @@ namespace

// Note - these are hardcoded in the actual GPU kernel. Do not change these values.
int histSize=256, histCoarseSize=8;
int devHistCols = src.cols*histSize*partitions, devCoarseHistCols = src.cols*histCoarseSize*partitions;
if(devHist.empty() || devCoarseHist.empty() || devHist.cols != devHistCols || devCoarseHist.cols != devCoarseHistCols)
{
BufferPool pool(_stream);
devHist = pool.getBuffer(1, devHistCols, CV_32SC1);
devCoarseHist = pool.getBuffer(1, devCoarseHistCols, CV_32SC1);
}

devHist.create(1, src.cols*histSize*partitions, CV_32SC1);
devCoarseHist.create(1, src.cols*histCoarseSize*partitions, CV_32SC1);

devHist.setTo(0, _stream);
devCoarseHist.setTo(0, _stream);
Expand Down

0 comments on commit c6f666a

Please sign in to comment.