Skip to content

Commit 0377a6a

Browse files
authored
Merge pull request #3785 from asmorkalov:as/cartToPolar_no_tuple
Workaround for CUDA 12.6 tuple_size issue #3773.
2 parents 6c47c00 + 09eb618 commit 0377a6a

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

modules/cudaarithm/src/cuda/polar_cart.cu

+5-15
Original file line numberDiff line numberDiff line change
@@ -159,25 +159,15 @@ void cv::cuda::cartToPolar(InputArray _xy, OutputArray _mag, OutputArray _angle,
159159
GpuMat_<float> magc(mag);
160160
GpuMat_<float> anglec(angle);
161161

162+
gridTransformUnary(globPtr<float2>(xy), globPtr<float>(magc), magnitude_interleaved_func<float2>(), stream);
163+
162164
if (angleInDegrees)
163165
{
164-
auto f1 = magnitude_interleaved_func<float2>();
165-
auto f2 = direction_interleaved_func<float2, true>();
166-
cv::cudev::tuple<decltype(f1), decltype(f2)> f12 = cv::cudev::make_tuple(f1, f2);
167-
gridTransformTuple(globPtr<float2>(xy),
168-
tie(magc, anglec),
169-
f12,
170-
stream);
166+
gridTransformUnary(globPtr<float2>(xy), globPtr<float>(anglec), direction_interleaved_func<float2, true>(), stream);
171167
}
172168
else
173169
{
174-
auto f1 = magnitude_interleaved_func<float2>();
175-
auto f2 = direction_interleaved_func<float2, false>();
176-
cv::cudev::tuple<decltype(f1), decltype(f2)> f12 = cv::cudev::make_tuple(f1, f2);
177-
gridTransformTuple(globPtr<float2>(xy),
178-
tie(magc, anglec),
179-
f12,
180-
stream);
170+
gridTransformUnary(globPtr<float2>(xy), globPtr<float>(anglec), direction_interleaved_func<float2, false>(), stream);
181171
}
182172

183173
syncOutput(mag, _mag, stream);
@@ -191,7 +181,7 @@ void cv::cuda::cartToPolar(InputArray _xy, OutputArray _magAngle, bool angleInDe
191181
CV_Assert( xy.type() == CV_32FC2 );
192182

193183
GpuMat magAngle = getOutputMat(_magAngle, xy.size(), CV_32FC2, stream);
194-
184+
195185
if (angleInDegrees)
196186
{
197187
gridTransformUnary(globPtr<float2>(xy),

0 commit comments

Comments
 (0)