Go to the documentation of this file.
10 #ifndef vtk_m_worklet_zfp_encode3_h
11 #define vtk_m_worklet_zfp_encode3_h
30 template <
typename Scalar,
typename PortalType>
32 const PortalType& scalars,
41 for (z = 0; z < nz; z++, offset += dims[0] * dims[1] - ny * dims[0])
43 for (y = 0; y < ny; y++, offset += dims[0] - nx)
45 for (x = 0; x < nx; x++, offset += 1)
47 q[16 * z + 4 * y + x] = scalars.Get(offset);
52 for (x = 0; x < 4; x++)
58 for (y = 0; y < 4; y++)
60 for (x = 0; x < 4; x++)
67 template <
typename Scalar,
typename PortalType>
69 const PortalType& scalars,
75 for (
vtkm::Id z = 0; z < 4; z++, offset += dims[0] * dims[1] - 4 * dims[0])
77 for (
vtkm::Id y = 0; y < 4; y++, offset += dims[0] - 4)
79 for (
vtkm::Id x = 0; x < 4; x++, ++offset)
81 fblock[counter] = scalars.Get(offset);
107 template <
typename InputScalarPortal,
typename BitstreamPortal>
109 const InputScalarPortal& scalars,
110 BitstreamPortal& stream)
const
112 using Scalar =
typename InputScalarPortal::ValueType;
114 Scalar fblock[BlockSize];
117 zfpBlock[0] = blockIdx %
ZFPDims[0];
124 vtkm::Id offset = (logicalStart[2] *
Dims[1] + logicalStart[1]) *
Dims[0] + logicalStart[0];
126 bool partial =
false;
127 if (logicalStart[0] + 4 >
Dims[0])
129 if (logicalStart[1] + 4 >
Dims[1])
131 if (logicalStart[2] + 4 >
Dims[2])
VTKM_EXEC void operator()(const vtkm::Id blockIdx, const InputScalarPortal &scalars, BitstreamPortal &stream) const
Definition: ZFPEncode3.h:108
Definition: ZFPEncode.h:314
VTKM_EXEC void Gather3(Scalar *fblock, const PortalType &scalars, const vtkm::Id3 dims, vtkm::Id offset)
Definition: ZFPEncode3.h:68
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_EXEC void GatherPartial3(Scalar *q, const PortalType &scalars, const vtkm::Id3 dims, vtkm::Id offset, vtkm::Int32 nx, vtkm::Int32 ny, vtkm::Int32 nz)
Definition: ZFPEncode3.h:31
Definition: ZFPEncode3.h:88
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::Id3 Dims
Definition: ZFPEncode3.h:91
Encode3(const vtkm::Id3 dims, const vtkm::Id3 paddedDims, const vtkm::UInt32 maxbits)
Definition: ZFPEncode3.h:96
A control signature tag for input fields.
Definition: WorkletMapField.h:49
void(FieldIn, WholeArrayIn, AtomicArrayInOut bitstream) ControlSignature
Definition: ZFPEncode3.h:105
VTKM_EXEC void PadBlock(Scalar *p, vtkm::UInt32 n, vtkm::UInt32 s)
Definition: ZFPEncode.h:27
uint32_t UInt32
Definition: Types.h:161
vtkm::Id3 ZFPDims
Definition: ZFPEncode3.h:93
int32_t Int32
Definition: Types.h:160
vtkm::Id3 PaddedDims
Definition: ZFPEncode3.h:92
vtkm::UInt32 MaxBits
Definition: ZFPEncode3.h:94
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38