 #include "opencv2/gpu/device/saturate_cast.hpp"
 #include "opencv2/gpu/device/transform.hpp"
 #include "opencv2/gpu/device/functional.hpp"
+#include "opencv2/gpu/device/type_traits.hpp"
 
 namespace cv { namespace gpu { namespace device
 {

    void writeScalar(const int*);
    void writeScalar(const float*);
    void writeScalar(const double*);
    void convert_gpu(PtrStepSzb, int, PtrStepSzb, int, double, double, cudaStream_t);
}}}


    {
        typedef void (*caller_t)(PtrStepSzb src, PtrStepSzb dst, double alpha, double beta, cudaStream_t stream);

        static const caller_t tab[7][7] =
        {
            {
                cvt_<uchar, uchar, float>,
                cvt_<uchar, schar, float>,
                cvt_<uchar, ushort, float>,
                cvt_<uchar, short, float>,
                cvt_<uchar, int, float>,
                cvt_<uchar, float, float>,
                cvt_<uchar, double, double>
            },
            {
                cvt_<schar, uchar, float>,
                cvt_<schar, schar, float>,
                cvt_<schar, ushort, float>,
                cvt_<schar, short, float>,
                cvt_<schar, int, float>,
                cvt_<schar, float, float>,
                cvt_<schar, double, double>
            },
            {
                cvt_<ushort, uchar, float>,
                cvt_<ushort, schar, float>,
                cvt_<ushort, ushort, float>,
                cvt_<ushort, short, float>,
                cvt_<ushort, int, float>,
                cvt_<ushort, float, float>,
                cvt_<ushort, double, double>
            },
            {
                cvt_<short, uchar, float>,
                cvt_<short, schar, float>,
                cvt_<short, ushort, float>,
                cvt_<short, short, float>,
                cvt_<short, int, float>,
                cvt_<short, float, float>,
                cvt_<short, double, double>
            },
            {
                cvt_<int, uchar, float>,
                cvt_<int, schar, float>,
                cvt_<int, ushort, float>,
                cvt_<int, short, float>,
                cvt_<int, int, double>,
                cvt_<int, float, double>,
                cvt_<int, double, double>
            },
            {
                cvt_<float, uchar, float>,
                cvt_<float, schar, float>,
                cvt_<float, ushort, float>,
                cvt_<float, short, float>,
                cvt_<float, int, float>,
                cvt_<float, float, float>,
                cvt_<float, double, double>
            },
            {
                cvt_<double, uchar, double>,
                cvt_<double, schar, double>,
                cvt_<double, ushort, double>,
                cvt_<double, short, double>,
                cvt_<double, int, double>,
                cvt_<double, float, double>,
                cvt_<double, double, double>
            }
        };

        caller_t func = tab[sdepth][ddepth];
        func(src, dst, alpha, beta, stream);
    }

