HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GridChecksum.h File Reference

Computes a pair of 32bit checksums, of a Grid, by means of Cyclic Redundancy Check (CRC) More...

#include <algorithm>
#include <array>
#include <vector>
#include <cstdint>
#include <cstddef>
#include <numeric>
#include <type_traits>
#include <memory>
#include <nanovdb/NanoVDB.h>
#include "ForEach.h"
#include "NodeManager.h"
+ Include dependency graph for GridChecksum.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  nanovdb::GridChecksum
 Class that encapsulates two CRC32 checksums, one for the Grid, Tree and Root node meta data and one for the remaining grid nodes. More...
 

Namespaces

 nanovdb
 
 nanovdb::crc32
 

Macros

#define NANOVDB_CRC32_LOG2_BLOCK_SIZE   12
 

Enumerations

enum  nanovdb::ChecksumMode : uint32_t {
  nanovdb::ChecksumMode::Disable = 0, nanovdb::ChecksumMode::Partial = 1, nanovdb::ChecksumMode::Full = 2, nanovdb::ChecksumMode::Default = 1,
  nanovdb::ChecksumMode::End = 3
}
 List of different modes for computing for a checksum. More...
 

Functions

template<typename BuildT >
uint64_t nanovdb::checksum (const NanoGrid< BuildT > &grid, ChecksumMode mode=ChecksumMode::Default)
 Return the (2 x CRC32) checksum of the specified grid. More...
 
template<typename BuildT >
bool nanovdb::validateChecksum (const NanoGrid< BuildT > &grid, ChecksumMode mode=ChecksumMode::Default)
 Return true if the checksum of the grid matches the expected value already encoded into the grid's meta data. More...
 
template<typename BuildT >
void nanovdb::updateChecksum (NanoGrid< BuildT > &grid, ChecksumMode mode=ChecksumMode::Default)
 Updates the checksum of a grid. More...
 
__hostdev__ void nanovdb::crc32::initLut (uint32_t lut[256], uint32_t n)
 Initiate single entry in look-up-table for CRC32 computations. More...
 
__hostdev__ void nanovdb::crc32::initLut (uint32_t lut[256])
 Initiate entire look-up-table for CRC32 computations. More...
 
std::unique_ptr< uint32_t[]> nanovdb::crc32::createLut ()
 Create and initiate entire look-up-table for CRC32 computations. More...
 
__hostdev__ uint32_t nanovdb::crc32::checksum (const void *data, size_t size, uint32_t crc=0)
 Compute crc32 checksum of data of size bytes (without a lookup table)) More...
 
__hostdev__ uint32_t nanovdb::crc32::checksum (const void *begin, const void *end, uint32_t crc=0)
 Compute crc32 checksum of data between begin and end. More...
 
__hostdev__ uint32_t nanovdb::crc32::checksum (const void *data, size_t size, const uint32_t lut[256], uint32_t crc=0)
 Compute crc32 checksum of data with size bytes using a lookup table. More...
 
__hostdev__ uint32_t nanovdb::crc32::checksum (const void *begin, const void *end, const uint32_t lut[256], uint32_t crc=0)
 Compute crc32 checksum of data between begin and end using a lookup table. More...
 
template<typename ValueT >
uint64_t nanovdb::checksum (const NanoGrid< ValueT > &grid, ChecksumMode mode)
 
template<typename ValueT >
bool nanovdb::validateChecksum (const NanoGrid< ValueT > &grid, ChecksumMode mode)
 
template<typename ValueT >
void nanovdb::updateChecksum (NanoGrid< ValueT > &grid, ChecksumMode mode)
 
bool nanovdb::updateChecksum (GridData &gridData, ChecksumMode mode)
 
bool nanovdb::updateChecksum (GridData *data)
 Preserve the existing mode of the checksum and update it if it's not disabled. More...
 
bool nanovdb::updateGridCount (GridData *data, uint32_t gridIndex, uint32_t gridCount)
 Updates the ground index and count, as well as the partial checksum if needed. More...
 

Detailed Description

Computes a pair of 32bit checksums, of a Grid, by means of Cyclic Redundancy Check (CRC)

Author
Ken Museth

A CRC32 is the 32 bit remainder, or residue, of binary division of a message, by a polynomial.

Definition in file GridChecksum.h.

Macro Definition Documentation

#define NANOVDB_CRC32_LOG2_BLOCK_SIZE   12

Definition at line 33 of file GridChecksum.h.