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 #include <SYS/SYS_Types.h>
15 
16 enum class CE_Precision
17 {
18  CE_16,
19  CE_32,
20  CE_64,
21 };
25 
26 template <CE_Precision PREC> class CE_PrecisionResolver;
27 
28 template <>
30 {
31 public:
36  static constexpr int bitsize = 16;
37 };
38 
39 template <>
41 {
42 public:
47  static constexpr int bitsize = 32;
48 };
49 
50 template <>
52 {
53 public:
58  static constexpr int bitsize = 64;
59 };
60 
61 template <CE_Precision P> using CEfloatH = typename CE_PrecisionResolver<P>::host_float_type;
62 template <CE_Precision P> using CEintH = typename CE_PrecisionResolver<P>::host_int_type;
63 template <CE_Precision P> using CEfloatD = typename CE_PrecisionResolver<P>::device_float_type;
64 template <CE_Precision P> using CEintD = typename CE_PrecisionResolver<P>::device_int_type;
65 
66 #endif
int int32
Definition: SYS_Types.h:39
typename CE_PrecisionResolver< P >::host_int_type CEintH
Definition: CE_Precision.h:62
constexpr CE_Precision CE_16
Definition: CE_Precision.h:22
constexpr CE_Precision CE_32
Definition: CE_Precision.h:23
uint16_t cl_half
Definition: cl_platform.h:265
int32_t cl_int
Definition: cl_platform.h:260
typename CE_PrecisionResolver< P >::host_float_type CEfloatH
Definition: CE_Precision.h:61
float fpreal32
Definition: SYS_Types.h:200
double fpreal64
Definition: SYS_Types.h:201
double cl_double
Definition: cl_platform.h:267
CE_Precision
Definition: CE_Precision.h:16
long long int64
Definition: SYS_Types.h:116
int64_t cl_long
Definition: cl_platform.h:262
float cl_float
Definition: cl_platform.h:266
short int16
Definition: SYS_Types.h:37
constexpr CE_Precision CE_64
Definition: CE_Precision.h:24
typename CE_PrecisionResolver< P >::device_float_type CEfloatD
Definition: CE_Precision.h:63
int16_t cl_short
Definition: cl_platform.h:258
typename CE_PrecisionResolver< P >::device_int_type CEintD
Definition: CE_Precision.h:64