VTK-m
2.0
vtkm
filter
zfp
worklet
zfp
ZFPStructs.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_structs_h
11
#define vtk_m_worklet_zfp_structs_h
12
13
#define ZFP_MIN_BITS 0
/* minimum number of bits per block */
14
#define ZFP_MAX_BITS 4171
/* maximum number of bits per block */
15
#define ZFP_MAX_PREC 64
/* maximum precision supported */
16
#define ZFP_MIN_EXP -1074
/* minimum floating-point base-2 exponent */
17
18
#include <
vtkm/filter/zfp/worklet/zfp/ZFPFunctions.h
>
19
#include <
vtkm/filter/zfp/worklet/zfp/ZFPTypeInfo.h
>
20
21
namespace
vtkm
22
{
23
namespace
worklet
24
{
25
namespace
zfp
26
{
27
28
struct
ZFPStream
29
{
30
vtkm::UInt32
minbits
;
31
vtkm::UInt32
maxbits
;
32
vtkm::UInt32
maxprec
;
33
vtkm::Int32
minexp
;
34
35
template
<
typename
T>
36
vtkm::Float64
SetRate
(
const
vtkm::Float64
rate,
const
vtkm::Int32
dims, T
vtkmNotUsed
(valueType))
37
{
38
vtkm::UInt32
n = 1u << (2 * dims);
39
vtkm::UInt32
bits = (
unsigned
int)floor(n * rate + 0.5);
40
bits = zfp::MinBits<T>(bits);
41
//if (wra) {
42
// /* for write random access, round up to next multiple of stream word size */
43
// bits += (uint)stream_word_bits - 1;
44
// bits &= ~(stream_word_bits - 1);
45
//}
46
minbits
= bits;
47
maxbits
= bits;
48
maxprec
=
ZFP_MAX_PREC
;
49
minexp
=
ZFP_MIN_EXP
;
50
return
(
double
)bits / n;
51
}
52
};
53
}
54
}
55
}
// namespace vtkm::worklet::zfp
56
#endif
vtkm::worklet::zfp::ZFPStream::SetRate
vtkm::Float64 SetRate(const vtkm::Float64 rate, const vtkm::Int32 dims, T vtkmNotUsed(valueType))
Definition:
ZFPStructs.h:36
ZFPFunctions.h
vtkm
Groups connected points that have the same field value.
Definition:
Atomic.h:19
ZFPTypeInfo.h
vtkm::worklet::zfp::ZFPStream::minbits
vtkm::UInt32 minbits
Definition:
ZFPStructs.h:30
ZFP_MAX_PREC
#define ZFP_MAX_PREC
Definition:
ZFPStructs.h:15
vtkm::worklet::zfp::ZFPStream::maxprec
vtkm::UInt32 maxprec
Definition:
ZFPStructs.h:32
vtkm::worklet::zfp::ZFPStream::maxbits
vtkm::UInt32 maxbits
Definition:
ZFPStructs.h:31
vtkm::worklet::zfp::ZFPStream::minexp
vtkm::Int32 minexp
Definition:
ZFPStructs.h:33
vtkmNotUsed
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition:
ExportMacros.h:128
vtkm::UInt32
uint32_t UInt32
Definition:
Types.h:161
vtkm::Int32
int32_t Int32
Definition:
Types.h:160
vtkm::Float64
double Float64
Definition:
Types.h:155
vtkm::worklet::zfp::ZFPStream
Definition:
ZFPStructs.h:28
ZFP_MIN_EXP
#define ZFP_MIN_EXP
Definition:
ZFPStructs.h:16
Generated by
1.8.17