VTK-m
2.0
Main Page
Related Pages
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
j
k
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
g
v
Variables
Typedefs
Macros
b
c
d
e
i
k
m
n
p
q
r
s
t
u
v
x
z
vtkm
filter
zfp
worklet
zfp
ZFPFunctions.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_functions_h
11
#define vtk_m_worklet_zfp_functions_h
12
13
#include <
vtkm/Math.h
>
14
#include <
vtkm/filter/zfp/worklet/zfp/ZFPBlockWriter.h
>
15
#include <
vtkm/filter/zfp/worklet/zfp/ZFPCodec.h
>
16
#include <
vtkm/filter/zfp/worklet/zfp/ZFPTypeInfo.h
>
17
18
namespace
vtkm
19
{
20
namespace
worklet
21
{
22
namespace
zfp
23
{
24
25
template
<
typename
T>
26
void
PrintBits
(T bits)
27
{
28
const
int
bit_size =
sizeof
(T) * 8;
29
for
(
int
i = bit_size - 1; i >= 0; --i)
30
{
31
T one = 1;
32
T mask = one << i;
33
int
val = (bits & mask) >> T(i);
34
printf(
"%d"
, val);
35
}
36
printf(
"\n"
);
37
}
38
39
template
<
typename
T>
40
inline
vtkm::UInt32
MinBits
(
const
vtkm::UInt32
bits)
41
{
42
return
bits;
43
}
44
45
template
<>
46
inline
vtkm::UInt32
MinBits<vtkm::Float32>(
const
vtkm::UInt32
bits)
47
{
48
return
vtkm::Max(bits, 1 + 8u);
49
}
50
51
template
<>
52
inline
vtkm::UInt32
MinBits<vtkm::Float64>(
const
vtkm::UInt32
bits)
53
{
54
return
vtkm::Max(bits, 1 + 11u);
55
}
56
57
58
59
60
}
// namespace zfp
61
}
// namespace worklet
62
}
// namespace vtkm
63
#endif // vtk_m_worklet_zfp_type_info_h
vtkm
Groups connected points that have the same field value.
Definition:
Atomic.h:19
ZFPTypeInfo.h
ZFPCodec.h
Math.h
vtkm::worklet::zfp::MinBits
vtkm::UInt32 MinBits(const vtkm::UInt32 bits)
Definition:
ZFPFunctions.h:40
vtkm::UInt32
uint32_t UInt32
Definition:
Types.h:161
ZFPBlockWriter.h
vtkm::worklet::zfp::PrintBits
void PrintBits(T bits)
Definition:
ZFPFunctions.h:26
Generated by
1.8.17