cuSBF
Loading...
Searching...
No Matches
Public Member Functions | List of all members
cusbf::detail::FastxPinnedSequenceBuffer Class Reference

Page-locked host buffer for fused FASTX normalize + H2D staging. More...

#include <fastx_pinned_buffer.hpp>

Public Member Functions

 FastxPinnedSequenceBuffer ()=default
 
 FastxPinnedSequenceBuffer (const FastxPinnedSequenceBuffer &)=delete
 
FastxPinnedSequenceBufferoperator= (const FastxPinnedSequenceBuffer &)=delete
 
 FastxPinnedSequenceBuffer (FastxPinnedSequenceBuffer &&other) noexcept
 
FastxPinnedSequenceBufferoperator= (FastxPinnedSequenceBuffer &&other) noexcept
 
 ~FastxPinnedSequenceBuffer ()
 
chardata () noexcept
 Writable pinned host pointer (may be nullptr before reserve).
 
const chardata () const noexcept
 Read-only view of data().
 
size_t size () const noexcept
 Logical byte length (≤ capacity).
 
size_t capacity () const noexcept
 Allocated pinned bytes.
 
std::string_view view () const noexcept
 data() as a string view of length size().
 
void clear () noexcept
 Sets logical size to zero without freeing capacity.
 
void release ()
 Frees pinned host memory and resets size and capacity.
 
Result< voidreserve (size_t nbytes)
 Grows pinned allocation to at least nbytes, preserving existing bytes.
 
Result< voidset_size (size_t nbytes)
 Sets logical size to nbytes, reserving if needed.
 

Detailed Description

Page-locked host buffer for fused FASTX normalize + H2D staging.

Definition at line 15 of file fastx_pinned_buffer.hpp.

Constructor & Destructor Documentation

◆ FastxPinnedSequenceBuffer() [1/3]

cusbf::detail::FastxPinnedSequenceBuffer::FastxPinnedSequenceBuffer ( )
default

◆ FastxPinnedSequenceBuffer() [2/3]

cusbf::detail::FastxPinnedSequenceBuffer::FastxPinnedSequenceBuffer ( const FastxPinnedSequenceBuffer )
delete

◆ FastxPinnedSequenceBuffer() [3/3]

cusbf::detail::FastxPinnedSequenceBuffer::FastxPinnedSequenceBuffer ( FastxPinnedSequenceBuffer &&  other)
inlinenoexcept

Definition at line 21 of file fastx_pinned_buffer.hpp.

21 {
22 *this = std::move(other);
23 }
consteval bool separatorPositionAlwaysEncodesInvalid(char *input, uint64_t separatorPosition, uint64_t index)
Recursively tests whether placing the separator byte at any position in an input of valid bytes alway...
Definition Alphabet.cuh:37
Here is the call graph for this function:

◆ ~FastxPinnedSequenceBuffer()

cusbf::detail::FastxPinnedSequenceBuffer::~FastxPinnedSequenceBuffer ( )
inline

Definition at line 38 of file fastx_pinned_buffer.hpp.

38 {
39 release();
40 }
void release()
Frees pinned host memory and resets size and capacity.
Here is the call graph for this function:

Member Function Documentation

◆ capacity()

size_t cusbf::detail::FastxPinnedSequenceBuffer::capacity ( ) const
inlinenoexcept

Allocated pinned bytes.

Definition at line 58 of file fastx_pinned_buffer.hpp.

58 {
59 return capacity_;
60 }

◆ clear()

void cusbf::detail::FastxPinnedSequenceBuffer::clear ( )
inlinenoexcept

Sets logical size to zero without freeing capacity.

Definition at line 68 of file fastx_pinned_buffer.hpp.

68 {
69 size_ = 0;
70 }

◆ data() [1/2]

const char * cusbf::detail::FastxPinnedSequenceBuffer::data ( ) const
inlinenoexcept

Read-only view of data().

Definition at line 48 of file fastx_pinned_buffer.hpp.

48 {
49 return data_;
50 }

◆ data() [2/2]

char * cusbf::detail::FastxPinnedSequenceBuffer::data ( )
inlinenoexcept

Writable pinned host pointer (may be nullptr before reserve).

Definition at line 43 of file fastx_pinned_buffer.hpp.

43 {
44 return data_;
45 }

◆ operator=() [1/2]

FastxPinnedSequenceBuffer & cusbf::detail::FastxPinnedSequenceBuffer::operator= ( const FastxPinnedSequenceBuffer )
delete

◆ operator=() [2/2]

FastxPinnedSequenceBuffer & cusbf::detail::FastxPinnedSequenceBuffer::operator= ( FastxPinnedSequenceBuffer &&  other)
inlinenoexcept

Definition at line 25 of file fastx_pinned_buffer.hpp.

25 {
26 if (this != &other) {
27 release();
28 data_ = other.data_;
29 size_ = other.size_;
30 capacity_ = other.capacity_;
31 other.data_ = nullptr;
32 other.size_ = 0;
33 other.capacity_ = 0;
34 }
35 return *this;
36 }
Here is the call graph for this function:

◆ release()

void cusbf::detail::FastxPinnedSequenceBuffer::release ( )
inline

Frees pinned host memory and resets size and capacity.

Definition at line 73 of file fastx_pinned_buffer.hpp.

73 {
74 if (data_ != nullptr) {
76 data_ = nullptr;
77 }
78 size_ = 0;
79 capacity_ = 0;
80 }
#define CUSBF_CUDA_ABORT(expr)
Checks a CUDA call and aborts on failure (destructors and RAII only).
Definition error.hpp:266
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reserve()

Result< void > cusbf::detail::FastxPinnedSequenceBuffer::reserve ( size_t  nbytes)
inline

Grows pinned allocation to at least nbytes, preserving existing bytes.

Definition at line 83 of file fastx_pinned_buffer.hpp.

83 {
84 if (nbytes <= capacity_) {
85 return {};
86 }
87
88 char* reallocated = nullptr;
90 if (data_ != nullptr) {
91 if (size_ != 0) {
92 std::memcpy(reallocated, data_, size_);
93 }
95 }
96 data_ = reallocated;
97 capacity_ = nbytes;
98 return {};
99 }
#define CUSBF_CUDA_TRY(expr)
Propagates a CUDA error wrapped in cusbf::Result<void>.
Definition error.hpp:269
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_size()

Result< void > cusbf::detail::FastxPinnedSequenceBuffer::set_size ( size_t  nbytes)
inline

Sets logical size to nbytes, reserving if needed.

Definition at line 102 of file fastx_pinned_buffer.hpp.

102 {
103 if (nbytes > capacity_) {
105 }
106 size_ = nbytes;
107 return {};
108 }
Result< void > reserve(size_t nbytes)
Grows pinned allocation to at least nbytes, preserving existing bytes.
#define CUSBF_TRY(expr)
Propagates a cusbf::Result failure from the enclosing function (GNU statement expression).
Definition error.hpp:246
Here is the call graph for this function:

◆ size()

size_t cusbf::detail::FastxPinnedSequenceBuffer::size ( ) const
inlinenoexcept

Logical byte length (≤ capacity).

Definition at line 53 of file fastx_pinned_buffer.hpp.

53 {
54 return size_;
55 }

◆ view()

std::string_view cusbf::detail::FastxPinnedSequenceBuffer::view ( ) const
inlinenoexcept

data() as a string view of length size().

Definition at line 63 of file fastx_pinned_buffer.hpp.

63 {
64 return std::string_view{data_, size_};
65 }

The documentation for this class was generated from the following file: