3#include <cuda_runtime.h>
22 *
this = std::move(
other);
30 capacity_ =
other.capacity_;
31 other.data_ =
nullptr;
64 return std::string_view{data_, size_};
74 if (data_ !=
nullptr) {
90 if (data_ !=
nullptr) {
111 char* data_{
nullptr};
Page-locked host buffer for fused FASTX normalize + H2D staging.
FastxPinnedSequenceBuffer(FastxPinnedSequenceBuffer &&other) noexcept
size_t size() const noexcept
Logical byte length (≤ capacity).
std::string_view view() const noexcept
data() as a string view of length size().
~FastxPinnedSequenceBuffer()
Result< void > set_size(size_t nbytes)
Sets logical size to nbytes, reserving if needed.
FastxPinnedSequenceBuffer & operator=(FastxPinnedSequenceBuffer &&other) noexcept
size_t capacity() const noexcept
Allocated pinned bytes.
char * data() noexcept
Writable pinned host pointer (may be nullptr before reserve).
const char * data() const noexcept
Read-only view of data().
FastxPinnedSequenceBuffer(const FastxPinnedSequenceBuffer &)=delete
FastxPinnedSequenceBuffer & operator=(const FastxPinnedSequenceBuffer &)=delete
void clear() noexcept
Sets logical size to zero without freeing capacity.
void release()
Frees pinned host memory and resets size and capacity.
Result< void > reserve(size_t nbytes)
Grows pinned allocation to at least nbytes, preserving existing bytes.
FastxPinnedSequenceBuffer()=default
#define CUSBF_CUDA_ABORT(expr)
Checks a CUDA call and aborts on failure (destructors and RAII only).
#define CUSBF_TRY(expr)
Propagates a cusbf::Result failure from the enclosing function (GNU statement expression).
#define CUSBF_CUDA_TRY(expr)
Propagates a CUDA error wrapped in cusbf::Result<void>.
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...
Fallible API result: cuda::std::expected<T, Error> with cuSBF factories.