diff --git a/modules/core/include/opencv2/core/cuda/utility.hpp b/modules/core/include/opencv2/core/cuda/utility.hpp index b93503737e..5215a61d4c 100644 --- a/modules/core/include/opencv2/core/cuda/utility.hpp +++ b/modules/core/include/opencv2/core/cuda/utility.hpp @@ -57,7 +57,7 @@ namespace cv { namespace cuda { namespace device struct CV_EXPORTS ThrustAllocator { typedef uchar value_type; - + virtual ~ThrustAllocator(); virtual __device__ __host__ uchar* allocate(size_t numBytes) = 0; virtual __device__ __host__ void deallocate(uchar* ptr, size_t numBytes) = 0; static ThrustAllocator& getAllocator(); diff --git a/modules/core/src/cuda/gpu_mat.cu b/modules/core/src/cuda/gpu_mat.cu index e5a8facef3..a558349703 100644 --- a/modules/core/src/cuda/gpu_mat.cu +++ b/modules/core/src/cuda/gpu_mat.cu @@ -56,6 +56,9 @@ using namespace cv; using namespace cv::cuda; using namespace cv::cudev; +device::ThrustAllocator::~ThrustAllocator() +{ +} namespace { class DefaultThrustAllocator: public cv::cuda::device::ThrustAllocator @@ -73,6 +76,7 @@ namespace } __device__ __host__ void deallocate(uchar* ptr, size_t numBytes) { + (void)numBytes; #ifndef __CUDA_ARCH__ CV_CUDEV_SAFE_CALL(cudaFree(ptr)); #endif