|
|
|
@@ -30,8 +30,8 @@ struct upgrade_val
|
|
|
|
|
typedef typename promote_type<T1,T2>::result T1_result;
|
|
|
|
|
typedef typename promote_type<T1,T2>::result T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr
|
|
|
|
|
static
|
|
|
|
|
constexpr
|
|
|
|
|
typename promote_type<T1,T2>::result
|
|
|
|
|
apply(const T1 x)
|
|
|
|
|
{
|
|
|
|
@@ -39,8 +39,8 @@ struct upgrade_val
|
|
|
|
|
return out_type(x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constexpr
|
|
|
|
|
static
|
|
|
|
|
constexpr
|
|
|
|
|
typename promote_type<T1,T2>::result
|
|
|
|
|
apply(const T2 x)
|
|
|
|
|
{
|
|
|
|
@@ -58,7 +58,7 @@ struct upgrade_val<T,T>
|
|
|
|
|
typedef T T1_result;
|
|
|
|
|
typedef T T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const T& apply(const T& x) { return x; }
|
|
|
|
|
static constexpr const T& apply(const T& x) { return x; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -71,8 +71,8 @@ struct upgrade_val< std::complex<T>, T2 >
|
|
|
|
|
typedef std::complex<T> T1_result;
|
|
|
|
|
typedef T T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<T>& apply(const std::complex<T>& x) { return x; }
|
|
|
|
|
constexpr static T apply(const T2 x) { return T(x); }
|
|
|
|
|
static constexpr const std::complex<T>& apply(const std::complex<T>& x) { return x; }
|
|
|
|
|
static constexpr T apply(const T2 x) { return T(x); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -83,8 +83,8 @@ struct upgrade_val< T1, std::complex<T> >
|
|
|
|
|
typedef T T1_result;
|
|
|
|
|
typedef std::complex<T> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static T apply(const T1 x) { return T(x); }
|
|
|
|
|
constexpr static const std::complex<T>& apply(const std::complex<T>& x) { return x; }
|
|
|
|
|
static constexpr T apply(const T1 x) { return T(x); }
|
|
|
|
|
static constexpr const std::complex<T>& apply(const std::complex<T>& x) { return x; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -95,8 +95,8 @@ struct upgrade_val< std::complex<float>, double >
|
|
|
|
|
typedef std::complex<double> T1_result;
|
|
|
|
|
typedef double T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<double> apply(const std::complex<float>& x) { return std::complex<double>(x); }
|
|
|
|
|
constexpr static double apply(const double x) { return x; }
|
|
|
|
|
static constexpr const std::complex<double> apply(const std::complex<float>& x) { return std::complex<double>(x); }
|
|
|
|
|
static constexpr double apply(const double x) { return x; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -106,8 +106,8 @@ struct upgrade_val< double, std::complex<float> >
|
|
|
|
|
typedef double T1_result;
|
|
|
|
|
typedef std::complex<float> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static double apply(const double x) { return x; }
|
|
|
|
|
constexpr static const std::complex<double> apply(const std::complex<float>& x) { return std::complex<double>(x); }
|
|
|
|
|
static constexpr double apply(const double x) { return x; }
|
|
|
|
|
static constexpr const std::complex<double> apply(const std::complex<float>& x) { return std::complex<double>(x); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -118,8 +118,8 @@ struct upgrade_val< std::complex<float>, std::complex<double> >
|
|
|
|
|
typedef std::complex<double> T1_result;
|
|
|
|
|
typedef std::complex<double> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<double> apply(const std::complex<float>& x) { return std::complex<double>(x); }
|
|
|
|
|
constexpr static const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
static constexpr const std::complex<double> apply(const std::complex<float>& x) { return std::complex<double>(x); }
|
|
|
|
|
static constexpr const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -129,8 +129,8 @@ struct upgrade_val< std::complex<double>, std::complex<float> >
|
|
|
|
|
typedef std::complex<double> T1_result;
|
|
|
|
|
typedef std::complex<double> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
constexpr static const std::complex<double> apply(const std::complex<float>& x) { return std::complex<double>(x); }
|
|
|
|
|
static constexpr const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
static constexpr const std::complex<double> apply(const std::complex<float>& x) { return std::complex<double>(x); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -140,8 +140,8 @@ struct upgrade_val< std::complex<double>, float >
|
|
|
|
|
typedef std::complex<double> T1_result;
|
|
|
|
|
typedef double T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
constexpr static double apply(const float x) { return double(x); }
|
|
|
|
|
static constexpr const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
static constexpr double apply(const float x) { return double(x); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -151,8 +151,8 @@ struct upgrade_val< float, std::complex<double> >
|
|
|
|
|
typedef double T1_result;
|
|
|
|
|
typedef std::complex<double> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static double apply(const float x) { return double(x); }
|
|
|
|
|
constexpr static const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
static constexpr double apply(const float x) { return double(x); }
|
|
|
|
|
static constexpr const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -164,8 +164,8 @@ struct upgrade_val< std::complex<fp16>, std::complex<double> >
|
|
|
|
|
typedef std::complex<double> T1_result;
|
|
|
|
|
typedef std::complex<double> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<double> apply(const std::complex<fp16>& x) { return std::complex<double>(x); }
|
|
|
|
|
constexpr static const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
static constexpr const std::complex<double> apply(const std::complex<fp16>& x) { return std::complex<double>(x); }
|
|
|
|
|
static constexpr const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -175,8 +175,8 @@ struct upgrade_val< std::complex<double>, std::complex<fp16> >
|
|
|
|
|
typedef std::complex<double> T1_result;
|
|
|
|
|
typedef std::complex<double> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
constexpr static const std::complex<double> apply(const std::complex<fp16>& x) { return std::complex<double>(x); }
|
|
|
|
|
static constexpr const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
static constexpr const std::complex<double> apply(const std::complex<fp16>& x) { return std::complex<double>(x); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -186,8 +186,8 @@ struct upgrade_val< std::complex<fp16>, std::complex<float> >
|
|
|
|
|
typedef std::complex<float> T1_result;
|
|
|
|
|
typedef std::complex<float> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<float> apply(const std::complex<fp16>& x) { return std::complex<float>(x); }
|
|
|
|
|
constexpr static const std::complex<float>& apply(const std::complex<float>& x) { return x; }
|
|
|
|
|
static constexpr const std::complex<float> apply(const std::complex<fp16>& x) { return std::complex<float>(x); }
|
|
|
|
|
static constexpr const std::complex<float>& apply(const std::complex<float>& x) { return x; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -197,8 +197,8 @@ struct upgrade_val< std::complex<float>, std::complex<fp16> >
|
|
|
|
|
typedef std::complex<float> T1_result;
|
|
|
|
|
typedef std::complex<float> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<float>& apply(const std::complex<float>& x) { return x; }
|
|
|
|
|
constexpr static const std::complex<float> apply(const std::complex<fp16>& x) { return std::complex<float>(x); }
|
|
|
|
|
static constexpr const std::complex<float>& apply(const std::complex<float>& x) { return x; }
|
|
|
|
|
static constexpr const std::complex<float> apply(const std::complex<fp16>& x) { return std::complex<float>(x); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -208,8 +208,8 @@ struct upgrade_val< std::complex<double>, fp16 >
|
|
|
|
|
typedef std::complex<double> T1_result;
|
|
|
|
|
typedef double T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
constexpr static double apply(const fp16 x) { return double(x); }
|
|
|
|
|
static constexpr const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
static constexpr double apply(const fp16 x) { return double(x); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -219,8 +219,8 @@ struct upgrade_val< fp16, std::complex<double> >
|
|
|
|
|
typedef double T1_result;
|
|
|
|
|
typedef std::complex<double> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static double apply(const fp16 x) { return double(x); }
|
|
|
|
|
constexpr static const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
static constexpr double apply(const fp16 x) { return double(x); }
|
|
|
|
|
static constexpr const std::complex<double>& apply(const std::complex<double>& x) { return x; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -230,8 +230,8 @@ struct upgrade_val< std::complex<float>, fp16 >
|
|
|
|
|
typedef std::complex<float> T1_result;
|
|
|
|
|
typedef float T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static const std::complex<float>& apply(const std::complex<float>& x) { return x; }
|
|
|
|
|
constexpr static float apply(const fp16 x) { return float(x); }
|
|
|
|
|
static constexpr const std::complex<float>& apply(const std::complex<float>& x) { return x; }
|
|
|
|
|
static constexpr float apply(const fp16 x) { return float(x); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -241,8 +241,8 @@ struct upgrade_val< fp16, std::complex<float> >
|
|
|
|
|
typedef float T1_result;
|
|
|
|
|
typedef std::complex<float> T2_result;
|
|
|
|
|
|
|
|
|
|
constexpr static float apply(const fp16 x) { return float(x); }
|
|
|
|
|
constexpr static const std::complex<float>& apply(const std::complex<float>& x) { return x; }
|
|
|
|
|
static constexpr float apply(const fp16 x) { return float(x); }
|
|
|
|
|
static constexpr const std::complex<float>& apply(const std::complex<float>& x) { return x; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|