NVBIO
|
A class to represent a forward packed stream of symbols, where the size of the symbol is specified at compile-time as a template parameter. The sequence is packed on top of an underlying stream of words, whose type can also be specified at compile-time in order to allow for different memory access patterns. This class is a ForwardIterator, and is useful when one needs to just stream sequentially through a packed stream; in this case, in fact, the symbols are unpacked incrementally, reducing the amount of logic operations and memory transactions.
InputStream | the underlying stream of words used to hold the packed stream (e.g. uint32, uint4) |
Symbol | the unpacked symbol type (e.g. uint8) |
SYMBOL_SIZE_T | the number of bits needed for each symbol |
BIG_ENDIAN_T | the "endianness" of the words: if true, symbols will be packed from right to left within each word |
IndexType | the type of integer used to address the stream (e.g. uint32, uint64) |
Definition at line 99 of file packedstream.h.
#include <packedstream.h>
Public Types | |
typedef ForwardPackedStream < InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > | This |
typedef unsigned_type < IndexType >::type | index_type |
typedef signed_type< IndexType > ::type | sindex_type |
typedef std::iterator_traits < InputStream >::value_type | storage_type |
typedef InputStream | stream_type |
typedef InputStream | storage_iterator |
typedef Symbol | symbol_type |
typedef PackedStreamRef< This > | reference |
typedef Symbol | const_reference |
typedef reference * | pointer |
typedef std::iterator_traits < InputStream > ::iterator_category | iterator_category |
typedef symbol_type | value_type |
typedef sindex_type | difference_type |
typedef sindex_type | distance_type |
typedef This | iterator |
typedef This | const_iterator |
typedef This | forward_iterator |
Public Members | |
InputStream | m_stream |
index_type | m_index |
storage_type | m_word |
uint32 | m_word_index |
uint32 | m_word_offset |
Static Public Members | |
static const uint32 | SYMBOL_SIZE = SYMBOL_SIZE_T |
static const uint32 | SYMBOL_COUNT = 1u << SYMBOL_SIZE |
static const uint32 | SYMBOL_MASK = SYMBOL_COUNT - 1u |
static const uint32 | BIG_ENDIAN = BIG_ENDIAN_T |
static const uint32 | ALPHABET_SIZE = SYMBOL_COUNT |
static const uint32 | WORD_SIZE = uint32( sizeof(storage_type) ) |
static const uint32 | SYMBOLS_PER_WORD = (8u * WORD_SIZE) / SYMBOL_SIZE |
static const uint32 | VECTOR_WIDTH = SYMBOLS_PER_WORD |
Related Functions | |
(Note that these are not member functions.) | |
template<typename InputStream , typename Symbol , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType > | |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool | operator< (const ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > &it1, const ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > &it2) |
template<typename InputStream , typename Symbol , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType > | |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool | operator> (const ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > &it1, const ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > &it2) |
template<typename InputStream , typename Symbol , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType > | |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool | operator== (const ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > &it1, const ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > &it2) |
template<typename InputStream , typename Symbol , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType > | |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool | operator!= (const ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > &it1, const ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > &it2) |
typedef This nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::const_iterator |
Definition at line 447 of file packedstream.h.
typedef Symbol nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::const_reference |
Definition at line 440 of file packedstream.h.
typedef sindex_type nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::difference_type |
Definition at line 444 of file packedstream.h.
typedef sindex_type nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::distance_type |
Definition at line 445 of file packedstream.h.
typedef This nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::forward_iterator |
Definition at line 448 of file packedstream.h.
typedef unsigned_type<IndexType>::type nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::index_type |
Definition at line 428 of file packedstream.h.
typedef This nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::iterator |
Definition at line 446 of file packedstream.h.
typedef std::iterator_traits<InputStream>::iterator_category nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::iterator_category |
Definition at line 442 of file packedstream.h.
typedef reference* nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::pointer |
Definition at line 441 of file packedstream.h.
typedef PackedStreamRef<This> nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::reference |
Definition at line 439 of file packedstream.h.
typedef signed_type<IndexType>::type nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::sindex_type |
Definition at line 429 of file packedstream.h.
typedef InputStream nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::storage_iterator |
Definition at line 437 of file packedstream.h.
typedef std::iterator_traits<InputStream>::value_type nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::storage_type |
Definition at line 430 of file packedstream.h.
typedef InputStream nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::stream_type |
Definition at line 436 of file packedstream.h.
typedef Symbol nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::symbol_type |
Definition at line 438 of file packedstream.h.
typedef ForwardPackedStream<InputStream,Symbol,SYMBOL_SIZE_T, BIG_ENDIAN_T,IndexType> nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::This |
Definition at line 420 of file packedstream.h.
typedef symbol_type nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::value_type |
Definition at line 443 of file packedstream.h.
|
inline |
empty constructor
Definition at line 452 of file packedstream.h.
|
inlineexplicit |
constructor
Definition at line 457 of file packedstream.h.
|
inline |
constructor
Definition at line 466 of file packedstream.h.
|
inline |
constructor
Definition at line 472 of file packedstream.h.
|
inline |
return begin iterator
Definition at line 488 of file packedstream.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE Symbol nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::get | ( | ) | const |
get the current symbol
Definition at line 944 of file packedstream_inl.h.
|
inline |
return the offset this iterator refers to
Definition at line 498 of file packedstream.h.
|
inline |
dereference operator
Definition at line 480 of file packedstream.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator+ | ( | const sindex_type | distance) | const |
add offset
Definition at line 1034 of file packedstream_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > & nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator++ | ( | ) |
pre-increment operator
Definition at line 963 of file packedstream_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator++ | ( | int | dummy) |
post-increment operator
Definition at line 974 of file packedstream_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > & nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator+= | ( | const sindex_type | distance) |
add offset
Definition at line 1010 of file packedstream_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator- | ( | const sindex_type | distance) | const |
subtract offset
Definition at line 1044 of file packedstream_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::sindex_type nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator- | ( | const ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > | it) | const |
difference
Definition at line 1054 of file packedstream_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > & nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator-- | ( | ) |
pre-decrement operator
Definition at line 986 of file packedstream_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator-- | ( | int | dummy) |
post-decrement operator
Definition at line 997 of file packedstream_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > & nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator-= | ( | const sindex_type | distance) |
subtract offset
Definition at line 1022 of file packedstream_inl.h.
|
inline |
assignment operator
Definition at line 504 of file packedstream.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::rebase | ( | void | ) |
rebase the iterator at the current location
Definition at line 953 of file packedstream_inl.h.
|
inline |
return the base stream
Definition at line 493 of file packedstream.h.
|
static |
Definition at line 426 of file packedstream.h.
|
static |
Definition at line 425 of file packedstream.h.
index_type nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::m_index |
Definition at line 556 of file packedstream.h.
InputStream nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::m_stream |
Definition at line 555 of file packedstream.h.
storage_type nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::m_word |
Definition at line 557 of file packedstream.h.
uint32 nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::m_word_index |
Definition at line 558 of file packedstream.h.
uint32 nvbio::ForwardPackedStream< InputStream, Symbol, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::m_word_offset |
Definition at line 559 of file packedstream.h.
|
static |
Definition at line 423 of file packedstream.h.
|
static |
Definition at line 424 of file packedstream.h.
|
static |
Definition at line 422 of file packedstream.h.
|
static |
Definition at line 433 of file packedstream.h.
|
static |
Definition at line 434 of file packedstream.h.
|
static |
Definition at line 432 of file packedstream.h.