diff --git a/gpu/people/src/cuda/nvidia/NCV.cu b/gpu/people/src/cuda/nvidia/NCV.cu index 6c46c59db2c..f43150c6d56 100644 --- a/gpu/people/src/cuda/nvidia/NCV.cu +++ b/gpu/people/src/cuda/nvidia/NCV.cu @@ -529,120 +529,6 @@ size_t NCVMemNativeAllocator::maxSize(void) const } -//=================================================================== -// -// Time and timer routines -// -//=================================================================== - - -typedef struct _NcvTimeMoment NcvTimeMoment; - -#if defined(_WIN32) || defined(_WIN64) - - #include - - typedef struct _NcvTimeMoment - { - LONGLONG moment, freq; - } NcvTimeMoment; - - - static void _ncvQueryMoment(NcvTimeMoment *t) - { - QueryPerformanceFrequency((LARGE_INTEGER *)&(t->freq)); - QueryPerformanceCounter((LARGE_INTEGER *)&(t->moment)); - } - - - double _ncvMomentToMicroseconds(NcvTimeMoment *t) - { - return 1000000.0 * t->moment / t->freq; - } - - - double _ncvMomentsDiffToMicroseconds(NcvTimeMoment *t1, NcvTimeMoment *t2) - { - return 1000000.0 * 2 * ((t2->moment) - (t1->moment)) / (t1->freq + t2->freq); - } - - - double _ncvMomentsDiffToMilliseconds(NcvTimeMoment *t1, NcvTimeMoment *t2) - { - return 1000.0 * 2 * ((t2->moment) - (t1->moment)) / (t1->freq + t2->freq); - } - -#elif defined(__GNUC__) - - #include - - typedef struct _NcvTimeMoment - { - struct timeval tv; - struct timezone tz; - } NcvTimeMoment; - - - void _ncvQueryMoment(NcvTimeMoment *t) - { - gettimeofday(& t->tv, & t->tz); - } - - - double _ncvMomentToMicroseconds(NcvTimeMoment *t) - { - return 1000000.0 * t->tv.tv_sec + (double)t->tv.tv_usec; - } - - - double _ncvMomentsDiffToMicroseconds(NcvTimeMoment *t1, NcvTimeMoment *t2) - { - return (((double)t2->tv.tv_sec - (double)t1->tv.tv_sec) * 1000000 + (double)t2->tv.tv_usec - (double)t1->tv.tv_usec); - } - - double _ncvMomentsDiffToMilliseconds(NcvTimeMoment *t1, NcvTimeMoment *t2) - { - return ((double)t2->tv.tv_sec - (double)t1->tv.tv_sec) * 1000; - } - -#endif //#if defined(_WIN32) || defined(_WIN64) - - -struct _NcvTimer -{ - NcvTimeMoment t1, t2; -}; - - -NcvTimer ncvStartTimer(void) -{ - struct _NcvTimer *t; - t = (struct _NcvTimer *)malloc(sizeof(struct _NcvTimer)); - _ncvQueryMoment(&t->t1); - return t; -} - - -double ncvEndQueryTimerUs(NcvTimer t) -{ - double res; - _ncvQueryMoment(&t->t2); - res = _ncvMomentsDiffToMicroseconds(&t->t1, &t->t2); - free(t); - return res; -} - - -double ncvEndQueryTimerMs(NcvTimer t) -{ - double res; - _ncvQueryMoment(&t->t2); - res = _ncvMomentsDiffToMilliseconds(&t->t1, &t->t2); - free(t); - return res; -} - - //=================================================================== // // Operations with rectangles @@ -650,57 +536,6 @@ double ncvEndQueryTimerMs(NcvTimer t) //=================================================================== -//from OpenCV -//void groupRectangles(std::vector &hypotheses, int groupThreshold, double eps, std::vector *weights); - -/* -NCVStatus ncvGroupRectangles_host(NCVVector &hypotheses, - Ncv32u &numHypotheses, - Ncv32u minNeighbors, - Ncv32f intersectEps, - NCVVector *hypothesesWeights) -{ - ncvAssertReturn(hypotheses.memType() == NCVMemoryTypeHostPageable || - hypotheses.memType() == NCVMemoryTypeHostPinned, NCV_MEM_RESIDENCE_ERROR); - if (hypothesesWeights != NULL) - { - ncvAssertReturn(hypothesesWeights->memType() == NCVMemoryTypeHostPageable || - hypothesesWeights->memType() == NCVMemoryTypeHostPinned, NCV_MEM_RESIDENCE_ERROR); - } - - if (numHypotheses == 0) - { - return NCV_SUCCESS; - } - - std::vector rects(numHypotheses); - memcpy(&rects[0], hypotheses.ptr(), numHypotheses * sizeof(NcvRect32u)); - - std::vector weights; - if (hypothesesWeights != NULL) - { - groupRectangles(rects, minNeighbors, intersectEps, &weights); - } - else - { - groupRectangles(rects, minNeighbors, intersectEps, NULL); - } - - numHypotheses = (Ncv32u)rects.size(); - if (numHypotheses > 0) - { - memcpy(hypotheses.ptr(), &rects[0], numHypotheses * sizeof(NcvRect32u)); - } - - if (hypothesesWeights != NULL) - { - memcpy(hypothesesWeights->ptr(), &weights[0], numHypotheses * sizeof(Ncv32u)); - } - - return NCV_SUCCESS; -} -*/ - template static NCVStatus drawRectsWrapperHost(T *h_dst, Ncv32u dstStride, diff --git a/gpu/people/src/cuda/nvidia/NCV.hpp b/gpu/people/src/cuda/nvidia/NCV.hpp index 3f30391e978..4cc33766b9d 100644 --- a/gpu/people/src/cuda/nvidia/NCV.hpp +++ b/gpu/people/src/cuda/nvidia/NCV.hpp @@ -349,22 +349,6 @@ using NCVStatus = Ncv32u; } -//============================================================================== -// -// Timer -// -//============================================================================== - - -using NcvTimer = struct _NcvTimer *; - -NCV_EXPORTS NcvTimer ncvStartTimer(); - -NCV_EXPORTS double ncvEndQueryTimerUs(NcvTimer t); - -NCV_EXPORTS double ncvEndQueryTimerMs(NcvTimer t); - - //============================================================================== // // Memory management classes template compound types