Commit 947307ba authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #6261 from dtmoodie:issue_6251

parents 77832069 42c36c0c
...@@ -57,7 +57,7 @@ namespace cv { namespace cuda { namespace device ...@@ -57,7 +57,7 @@ namespace cv { namespace cuda { namespace device
struct CV_EXPORTS ThrustAllocator struct CV_EXPORTS ThrustAllocator
{ {
typedef uchar value_type; typedef uchar value_type;
virtual ~ThrustAllocator();
virtual __device__ __host__ uchar* allocate(size_t numBytes) = 0; virtual __device__ __host__ uchar* allocate(size_t numBytes) = 0;
virtual __device__ __host__ void deallocate(uchar* ptr, size_t numBytes) = 0; virtual __device__ __host__ void deallocate(uchar* ptr, size_t numBytes) = 0;
static ThrustAllocator& getAllocator(); static ThrustAllocator& getAllocator();
......
...@@ -56,6 +56,9 @@ using namespace cv; ...@@ -56,6 +56,9 @@ using namespace cv;
using namespace cv::cuda; using namespace cv::cuda;
using namespace cv::cudev; using namespace cv::cudev;
device::ThrustAllocator::~ThrustAllocator()
{
}
namespace namespace
{ {
class DefaultThrustAllocator: public cv::cuda::device::ThrustAllocator class DefaultThrustAllocator: public cv::cuda::device::ThrustAllocator
...@@ -73,6 +76,7 @@ namespace ...@@ -73,6 +76,7 @@ namespace
} }
__device__ __host__ void deallocate(uchar* ptr, size_t numBytes) __device__ __host__ void deallocate(uchar* ptr, size_t numBytes)
{ {
(void)numBytes;
#ifndef __CUDA_ARCH__ #ifndef __CUDA_ARCH__
CV_CUDEV_SAFE_CALL(cudaFree(ptr)); CV_CUDEV_SAFE_CALL(cudaFree(ptr));
#endif #endif
......
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