Commit 7a934f9e authored by Dan's avatar Dan Committed by Dan

Compatibility and bug fixes.

parent a8ca5606
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <thrust/device_ptr.h> #include <thrust/device_ptr.h>
#include <thrust/sort.h> #include <thrust/sort.h>
#include <thrust/system/cuda/execution_policy.h> #include <thrust/system/cuda/execution_policy.h>
#include <thrust/version.h>
#include "opencv2/core/cuda/common.hpp" #include "opencv2/core/cuda/common.hpp"
...@@ -62,6 +63,7 @@ namespace cv { namespace cuda { namespace device ...@@ -62,6 +63,7 @@ namespace cv { namespace cuda { namespace device
{ {
thrust::device_ptr<int> loc_ptr(loc); thrust::device_ptr<int> loc_ptr(loc);
thrust::device_ptr<float> response_ptr(response); thrust::device_ptr<float> response_ptr(response);
#if THRUST_VERSION >= 100800
if(stream) if(stream)
{ {
thrust::sort_by_key(thrust::cuda::par.on(stream), response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>()); thrust::sort_by_key(thrust::cuda::par.on(stream), response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>());
...@@ -69,6 +71,9 @@ namespace cv { namespace cuda { namespace device ...@@ -69,6 +71,9 @@ namespace cv { namespace cuda { namespace device
{ {
thrust::sort_by_key(response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>()); thrust::sort_by_key(response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>());
} }
#else
thrust::sort_by_key(response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>());
#endif
return n_points; return n_points;
} }
......
...@@ -652,7 +652,7 @@ namespace ...@@ -652,7 +652,7 @@ namespace
Rect inner(edgeThreshold_, edgeThreshold_, sz.width - 2 * edgeThreshold_, sz.height - 2 * edgeThreshold_); Rect inner(edgeThreshold_, edgeThreshold_, sz.width - 2 * edgeThreshold_, sz.height - 2 * edgeThreshold_);
buf_(inner).setTo(Scalar::all(255), stream); buf_(inner).setTo(Scalar::all(255), stream);
cuda::bitwise_and(maskPyr_[level], buf_, maskPyr_[level], stream); cuda::bitwise_and(maskPyr_[level], buf_, maskPyr_[level], cv::noArray(), stream);
} }
} }
......
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