mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Thrust allocator usage.
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
#include "opencv2/core/cuda/common.hpp"
|
||||
#include "opencv2/core/cuda/reduce.hpp"
|
||||
#include "opencv2/core/cuda/functional.hpp"
|
||||
|
||||
#include "opencv2/core/cuda/utility.hpp"
|
||||
namespace cv { namespace cuda { namespace device
|
||||
{
|
||||
namespace orb
|
||||
@@ -64,6 +64,16 @@ namespace cv { namespace cuda { namespace device
|
||||
thrust::device_ptr<int> loc_ptr(loc);
|
||||
thrust::device_ptr<float> response_ptr(response);
|
||||
#if THRUST_VERSION >= 100800
|
||||
#if THRUST_VERSION >= 100802
|
||||
if (stream)
|
||||
{
|
||||
thrust::sort_by_key(thrust::cuda::par(ThrustAllocator::getAllocator()).on(stream), response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>());
|
||||
}
|
||||
else
|
||||
{
|
||||
thrust::sort_by_key(thrust::cuda::par(ThrustAllocator::getAllocator()), response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>());
|
||||
}
|
||||
#else
|
||||
if(stream)
|
||||
{
|
||||
thrust::sort_by_key(thrust::cuda::par.on(stream), response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>());
|
||||
@@ -71,6 +81,7 @@ namespace cv { namespace cuda { namespace device
|
||||
{
|
||||
thrust::sort_by_key(response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>());
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
thrust::sort_by_key(response_ptr, response_ptr + size, loc_ptr, thrust::greater<float>());
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user