43 #ifndef OPENCV_CUDA_LIMITS_HPP
44 #define OPENCV_CUDA_LIMITS_HPP
56 namespace cv {
namespace cuda {
namespace device
58 template <
class T>
struct numeric_limits;
60 template <>
struct numeric_limits<bool>
62 __device__ __forceinline__
static bool min() {
return false; }
63 __device__ __forceinline__
static bool max() {
return true; }
64 static const bool is_signed =
false;
67 template <>
struct numeric_limits<signed char>
69 __device__ __forceinline__
static signed char min() {
return SCHAR_MIN; }
70 __device__ __forceinline__
static signed char max() {
return SCHAR_MAX; }
71 static const bool is_signed =
true;
74 template <>
struct numeric_limits<unsigned char>
76 __device__ __forceinline__
static unsigned char min() {
return 0; }
77 __device__ __forceinline__
static unsigned char max() {
return UCHAR_MAX; }
78 static const bool is_signed =
false;
81 template <>
struct numeric_limits<short>
83 __device__ __forceinline__
static short min() {
return SHRT_MIN; }
84 __device__ __forceinline__
static short max() {
return SHRT_MAX; }
85 static const bool is_signed =
true;
88 template <>
struct numeric_limits<unsigned short>
90 __device__ __forceinline__
static unsigned short min() {
return 0; }
91 __device__ __forceinline__
static unsigned short max() {
return USHRT_MAX; }
92 static const bool is_signed =
false;
95 template <>
struct numeric_limits<int>
97 __device__ __forceinline__
static int min() {
return INT_MIN; }
98 __device__ __forceinline__
static int max() {
return INT_MAX; }
99 static const bool is_signed =
true;
102 template <>
struct numeric_limits<unsigned int>
104 __device__ __forceinline__
static unsigned int min() {
return 0; }
105 __device__ __forceinline__
static unsigned int max() {
return UINT_MAX; }
106 static const bool is_signed =
false;
109 template <>
struct numeric_limits<float>
111 __device__ __forceinline__
static float min() {
return FLT_MIN; }
112 __device__ __forceinline__
static float max() {
return FLT_MAX; }
113 __device__ __forceinline__
static float epsilon() {
return FLT_EPSILON; }
114 static const bool is_signed =
true;
117 template <>
struct numeric_limits<double>
119 __device__ __forceinline__
static double min() {
return DBL_MIN; }
120 __device__ __forceinline__
static double max() {
return DBL_MAX; }
121 __device__ __forceinline__
static double epsilon() {
return DBL_EPSILON; }
122 static const bool is_signed =
true;
softfloat max(const softfloat &a, const softfloat &b)
Definition: softfloat.hpp:440
softfloat min(const softfloat &a, const softfloat &b)
Min and Max functions.
Definition: softfloat.hpp:437
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441