optflow gpu compilation fix under vs2010

This commit is contained in:
Anatoly Baksheev 2011-10-04 17:37:05 +00:00
parent f366553a80
commit f444f9b43e
2 changed files with 5 additions and 4 deletions

View File

@ -62,7 +62,7 @@
#include "NPP_staging/NPP_staging.hpp"
#include "NCVBroxOpticalFlow.hpp"
#include "opencv2/gpu/device/utility.hpp"
////////////////////////////////////////////
@ -131,6 +131,7 @@ template<typename _Tp> inline shared_ptr<_Tp>& shared_ptr<_Tp>::operator = (cons
return *this;
}
////////////////////////////////////////////
//using std::tr1::shared_ptr;
@ -1181,8 +1182,8 @@ NCVStatus NCVBroxOpticalFlow(const NCVBroxOpticalFlowDescriptor desc,
ScaleVector(ptrVNew->ptr(), ptrVNew->ptr(), 1.0f/scale_factor, ns * nh, stream);
}
std::swap<FloatVector*>(ptrU, ptrUNew);
std::swap<FloatVector*>(ptrV, ptrVNew);
cv::gpu::device::swap<FloatVector*>(ptrU, ptrUNew);
cv::gpu::device::swap<FloatVector*>(ptrV, ptrVNew);
}
scale /= scale_factor;
}

View File

@ -58,7 +58,7 @@ namespace cv { namespace gpu { namespace device
///////////////////////////////////////////////////////////////////////////////
// swap
template <typename T> void __device__ __forceinline__ swap(T& a, T& b)
template <typename T> void __device__ __host__ __forceinline__ swap(T& a, T& b)
{
const T temp = a;
a = b;