From 9aa5ab75570cf53a63c4362adb580af829557ede Mon Sep 17 00:00:00 2001 From: cudawarped <12133430+cudawarped@users.noreply.github.com> Date: Thu, 15 Dec 2022 08:55:31 +0200 Subject: [PATCH] cv::cuda: Replace all instances of texture references/objects with texture objects using the existing updated cv::cudev::Texture class. Fixes bugs in cv::cuda::demosaicing, cv::cuda::resize and cv::cuda::HoughSegmentDetector. --- modules/core/include/opencv2/core/cuda/common.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/core/include/opencv2/core/cuda/common.hpp b/modules/core/include/opencv2/core/cuda/common.hpp index b36b3d17b5..348bdf1823 100644 --- a/modules/core/include/opencv2/core/cuda/common.hpp +++ b/modules/core/include/opencv2/core/cuda/common.hpp @@ -98,6 +98,12 @@ namespace cv { namespace cuda return (total + grain - 1) / grain; } +#if (CUDART_VERSION >= 12000) + template inline void bindTexture(const textureReference* tex, const PtrStepSz& img) { CV_Error(cv::Error::GpuNotSupported, "Function removed in CUDA SDK 12"); } + template inline void createTextureObjectPitch2D(cudaTextureObject_t* tex, PtrStepSz& img, const cudaTextureDesc& texDesc) { + CV_Error(cv::Error::GpuNotSupported, "Function removed in CUDA SDK 12"); } +#else + //TODO: remove from OpenCV 5.x template inline void bindTexture(const textureReference* tex, const PtrStepSz& img) { cudaChannelFormatDesc desc = cudaCreateChannelDesc(); @@ -118,6 +124,7 @@ namespace cv { namespace cuda cudaSafeCall( cudaCreateTextureObject(tex, &resDesc, &texDesc, NULL) ); } } +#endif }} //! @endcond -- 2.34.1