From 09eb618804588f77026924096d848800630c8d6f Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 3 Sep 2024 13:47:48 +0300 Subject: [PATCH] Workaround for CUDA 12.6 tuple_size issue #3773. --- modules/cudaarithm/src/cuda/polar_cart.cu | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/modules/cudaarithm/src/cuda/polar_cart.cu b/modules/cudaarithm/src/cuda/polar_cart.cu index 725f5741d81..c65b894bf60 100644 --- a/modules/cudaarithm/src/cuda/polar_cart.cu +++ b/modules/cudaarithm/src/cuda/polar_cart.cu @@ -159,25 +159,15 @@ void cv::cuda::cartToPolar(InputArray _xy, OutputArray _mag, OutputArray _angle, GpuMat_ magc(mag); GpuMat_ anglec(angle); + gridTransformUnary(globPtr(xy), globPtr(magc), magnitude_interleaved_func(), stream); + if (angleInDegrees) { - auto f1 = magnitude_interleaved_func(); - auto f2 = direction_interleaved_func(); - cv::cudev::tuple f12 = cv::cudev::make_tuple(f1, f2); - gridTransformTuple(globPtr(xy), - tie(magc, anglec), - f12, - stream); + gridTransformUnary(globPtr(xy), globPtr(anglec), direction_interleaved_func(), stream); } else { - auto f1 = magnitude_interleaved_func(); - auto f2 = direction_interleaved_func(); - cv::cudev::tuple f12 = cv::cudev::make_tuple(f1, f2); - gridTransformTuple(globPtr(xy), - tie(magc, anglec), - f12, - stream); + gridTransformUnary(globPtr(xy), globPtr(anglec), direction_interleaved_func(), stream); } syncOutput(mag, _mag, stream); @@ -191,7 +181,7 @@ void cv::cuda::cartToPolar(InputArray _xy, OutputArray _magAngle, bool angleInDe CV_Assert( xy.type() == CV_32FC2 ); GpuMat magAngle = getOutputMat(_magAngle, xy.size(), CV_32FC2, stream); - + if (angleInDegrees) { gridTransformUnary(globPtr(xy),