VTK-m  2.0
ZFPTypeInfo.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_worklet_zfp_type_info_compressor_h
11 #define vtk_m_worklet_zfp_type_info_compressor_h
12 
13 #include <vtkm/Math.h>
14 
15 namespace vtkm
16 {
17 namespace worklet
18 {
19 namespace zfp
20 {
21 template <typename T>
22 inline VTKM_EXEC int get_ebias();
23 template <>
25 {
26  return 1023;
27 }
28 template <>
30 {
31  return 127;
32 }
33 template <>
35 {
36  return 0;
37 }
38 template <>
40 {
41  return 0;
42 }
43 
44 template <typename T>
45 inline VTKM_EXEC int get_ebits();
46 template <>
48 {
49  return 11;
50 }
51 template <>
53 {
54  return 8;
55 }
56 template <>
58 {
59  return 0;
60 }
61 template <>
63 {
64  return 0;
65 }
66 
67 template <typename T>
68 inline VTKM_EXEC int get_precision();
69 template <>
71 {
72  return 64;
73 }
74 template <>
76 {
77  return 64;
78 }
79 template <>
81 {
82  return 32;
83 }
84 template <>
86 {
87  return 32;
88 }
89 
90 template <typename T>
91 inline VTKM_EXEC int get_min_exp();
92 template <>
94 {
95  return -1074;
96 }
97 template <>
99 {
100  return -1074;
101 }
102 template <>
104 {
105  return 0;
106 }
107 template <>
109 {
110  return 0;
111 }
112 
113 template <typename T>
114 inline VTKM_EXEC int scalar_sizeof();
115 
116 template <>
118 {
119  return 8;
120 }
121 template <>
123 {
124  return 8;
125 }
126 template <>
128 {
129  return 4;
130 }
131 template <>
133 {
134  return 4;
135 }
136 
137 template <typename T>
138 inline VTKM_EXEC bool is_float();
139 
140 template <>
142 {
143  return true;
144 }
145 template <>
147 {
148  return true;
149 }
150 template <>
152 {
153  return false;
154 }
155 template <>
157 {
158  return false;
159 }
160 
161 template <typename T>
162 struct zfp_traits;
163 
164 template <>
165 struct zfp_traits<double>
166 {
167  typedef unsigned long long int UInt;
168  typedef long long int Int;
169 };
170 
171 template <>
172 struct zfp_traits<long long int>
173 {
174  typedef unsigned long long int UInt;
175  typedef long long int Int;
176 };
177 
178 template <>
179 struct zfp_traits<float>
180 {
181  typedef unsigned int UInt;
182  typedef int Int;
183 };
184 
185 template <>
186 struct zfp_traits<int>
187 {
188  typedef unsigned int UInt;
189  typedef int Int;
190 };
191 
192 template <typename T>
193 inline VTKM_EXEC bool is_int()
194 {
195  return false;
196 }
197 
198 template <>
199 inline VTKM_EXEC bool is_int<int>()
200 {
201  return true;
202 }
203 
204 template <>
206 {
207  return true;
208 }
209 
210 template <int T>
212 
213 template <>
214 struct block_traits<1>
215 {
216  typedef unsigned char PlaneType;
217 };
218 
219 template <>
220 struct block_traits<2>
221 {
222  typedef unsigned short PlaneType;
223 };
224 
225 } // namespace zfp
226 } // namespace worklet
227 } // namespace vtkm
228 #endif // vtk_m_worklet_zfp_type_info_h
vtkm::worklet::zfp::is_float
VTKM_EXEC bool is_float()
vtkm::worklet::zfp::is_int< long long int >
VTKM_EXEC bool is_int< long long int >()
Definition: ZFPTypeInfo.h:205
vtkm::worklet::zfp::get_precision
VTKM_EXEC int get_precision()
vtkm::worklet::zfp::get_ebias
VTKM_EXEC int get_ebias()
vtkm::worklet::zfp::get_min_exp< double >
VTKM_EXEC int get_min_exp< double >()
Definition: ZFPTypeInfo.h:93
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::worklet::zfp::get_precision< long long int >
VTKM_EXEC int get_precision< long long int >()
Definition: ZFPTypeInfo.h:75
vtkm::worklet::zfp::zfp_traits< double >::Int
long long int Int
Definition: ZFPTypeInfo.h:168
vtkm::worklet::zfp::zfp_traits< int >::Int
int Int
Definition: ZFPTypeInfo.h:189
vtkm::worklet::zfp::get_ebias< double >
VTKM_EXEC int get_ebias< double >()
Definition: ZFPTypeInfo.h:24
vtkm::worklet::zfp::is_float< float >
VTKM_EXEC bool is_float< float >()
Definition: ZFPTypeInfo.h:151
vtkm::worklet::zfp::scalar_sizeof< float >
VTKM_EXEC int scalar_sizeof< float >()
Definition: ZFPTypeInfo.h:127
vtkm::worklet::zfp::zfp_traits< float >::UInt
unsigned int UInt
Definition: ZFPTypeInfo.h:181
vtkm::worklet::zfp::get_ebits< long long int >
VTKM_EXEC int get_ebits< long long int >()
Definition: ZFPTypeInfo.h:62
vtkm::worklet::zfp::block_traits< 1 >::PlaneType
unsigned char PlaneType
Definition: ZFPTypeInfo.h:216
vtkm::worklet::zfp::is_float< long long int >
VTKM_EXEC bool is_float< long long int >()
Definition: ZFPTypeInfo.h:146
vtkm::worklet::zfp::get_ebits< int >
VTKM_EXEC int get_ebits< int >()
Definition: ZFPTypeInfo.h:57
vtkm::worklet::zfp::get_ebias< float >
VTKM_EXEC int get_ebias< float >()
Definition: ZFPTypeInfo.h:29
vtkm::worklet::zfp::zfp_traits< double >::UInt
unsigned long long int UInt
Definition: ZFPTypeInfo.h:167
vtkm::worklet::zfp::get_ebits
VTKM_EXEC int get_ebits()
vtkm::worklet::zfp::scalar_sizeof< double >
VTKM_EXEC int scalar_sizeof< double >()
Definition: ZFPTypeInfo.h:117
Math.h
vtkm::worklet::zfp::zfp_traits< float >::Int
int Int
Definition: ZFPTypeInfo.h:182
vtkm::worklet::zfp::get_ebias< int >
VTKM_EXEC int get_ebias< int >()
Definition: ZFPTypeInfo.h:39
vtkm::worklet::zfp::scalar_sizeof
VTKM_EXEC int scalar_sizeof()
vtkm::worklet::zfp::get_precision< double >
VTKM_EXEC int get_precision< double >()
Definition: ZFPTypeInfo.h:70
vtkm::worklet::zfp::block_traits< 2 >::PlaneType
unsigned short PlaneType
Definition: ZFPTypeInfo.h:222
vtkm::worklet::zfp::get_min_exp
VTKM_EXEC int get_min_exp()
vtkm::worklet::zfp::get_ebits< double >
VTKM_EXEC int get_ebits< double >()
Definition: ZFPTypeInfo.h:47
vtkm::worklet::zfp::get_precision< float >
VTKM_EXEC int get_precision< float >()
Definition: ZFPTypeInfo.h:80
vtkm::worklet::zfp::block_traits
Definition: ZFPTypeInfo.h:211
vtkm::worklet::zfp::get_ebits< float >
VTKM_EXEC int get_ebits< float >()
Definition: ZFPTypeInfo.h:52
vtkm::worklet::zfp::zfp_traits< long long int >::UInt
unsigned long long int UInt
Definition: ZFPTypeInfo.h:174
vtkm::worklet::zfp::scalar_sizeof< long long int >
VTKM_EXEC int scalar_sizeof< long long int >()
Definition: ZFPTypeInfo.h:122
vtkm::worklet::zfp::scalar_sizeof< int >
VTKM_EXEC int scalar_sizeof< int >()
Definition: ZFPTypeInfo.h:132
vtkm::worklet::zfp::zfp_traits< int >::UInt
unsigned int UInt
Definition: ZFPTypeInfo.h:188
vtkm::worklet::zfp::get_ebias< long long int >
VTKM_EXEC int get_ebias< long long int >()
Definition: ZFPTypeInfo.h:34
vtkm::worklet::zfp::is_int
VTKM_EXEC bool is_int()
Definition: ZFPTypeInfo.h:193
vtkm::worklet::zfp::is_float< int >
VTKM_EXEC bool is_float< int >()
Definition: ZFPTypeInfo.h:156
vtkm::worklet::zfp::get_min_exp< float >
VTKM_EXEC int get_min_exp< float >()
Definition: ZFPTypeInfo.h:98
vtkm::worklet::zfp::get_precision< int >
VTKM_EXEC int get_precision< int >()
Definition: ZFPTypeInfo.h:85
vtkm::worklet::zfp::get_min_exp< long long int >
VTKM_EXEC int get_min_exp< long long int >()
Definition: ZFPTypeInfo.h:103
vtkm::worklet::zfp::zfp_traits< long long int >::Int
long long int Int
Definition: ZFPTypeInfo.h:175
vtkm::worklet::zfp::is_int< int >
VTKM_EXEC bool is_int< int >()
Definition: ZFPTypeInfo.h:199
vtkm::worklet::zfp::is_float< double >
VTKM_EXEC bool is_float< double >()
Definition: ZFPTypeInfo.h:141
vtkm::worklet::zfp::zfp_traits
Definition: ZFPTypeInfo.h:162
vtkm::worklet::zfp::get_min_exp< int >
VTKM_EXEC int get_min_exp< int >()
Definition: ZFPTypeInfo.h:108