10 #ifndef vtk_m_worklet_zfp_tool_h
11 #define vtk_m_worklet_zfp_tool_h
42 using ControlSignature = void(FieldIn, WholeArrayInOut);
43 using ExecutionSignature = void(_1, _2);
45 template <
typename PortalType>
55 const size_t vals_per_block = 64;
56 const size_t size =
static_cast<size_t>(dims[0] * dims[1] * dims[2]);
57 size_t total_blocks = size / vals_per_block;
58 const size_t bits_per_word =
sizeof(
ZFPWord) * 8;
59 const size_t total_bits = bits_per_block * total_blocks;
60 const size_t alloc_size = total_bits / bits_per_word;
61 return alloc_size *
sizeof(
ZFPWord);
66 constexpr
size_t vals_per_block = 16;
67 const size_t size =
static_cast<size_t>(dims[0] * dims[1]);
68 size_t total_blocks = size / vals_per_block;
69 constexpr
size_t bits_per_word =
sizeof(
ZFPWord) * 8;
70 const size_t total_bits = bits_per_block * total_blocks;
71 const size_t alloc_size = total_bits / bits_per_word;
72 return alloc_size *
sizeof(
ZFPWord);
77 constexpr
size_t vals_per_block = 4;
78 const size_t size =
static_cast<size_t>(dims);
79 size_t total_blocks = size / vals_per_block;
80 constexpr
size_t bits_per_word =
sizeof(
ZFPWord) * 8;
81 const size_t total_bits = bits_per_block * total_blocks;
82 const size_t alloc_size = total_bits / bits_per_word;
83 return alloc_size *
sizeof(
ZFPWord);
91 typedef typename HandleType::template ExecutionTypes<vtkm::cont::DeviceAdapterTagSerial>::Portal
99 template <
typename T,
typename S>
103 T* ptr = GetVTKMPointer(handle);
105 FILE* fp = fopen(fileName.c_str(),
"wb");
109 fwrite(ptr,
sizeof(T),
static_cast<size_t>(osize), fp);
120 #endif // vtk_m_worklet_zfp_tools_h