1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

cuda: add compatibility layer for depreciated vector types

This commit is contained in:
cudawarped
2025-08-23 09:24:05 +03:00
parent d9556920dc
commit ca35ed2f1c
5 changed files with 54 additions and 4 deletions
@@ -0,0 +1,38 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_CUDA_CUDA_COMPAT_HPP
#define OPENCV_CUDA_CUDA_COMPAT_HPP
#include <cuda.h>
namespace cv { namespace cuda { namespace device { namespace compat
{
#if CUDA_VERSION >= 13000
using ulonglong4 = ::ulonglong4_16a;
using double4 = ::double4_16a;
__host__ __device__ __forceinline__
double4 make_double4(double x, double y, double z, double w)
{
return ::make_double4_16a(x, y, z, w);
}
#else
using ulonglong4 = ::ulonglong4;
using double4 = ::double4;
__host__ __device__ __forceinline__
double4 make_double4(double x, double y, double z, double w)
{
return ::make_double4(x, y, z, w);
}
#endif
using ulonglong4Compat = ulonglong4;
using double4Compat = double4;
__host__ __device__ __forceinline__
double4Compat make_double4_compat(double x, double y, double z, double w)
{
return make_double4(x, y, z, w);
}
}}}}
#endif // OPENCV_CUDA_CUDA_COMPAT_HPP
@@ -45,6 +45,7 @@
#include "vec_traits.hpp"
#include "saturate_cast.hpp"
#include "cuda_compat.hpp"
/** @file
* @deprecated Use @ref cudev instead.
@@ -54,6 +55,8 @@
namespace cv { namespace cuda { namespace device
{
using cv::cuda::device::compat::double4;
using cv::cuda::device::compat::make_double4;
// saturate_cast
@@ -44,6 +44,7 @@
#define OPENCV_CUDA_VEC_TRAITS_HPP
#include "common.hpp"
#include "cuda_compat.hpp"
/** @file
* @deprecated Use @ref cudev instead.
@@ -53,6 +54,9 @@
namespace cv { namespace cuda { namespace device
{
using cv::cuda::device::compat::double4;
using cv::cuda::device::compat::make_double4;
template<typename T, int N> struct TypeVec;
struct __align__(8) uchar8