Commit c17bd8c1 authored by Marina Kolpakova's avatar Marina Kolpakova

fixed "shadow" warnings in nvidia folder

parent f33d9022
...@@ -1622,16 +1622,16 @@ NCVStatus ncvDetectObjectsMultiScale_device(NCVMatrix<Ncv8u> &d_srcImg, ...@@ -1622,16 +1622,16 @@ NCVStatus ncvDetectObjectsMultiScale_device(NCVMatrix<Ncv8u> &d_srcImg,
continue; continue;
} }
NcvSize32s srcRoi, srcIIRoi, scaledIIRoi, searchRoi; NcvSize32s srcRoi_, srcIIRo_i, scaledIIRoi, searchRoi;
srcRoi.width = d_srcImg.width(); srcRoi_.width = d_srcImg.width();
srcRoi.height = d_srcImg.height(); srcRoi_.height = d_srcImg.height();
srcIIRoi.width = srcRoi.width + 1; srcIIRo_i.width = srcRoi_.width + 1;
srcIIRoi.height = srcRoi.height + 1; srcIIRo_i.height = srcRoi_.height + 1;
scaledIIRoi.width = srcIIRoi.width / scale; scaledIIRoi.width = srcIIRo_i.width / scale;
scaledIIRoi.height = srcIIRoi.height / scale; scaledIIRoi.height = srcIIRo_i.height / scale;
searchRoi.width = scaledIIRoi.width - haar.ClassifierSize.width; searchRoi.width = scaledIIRoi.width - haar.ClassifierSize.width;
searchRoi.height = scaledIIRoi.height - haar.ClassifierSize.height; searchRoi.height = scaledIIRoi.height - haar.ClassifierSize.height;
...@@ -1659,12 +1659,12 @@ NCVStatus ncvDetectObjectsMultiScale_device(NCVMatrix<Ncv8u> &d_srcImg, ...@@ -1659,12 +1659,12 @@ NCVStatus ncvDetectObjectsMultiScale_device(NCVMatrix<Ncv8u> &d_srcImg,
{ {
Ncv32u scale = scalesVector[i]; Ncv32u scale = scalesVector[i];
NcvSize32u srcRoi, scaledIIRoi, searchRoi; NcvSize32u srcRoi_, scaledIIRoi, searchRoi;
NcvSize32u srcIIRoi; NcvSize32u srcIIRoi;
srcRoi.width = d_srcImg.width(); srcRoi_.width = d_srcImg.width();
srcRoi.height = d_srcImg.height(); srcRoi_.height = d_srcImg.height();
srcIIRoi.width = srcRoi.width + 1; srcIIRoi.width = srcRoi_.width + 1;
srcIIRoi.height = srcRoi.height + 1; srcIIRoi.height = srcRoi_.height + 1;
scaledIIRoi.width = srcIIRoi.width / scale; scaledIIRoi.width = srcIIRoi.width / scale;
scaledIIRoi.height = srcIIRoi.height / scale; scaledIIRoi.height = srcIIRoi.height / scale;
searchRoi.width = scaledIIRoi.width - haar.ClassifierSize.width; searchRoi.width = scaledIIRoi.width - haar.ClassifierSize.width;
......
...@@ -1414,17 +1414,17 @@ NCVStatus compactVector_32u_device(Ncv32u *d_src, Ncv32u srcLen, ...@@ -1414,17 +1414,17 @@ NCVStatus compactVector_32u_device(Ncv32u *d_src, Ncv32u srcLen,
//calculate hierarchical partial sums //calculate hierarchical partial sums
for (Ncv32u i=1; i<partSumNums.size()-1; i++) for (Ncv32u i=1; i<partSumNums.size()-1; i++)
{ {
dim3 grid(partSumNums[i+1]); dim3 grid_partial(partSumNums[i+1]);
if (grid.x > 65535) if (grid_partial.x > 65535)
{ {
grid.y = (grid.x + 65534) / 65535; grid_partial.y = (grid_partial.x + 65534) / 65535;
grid.x = 65535; grid_partial.x = 65535;
} }
if (grid.x != 1) if (grid_partial.x != 1)
{ {
removePass1Scan removePass1Scan
<false, true> <false, true>
<<<grid, block, 0, nppStGetActiveCUDAstream()>>> <<<grid_partial, block, 0, nppStGetActiveCUDAstream()>>>
(d_hierSums.ptr() + partSumOffsets[i], (d_hierSums.ptr() + partSumOffsets[i],
partSumNums[i], NULL, partSumNums[i], NULL,
d_hierSums.ptr() + partSumOffsets[i+1], d_hierSums.ptr() + partSumOffsets[i+1],
...@@ -1434,7 +1434,7 @@ NCVStatus compactVector_32u_device(Ncv32u *d_src, Ncv32u srcLen, ...@@ -1434,7 +1434,7 @@ NCVStatus compactVector_32u_device(Ncv32u *d_src, Ncv32u srcLen,
{ {
removePass1Scan removePass1Scan
<false, false> <false, false>
<<<grid, block, 0, nppStGetActiveCUDAstream()>>> <<<grid_partial, block, 0, nppStGetActiveCUDAstream()>>>
(d_hierSums.ptr() + partSumOffsets[i], (d_hierSums.ptr() + partSumOffsets[i],
partSumNums[i], NULL, partSumNums[i], NULL,
NULL, NULL,
......
...@@ -723,16 +723,16 @@ static NCVStatus drawRectsWrapperHost(T *h_dst, ...@@ -723,16 +723,16 @@ static NCVStatus drawRectsWrapperHost(T *h_dst,
if (rect.x < dstWidth) if (rect.x < dstWidth)
{ {
for (Ncv32u i=rect.y; i<rect.y+rect.height && i<dstHeight; i++) for (Ncv32u each=rect.y; each<rect.y+rect.height && each<dstHeight; each++)
{ {
h_dst[i*dstStride+rect.x] = color; h_dst[each*dstStride+rect.x] = color;
} }
} }
if (rect.x+rect.width-1 < dstWidth) if (rect.x+rect.width-1 < dstWidth)
{ {
for (Ncv32u i=rect.y; i<rect.y+rect.height && i<dstHeight; i++) for (Ncv32u each=rect.y; each<rect.y+rect.height && each<dstHeight; each++)
{ {
h_dst[i*dstStride+rect.x+rect.width-1] = color; h_dst[each*dstStride+rect.x+rect.width-1] = color;
} }
} }
if (rect.y < dstHeight) if (rect.y < dstHeight)
......
...@@ -623,11 +623,11 @@ class NCVVectorAlloc : public NCVVector<T> ...@@ -623,11 +623,11 @@ class NCVVectorAlloc : public NCVVector<T>
{ {
NCVVectorAlloc(); NCVVectorAlloc();
NCVVectorAlloc(const NCVVectorAlloc &); NCVVectorAlloc(const NCVVectorAlloc &);
NCVVectorAlloc& operator=(const NCVVectorAlloc<T>&); NCVVectorAlloc& operator=(const NCVVectorAlloc<T>&);
public: public:
NCVVectorAlloc(INCVMemAllocator &allocator_, Ncv32u length) NCVVectorAlloc(INCVMemAllocator &allocator_, Ncv32u length_)
: :
allocator(allocator_) allocator(allocator_)
{ {
...@@ -636,11 +636,11 @@ public: ...@@ -636,11 +636,11 @@ public:
this->clear(); this->clear();
this->allocatedMem.clear(); this->allocatedMem.clear();
ncvStat = allocator.alloc(this->allocatedMem, length * sizeof(T)); ncvStat = allocator.alloc(this->allocatedMem, length_ * sizeof(T));
ncvAssertPrintReturn(ncvStat == NCV_SUCCESS, "NCVVectorAlloc ctor:: alloc failed", ); ncvAssertPrintReturn(ncvStat == NCV_SUCCESS, "NCVVectorAlloc ctor:: alloc failed", );
this->_ptr = (T *)this->allocatedMem.begin.ptr; this->_ptr = (T *)this->allocatedMem.begin.ptr;
this->_length = length; this->_length = length_;
this->_memtype = this->allocatedMem.begin.memtype; this->_memtype = this->allocatedMem.begin.memtype;
} }
...@@ -698,15 +698,15 @@ public: ...@@ -698,15 +698,15 @@ public:
this->bReused = true; this->bReused = true;
} }
NCVVectorReuse(const NCVMemSegment &memSegment, Ncv32u length) NCVVectorReuse(const NCVMemSegment &memSegment, Ncv32u length_)
{ {
this->bReused = false; this->bReused = false;
this->clear(); this->clear();
ncvAssertPrintReturn(length * sizeof(T) <= memSegment.size, \ ncvAssertPrintReturn(length_ * sizeof(T) <= memSegment.size, \
"NCVVectorReuse ctor:: memory binding failed due to size mismatch", ); "NCVVectorReuse ctor:: memory binding failed due to size mismatch", );
this->_length = length; this->_length = length_;
this->_ptr = (T *)memSegment.begin.ptr; this->_ptr = (T *)memSegment.begin.ptr;
this->_memtype = memSegment.begin.memtype; this->_memtype = memSegment.begin.memtype;
...@@ -841,34 +841,34 @@ class NCVMatrixAlloc : public NCVMatrix<T> ...@@ -841,34 +841,34 @@ class NCVMatrixAlloc : public NCVMatrix<T>
NCVMatrixAlloc& operator=(const NCVMatrixAlloc &); NCVMatrixAlloc& operator=(const NCVMatrixAlloc &);
public: public:
NCVMatrixAlloc(INCVMemAllocator &allocator, Ncv32u width, Ncv32u height, Ncv32u _pitch=0) NCVMatrixAlloc(INCVMemAllocator &allocator_, Ncv32u width_, Ncv32u height_, Ncv32u pitch_=0)
: :
allocator(allocator) allocator(allocator_)
{ {
NCVStatus ncvStat; NCVStatus ncvStat;
this->clear(); this->clear();
this->allocatedMem.clear(); this->allocatedMem.clear();
Ncv32u widthBytes = width * sizeof(T); Ncv32u widthBytes = width_ * sizeof(T);
Ncv32u pitchBytes = alignUp(widthBytes, allocator.alignment()); Ncv32u pitchBytes = alignUp(widthBytes, allocator.alignment());
if (_pitch != 0) if (pitch_ != 0)
{ {
ncvAssertPrintReturn(_pitch >= pitchBytes && ncvAssertPrintReturn(pitch_ >= pitchBytes &&
(_pitch & (allocator.alignment() - 1)) == 0, (pitch_ & (allocator.alignment() - 1)) == 0,
"NCVMatrixAlloc ctor:: incorrect pitch passed", ); "NCVMatrixAlloc ctor:: incorrect pitch passed", );
pitchBytes = _pitch; pitchBytes = pitch_;
} }
Ncv32u requiredAllocSize = pitchBytes * height; Ncv32u requiredAllocSize = pitchBytes * height_;
ncvStat = allocator.alloc(this->allocatedMem, requiredAllocSize); ncvStat = allocator.alloc(this->allocatedMem, requiredAllocSize);
ncvAssertPrintReturn(ncvStat == NCV_SUCCESS, "NCVMatrixAlloc ctor:: alloc failed", ); ncvAssertPrintReturn(ncvStat == NCV_SUCCESS, "NCVMatrixAlloc ctor:: alloc failed", );
this->_ptr = (T *)this->allocatedMem.begin.ptr; this->_ptr = (T *)this->allocatedMem.begin.ptr;
this->_width = width; this->_width = width_;
this->_height = height; this->_height = height_;
this->_pitch = pitchBytes; this->_pitch = pitchBytes;
this->_memtype = this->allocatedMem.begin.memtype; this->_memtype = this->allocatedMem.begin.memtype;
} }
...@@ -916,34 +916,34 @@ class NCVMatrixReuse : public NCVMatrix<T> ...@@ -916,34 +916,34 @@ class NCVMatrixReuse : public NCVMatrix<T>
public: public:
NCVMatrixReuse(const NCVMemSegment &memSegment, Ncv32u alignment, Ncv32u width, Ncv32u height, Ncv32u pitch=0, NcvBool bSkipPitchCheck=false) NCVMatrixReuse(const NCVMemSegment &memSegment, Ncv32u alignment, Ncv32u width_, Ncv32u height_, Ncv32u pitch_=0, NcvBool bSkipPitchCheck=false)
{ {
this->bReused = false; this->bReused = false;
this->clear(); this->clear();
Ncv32u widthBytes = width * sizeof(T); Ncv32u widthBytes = width_ * sizeof(T);
Ncv32u pitchBytes = alignUp(widthBytes, alignment); Ncv32u pitchBytes = alignUp(widthBytes, alignment);
if (pitch != 0) if (pitch_ != 0)
{ {
if (!bSkipPitchCheck) if (!bSkipPitchCheck)
{ {
ncvAssertPrintReturn(pitch >= pitchBytes && ncvAssertPrintReturn(pitch_ >= pitchBytes &&
(pitch & (alignment - 1)) == 0, (pitch_ & (alignment - 1)) == 0,
"NCVMatrixReuse ctor:: incorrect pitch passed", ); "NCVMatrixReuse ctor:: incorrect pitch passed", );
} }
else else
{ {
ncvAssertPrintReturn(pitch >= widthBytes, "NCVMatrixReuse ctor:: incorrect pitch passed", ); ncvAssertPrintReturn(pitch_ >= widthBytes, "NCVMatrixReuse ctor:: incorrect pitch passed", );
} }
pitchBytes = pitch; pitchBytes = pitch_;
} }
ncvAssertPrintReturn(pitchBytes * height <= memSegment.size, \ ncvAssertPrintReturn(pitchBytes * height_ <= memSegment.size, \
"NCVMatrixReuse ctor:: memory binding failed due to size mismatch", ); "NCVMatrixReuse ctor:: memory binding failed due to size mismatch", );
this->_width = width; this->_width = width_;
this->_height = height; this->_height = height_;
this->_pitch = pitchBytes; this->_pitch = pitchBytes;
this->_ptr = (T *)memSegment.begin.ptr; this->_ptr = (T *)memSegment.begin.ptr;
this->_memtype = memSegment.begin.memtype; this->_memtype = memSegment.begin.memtype;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment