HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CE_Precision.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CE_Precision.h (VEX Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __CE_Precision__
12 #define __CE_Precision__
13 
14 enum class CE_Precision
15 {
16  CE_16,
17  CE_32,
18  CE_64,
19 };
23 
24 template <CE_Precision PREC> class CE_PrecisionResolver;
25 
26 template <>
28 {
29 public:
32  using device_int_type = cl_short;
33  using device_float_type = cl_half;
34  static constexpr int bitsize = 16;
35 };
36 
37 template <>
39 {
40 public:
43  using device_int_type = cl_int;
44  using device_float_type = cl_float;
45  static constexpr int bitsize = 32;
46 };
47 
48 template <>
50 {
51 public:
54  using device_int_type = cl_long;
55  using device_float_type = cl_double;
56  static constexpr int bitsize = 64;
57 };
58 
59 template <CE_Precision P> using CEfloatH = typename CE_PrecisionResolver<P>::host_float_type;
60 template <CE_Precision P> using CEintH = typename CE_PrecisionResolver<P>::host_int_type;
61 template <CE_Precision P> using CEfloatD = typename CE_PrecisionResolver<P>::device_float_type;
62 template <CE_Precision P> using CEintD = typename CE_PrecisionResolver<P>::device_int_type;
63 
64 #endif
typename CE_PrecisionResolver< P >::host_int_type CEintH
Definition: CE_Precision.h:60
constexpr CE_Precision CE_16
Definition: CE_Precision.h:20
constexpr CE_Precision CE_32
Definition: CE_Precision.h:21
typename CE_PrecisionResolver< P >::host_float_type CEfloatH
Definition: CE_Precision.h:59
long long int64
Definition: SYS_Types.h:111
CE_Precision
Definition: CE_Precision.h:14
double fpreal64
Definition: SYS_Types.h:196
int int32
Definition: SYS_Types.h:39
unsigned short fpreal16
Definition: SYS_Types.h:202
constexpr CE_Precision CE_64
Definition: CE_Precision.h:22
typename CE_PrecisionResolver< P >::device_float_type CEfloatD
Definition: CE_Precision.h:61
short int16
Definition: SYS_Types.h:37
float fpreal32
Definition: SYS_Types.h:195
typename CE_PrecisionResolver< P >::device_int_type CEintD
Definition: CE_Precision.h:62