mahout

Crate Documentation

Version: 0.2.0

Format Version: 57

Module qdp_core

Modules

Module dlpack

pub mod dlpack { /* ... */ }

Types

Enum DLDeviceType

Attributes:

Device type enum for DLPack. Eq/PartialEq used for validation (e.g. device_type != kDLCUDA); Debug for diagnostics; Copy/Clone for FFI ergonomics when used in DLDevice.

pub enum DLDeviceType {
    kDLCPU = 1,
    kDLCUDA = 2,
}
Variants
kDLCPU

Discriminant: 1

Discriminant value: 1

kDLCUDA

Discriminant: 2

Discriminant value: 2

Implementations
Trait Implementations

Attributes:

pub struct DLDevice {
    pub device_type: DLDeviceType,
    pub device_id: std::os::raw::c_int,
}
Fields
Name Type Documentation
device_type DLDeviceType  
device_id std::os::raw::c_int  
Implementations
Trait Implementations

Attributes:

pub struct DLDataType {
    pub code: u8,
    pub bits: u8,
    pub lanes: u16,
}
Fields
Name Type Documentation
code u8  
bits u8  
lanes u16  
Implementations
Trait Implementations

Attributes:

pub struct DLTensor {
    pub data: *mut std::os::raw::c_void,
    pub device: DLDevice,
    pub ndim: std::os::raw::c_int,
    pub dtype: DLDataType,
    pub shape: *mut i64,
    pub strides: *mut i64,
    pub byte_offset: u64,
}
Fields
Name Type Documentation
data *mut std::os::raw::c_void  
device DLDevice  
ndim std::os::raw::c_int  
dtype DLDataType  
shape *mut i64  
strides *mut i64  
byte_offset u64  
Implementations
Trait Implementations

Attributes:

pub struct DLManagedTensor {
    pub dl_tensor: DLTensor,
    pub manager_ctx: *mut std::os::raw::c_void,
    pub deleter: Option<unsafe extern "C" fn(*mut DLManagedTensor)>,
}
Fields
Name Type Documentation
dl_tensor DLTensor  
manager_ctx *mut std::os::raw::c_void  
deleter Option<unsafe extern "C" fn(*mut DLManagedTensor)>  
Implementations
Trait Implementations

Function dlpack_stream_to_cuda

Map DLPack stream integer to a CUDA stream pointer.

pub fn dlpack_stream_to_cuda(stream: i64) -> *mut std::os::raw::c_void { /* ... */ }

Function synchronize_stream

Attributes:

Safety

stream must be a valid CUDA stream pointer or one of the CUDA sentinel values (legacy/per-thread default). Passing any other pointer is undefined.

pub unsafe fn synchronize_stream(stream: *mut std::os::raw::c_void) -> crate::error::Result<()> { /* ... */ }

Function dlpack_deleter

Attributes:

Called by PyTorch to free tensor memory

Safety

Frees shape, strides, GPU buffer, and managed tensor. Caller must ensure the pointer is valid and points to a properly initialized DLManagedTensor.

pub unsafe extern "C" fn dlpack_deleter(managed: *mut DLManagedTensor) { /* ... */ }

Constants and Statics

Constant CUDA_STREAM_LEGACY

Attributes:

DLPack CUDA stream sentinel values (legacy/per-thread default). These match cudaStreamLegacy/cudaStreamPerThread in the CUDA runtime.

pub const CUDA_STREAM_LEGACY: *mut std::os::raw::c_void = _;

Constant CUDA_STREAM_PER_THREAD

Attributes:

pub const CUDA_STREAM_PER_THREAD: *mut std::os::raw::c_void = _;

Constant DL_INT

Attributes:

pub const DL_INT: u8 = 0;

Constant DL_UINT

Attributes:

pub const DL_UINT: u8 = 1;

Constant DL_FLOAT

Attributes:

pub const DL_FLOAT: u8 = 2;

Constant DL_BFLOAT

Attributes:

pub const DL_BFLOAT: u8 = 4;

Constant DL_COMPLEX

pub const DL_COMPLEX: u8 = 5;

Module error

pub mod error { /* ... */ }

Types

Enum MahoutError

Error types for Mahout QDP operations

pub enum MahoutError {
    Cuda(String),
    InvalidInput(String),
    MemoryAllocation(String),
    KernelLaunch(String),
    DLPack(String),
    Io(String),
    NotImplemented(String),
}
Variants
Cuda

Fields:

Index Type Documentation
0 String  
InvalidInput

Fields:

Index Type Documentation
0 String  
MemoryAllocation

Fields:

Index Type Documentation
0 String  
KernelLaunch

Fields:

Index Type Documentation
0 String  
DLPack

Fields:

Index Type Documentation
0 String  
Io

Fields:

Index Type Documentation
0 String  
NotImplemented

Fields:

Index Type Documentation
0 String  
Implementations
Trait Implementations

Result type alias for Mahout operations

pub type Result<T> = std::result::Result<T, MahoutError>;

Functions

Function cuda_error_to_string

Attributes:

Convert CUDA error code to human-readable string

pub fn cuda_error_to_string(code: i32) -> &''static str { /* ... */ }

Module gpu

pub mod gpu { /* ... */ }

Modules

Module buffer_pool

Attributes:

Reusable pool of pinned host buffers for staging Disk → Host → GPU transfers. Intended for producer/consumer pipelines that need a small, fixed set of page-locked buffers to avoid repeated cudaHostAlloc / cudaFreeHost.

pub mod buffer_pool { /* ... */ }

Types

Struct PinnedBufferHandle

Attributes:

Handle that automatically returns a buffer to the pool on drop.

pub struct PinnedBufferHandle {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Trait Implementations

Attributes:

Pool of pinned host buffers sized for a fixed batch shape.

pub struct PinnedBufferPool {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations
pub mod encodings { /* ... */ }

Modules

Module amplitude

Attributes:

pub mod amplitude { /* ... */ }

Types

Struct AmplitudeEncoder

Amplitude encoding: data → normalized quantum amplitudes

Steps: L2 norm (CPU) → GPU allocation → CUDA kernel (normalize + pad) Fast: ~50-100x vs circuit-based methods

pub struct AmplitudeEncoder;
Implementations
Methods
Trait Implementations

Attributes:

pub mod angle { /* ... */ }

Types

Struct AngleEncoder

Angle encoding: each qubit uses one rotation angle to form a product state.

pub struct AngleEncoder;
Implementations
Trait Implementations

Attributes:

pub mod basis { /* ... */ }

Types

Struct BasisEncoder

Basis encoding: maps an integer index to a computational basis state.

For n qubits, maps integer i (0 ≤ i < 2^n) to |i⟩, where:

Example: index 3 with 3 qubits → 011⟩ (binary representation of 3)

Input format:

pub struct BasisEncoder;
Implementations
Trait Implementations
pub mod iqp { /* ... */ }

Types

Struct IqpEncoder

IQP encoding: creates entangled quantum states using diagonal phase gates.

Two variants are supported:

pub struct IqpEncoder {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Trait QuantumEncoder

Quantum encoding strategy interface Implemented by: AmplitudeEncoder, AngleEncoder, BasisEncoder

pub trait QuantumEncoder: Send + Sync {
    /* Associated items */
}
Required Items
Required Methods
Provided Methods
Implementations

This trait is implemented for the following types:

Functions

Function validate_qubit_count

Validates qubit count against practical limits.

Checks:

Arguments

Returns

pub fn validate_qubit_count(num_qubits: usize) -> crate::error::Result<()> { /* ... */ }

Function get_encoder

Create encoder by name: “amplitude”, “angle”, “basis”, “iqp”, or “iqp-z”

pub fn get_encoder(name: &str) -> crate::error::Result<Box<dyn QuantumEncoder>> { /* ... */ }

Constants and Statics

Constant MAX_QUBITS

Maximum number of qubits supported (16GB GPU memory limit) This constant must match MAX_QUBITS in qdp-kernels/src/kernel_config.h

pub const MAX_QUBITS: usize = 30;

Re-exports

Re-export AmplitudeEncoder

pub use amplitude::AmplitudeEncoder;

Re-export AngleEncoder

pub use angle::AngleEncoder;

Re-export BasisEncoder

pub use basis::BasisEncoder;

Re-export IqpEncoder

pub use iqp::IqpEncoder;

Module memory

Attributes:

pub mod memory { /* ... */ }

Types

Enum Precision

Precision of the GPU state vector.

pub enum Precision {
    Float32,
    Float64,
}
Variants
Float32
Float64
Implementations
Trait Implementations

RAII wrapper for GPU memory buffer Automatically frees GPU memory when dropped

pub struct GpuBufferRaw<T> {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Storage wrapper for precision-specific GPU buffers

pub enum BufferStorage {
    F32(GpuBufferRaw<qdp_kernels::CuComplex>),
    F64(GpuBufferRaw<qdp_kernels::CuDoubleComplex>),
}
Variants
F32

Fields:

Index Type Documentation
0 GpuBufferRaw<qdp_kernels::CuComplex>  
F64

Fields:

Index Type Documentation
0 GpuBufferRaw<qdp_kernels::CuDoubleComplex>  
Implementations
Trait Implementations

Quantum state vector on GPU

Manages complex array of size 2^n (n = qubits) in GPU memory. Uses Arc for shared ownership (needed for DLPack/PyTorch integration). Thread-safe: Send + Sync

pub struct GpuStateVector {
    pub num_qubits: usize,
    pub size_elements: usize,
    pub device_id: usize,
    // Some fields omitted
}
Fields
Name Type Documentation
num_qubits usize  
size_elements usize  
device_id usize CUDA device ordinal
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Attributes:

Pinned Host Memory Buffer (owned allocation).

Allocates page-locked memory to maximize H2D throughput in streaming IO paths.

pub struct PinnedHostBuffer {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Attributes:

Overlap tracking for H2D copy and compute operations.

Uses CUDA events to measure the overlap between host-to-device copy operations and compute operations, enabling verification of the >60% overlap target.

pub mod overlap_tracker { /* ... */ }

Types

Struct OverlapTracker

Tracks overlap between H2D copy and compute operations using CUDA events.

Creates events for each pool slot to track copy and compute start/end times. Can be optionally enabled via environment variable to minimize overhead when disabled.

pub struct OverlapTracker {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Attributes:

pub mod pipeline { /* ... */ }

Types

Struct PipelineContext

Attributes:

Dual-stream context coordinating copy/compute with an event.

pub struct PipelineContext {
    pub stream_compute: cudarc::driver::safe::CudaStream,
    pub stream_copy: cudarc::driver::safe::CudaStream,
    // Some fields omitted
}
Fields
Name Type Documentation
stream_compute cudarc::driver::safe::CudaStream  
stream_copy cudarc::driver::safe::CudaStream  
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Function run_dual_stream_pipeline

Attributes:

Executes a task using dual-stream double-buffering pattern

This function handles the generic pipeline mechanics:

The caller provides a kernel_launcher closure that handles the specific kernel launch logic for each chunk.

Arguments

Environment Variables

Example

run_dual_stream_pipeline(device, host_data, |stream, input_ptr, offset, len| {
    // Launch your specific kernel here
    launch_my_kernel(input_ptr, offset, len, stream)?;
    Ok(())
})?;
pub fn run_dual_stream_pipeline<F>(device: &std::sync::Arc<cudarc::driver::CudaDevice>, host_data: &[f64], kernel_launcher: F) -> crate::error::Result<()>
where
    F: FnMut(&cudarc::driver::safe::CudaStream, *const f64, usize, usize) -> crate::error::Result<()> { /* ... */ }

Function run_dual_stream_pipeline_aligned

Attributes:

Executes a task using dual-stream double-buffering with aligned chunk boundaries.

align_elements must evenly divide the host data length and ensures chunks do not split logical records (e.g., per-sample data in batch encoding).

pub fn run_dual_stream_pipeline_aligned<F>(device: &std::sync::Arc<cudarc::driver::CudaDevice>, host_data: &[f64], align_elements: usize, kernel_launcher: F) -> crate::error::Result<()>
where
    F: FnMut(&cudarc::driver::safe::CudaStream, *const f64, usize, usize) -> crate::error::Result<()> { /* ... */ }

Module pool_metrics

Attributes:

Pool utilization metrics for diagnosing pool starvation.

Provides lightweight, thread-safe metrics tracking for pinned buffer pool utilization. Uses lock-free atomic operations to minimize performance impact.

pub mod pool_metrics { /* ... */ }

Types

Struct PoolMetrics

Pool utilization metrics (thread-safe, lock-free design)

Tracks pool availability, acquire operations, and wait times to diagnose pool starvation issues. Uses atomic operations with Relaxed ordering for minimal performance overhead.

pub struct PoolMetrics {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Pool utilization report containing aggregated metrics.

pub struct PoolUtilizationReport {
    pub min_available: usize,
    pub max_available: usize,
    pub total_acquires: u64,
    pub total_waits: u64,
    pub starvation_ratio: f64,
    pub avg_wait_time_ns: u64,
}
Fields
Name Type Documentation
min_available usize Minimum number of buffers available during any acquire operation
max_available usize Maximum number of buffers available during any acquire operation
total_acquires u64 Total number of acquire operations
total_waits u64 Total number of wait operations (pool was empty)
starvation_ratio f64 Ratio of waits to acquires (starvation ratio)
avg_wait_time_ns u64 Average wait time in nanoseconds
Implementations
Methods
Trait Implementations

Re-export PinnedBufferHandle

Attributes:

pub use buffer_pool::PinnedBufferHandle;

Re-export PinnedBufferPool

Attributes:

pub use buffer_pool::PinnedBufferPool;

Re-export AmplitudeEncoder

pub use encodings::AmplitudeEncoder;

Re-export AngleEncoder

pub use encodings::AngleEncoder;

Re-export BasisEncoder

pub use encodings::BasisEncoder;

Re-export QuantumEncoder

pub use encodings::QuantumEncoder;

Re-export get_encoder

pub use encodings::get_encoder;

Re-export GpuStateVector

pub use memory::GpuStateVector;

Re-export run_dual_stream_pipeline

Attributes:

pub use pipeline::run_dual_stream_pipeline;

Re-export OverlapTracker

Attributes:

pub use overlap_tracker::OverlapTracker;

Re-export PipelineContext

Attributes:

pub use pipeline::PipelineContext;

Re-export PoolMetrics

Attributes:

pub use pool_metrics::PoolMetrics;

Re-export PoolUtilizationReport

Attributes:

pub use pool_metrics::PoolUtilizationReport;

Module io

I/O utilities for reading and writing quantum data.

Provides efficient columnar data exchange via Apache Arrow and Parquet formats.

TODO

Consider using generic T: ArrowPrimitiveType instead of hardcoded Float64Array to support both Float32 and Float64 for flexibility in precision vs performance trade-offs.

pub mod io { /* ... */ }

Types

Type Alias ParquetBlockReader

Streaming Parquet reader for List and FixedSizeList columns

Reads Parquet files in chunks without loading entire file into memory. Supports efficient streaming for large files via Producer-Consumer pattern.

This is a type alias for backward compatibility. Use [crate::readers::ParquetStreamingReader] directly.

pub type ParquetBlockReader = crate::readers::ParquetStreamingReader;

Functions

Function arrow_to_vec

Converts an Arrow Float64Array to Vec.

pub fn arrow_to_vec(array: &arrow::array::Float64Array) -> Vec<f64> { /* ... */ }

Function arrow_to_vec_chunked

Flattens multiple Arrow Float64Arrays into a single Vec.

pub fn arrow_to_vec_chunked(arrays: &[arrow::array::Float64Array]) -> Vec<f64> { /* ... */ }

Function read_parquet

Reads Float64 data from a Parquet file.

Expects a single Float64 column. For zero-copy access, use [read_parquet_to_arrow].

pub fn read_parquet<P: AsRef<std::path::Path>>(path: P) -> crate::error::Result<Vec<f64>> { /* ... */ }

Function write_parquet

Writes Float64 data to a Parquet file.

Arguments

pub fn write_parquet<P: AsRef<std::path::Path>>(path: P, data: &[f64], column_name: Option<&str>) -> crate::error::Result<()> { /* ... */ }

Function read_parquet_to_arrow

Reads a Parquet file as Arrow Float64Arrays.

Returns one array per row group for zero-copy access.

pub fn read_parquet_to_arrow<P: AsRef<std::path::Path>>(path: P) -> crate::error::Result<Vec<arrow::array::Float64Array>> { /* ... */ }

Function write_arrow_to_parquet

Writes an Arrow Float64Array to a Parquet file.

Arguments

pub fn write_arrow_to_parquet<P: AsRef<std::path::Path>>(path: P, array: &arrow::array::Float64Array, column_name: Option<&str>) -> crate::error::Result<()> { /* ... */ }

Function read_parquet_batch

Reads batch data from a Parquet file with List<Float64> column format.

Returns flattened data suitable for batch encoding.

Returns

Tuple of (flattened_data, num_samples, sample_size)

TODO

Add OOM protection for very large files

pub fn read_parquet_batch<P: AsRef<std::path::Path>>(path: P) -> crate::error::Result<(Vec<f64>, usize, usize)> { /* ... */ }

Function read_arrow_ipc_batch

Reads batch data from an Arrow IPC file.

Supports FixedSizeList<Float64> and List<Float64> column formats. Returns flattened data suitable for batch encoding.

Returns

Tuple of (flattened_data, num_samples, sample_size)

TODO

Add OOM protection for very large files

pub fn read_arrow_ipc_batch<P: AsRef<std::path::Path>>(path: P) -> crate::error::Result<(Vec<f64>, usize, usize)> { /* ... */ }

Function read_numpy_batch

Reads batch data from a NumPy .npy file.

Expects a 2D array with shape [num_samples, sample_size] and dtype float64. Returns flattened data suitable for batch encoding.

Returns

Tuple of (flattened_data, num_samples, sample_size)

Example

let (data, num_samples, sample_size) = read_numpy_batch("quantum_states.npy")?;
pub fn read_numpy_batch<P: AsRef<std::path::Path>>(path: P) -> crate::error::Result<(Vec<f64>, usize, usize)> { /* ... */ }

Function read_torch_batch

Reads batch data from a PyTorch .pt/.pth file.

Expects a 1D or 2D tensor saved with torch.save. Returns flattened data suitable for batch encoding. Requires the pytorch feature to be enabled.

Returns

Tuple of (flattened_data, num_samples, sample_size)

pub fn read_torch_batch<P: AsRef<std::path::Path>>(path: P) -> crate::error::Result<(Vec<f64>, usize, usize)> { /* ... */ }

Function read_tensorflow_batch

Reads batch data from a TensorFlow TensorProto file.

Supports Float64 tensors with shape [batch_size, feature_size] or [n]. Prefers tensor_content for efficient parsing, but still requires one copy to Vec.

Byte Order

Assumes little-endian byte order (standard on x86_64).

Returns

Tuple of (flattened_data, num_samples, sample_size)

TODO

Add OOM protection for very large files

pub fn read_tensorflow_batch<P: AsRef<std::path::Path>>(path: P) -> crate::error::Result<(Vec<f64>, usize, usize)> { /* ... */ }

Module preprocessing

pub mod preprocessing { /* ... */ }

Types

Struct Preprocessor

Shared CPU-based pre-processing pipeline for quantum encoding.

Centralizes validation, normalization, and data preparation steps to ensure consistency across different encoding strategies and backends.

pub struct Preprocessor;
Implementations
Methods
Trait Implementations

Generic data reader interface for multiple input formats.

This module provides a trait-based architecture for reading quantum data from various sources (Parquet, Arrow IPC, NumPy, PyTorch, etc.) in a unified way without sacrificing performance or memory efficiency.

Architecture

The reader system is based on two main traits:

Example: Adding a New Format

To add support for a new format (e.g., NumPy):

use qdp_core::reader::{DataReader, Result};

pub struct NumpyReader {
    // format-specific fields
}

impl DataReader for NumpyReader {
    fn read_batch(&mut self) -> Result<(Vec<f64>, usize, usize)> {
        // implementation
    }
}
pub mod reader { /* ... */ }

Traits

Trait DataReader

Generic data reader interface for batch quantum data.

Implementations should read data in the format:

This interface enables zero-copy streaming where possible and maintains memory efficiency for large datasets.

pub trait DataReader {
    /* Associated items */
}
Required Items
Required Methods
Provided Methods
Implementations

This trait is implemented for the following types:

Trait StreamingDataReader

Streaming data reader interface for large datasets.

This trait enables chunk-by-chunk reading for datasets that don’t fit in memory, maintaining constant memory usage regardless of file size.

pub trait StreamingDataReader: DataReader {
    /* Associated items */
}
Required Items
Required Methods
Implementations

This trait is implemented for the following types:

Module readers

Format-specific data reader implementations.

This module contains concrete implementations of the DataReader and StreamingDataReader traits for various file formats.

Fully Implemented Formats

pub mod readers { /* ... */ }

Modules

Module arrow_ipc

Arrow IPC format reader implementation.

pub mod arrow_ipc { /* ... */ }

Types

Struct ArrowIPCReader

Reader for Arrow IPC files containing FixedSizeList or List columns.

pub struct ArrowIPCReader {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

NumPy format reader implementation.

Provides support for reading .npy files containing 2D float64 arrays.

pub mod numpy { /* ... */ }

Types

Struct NumpyReader

Reader for NumPy .npy files containing 2D float64 arrays.

Expected Format

Example

use qdp_core::reader::DataReader;
use qdp_core::readers::NumpyReader;

let mut reader = NumpyReader::new("data.npy").unwrap();
let (data, num_samples, sample_size) = reader.read_batch().unwrap();
println!("Read {} samples of size {}", num_samples, sample_size);
pub struct NumpyReader {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Parquet format reader implementation.

pub mod parquet { /* ... */ }

Types

Struct ParquetReader

Reader for Parquet files containing List or FixedSizeList columns.

pub struct ParquetReader {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Streaming Parquet reader for List and FixedSizeList columns.

Reads Parquet files in chunks without loading entire file into memory. Supports efficient streaming for large files via Producer-Consumer pattern.

pub struct ParquetStreamingReader {
    pub total_rows: usize,
    // Some fields omitted
}
Fields
Name Type Documentation
total_rows usize  
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

TensorFlow TensorProto format reader implementation.

pub mod tensorflow { /* ... */ }

Types

Struct TensorFlowReader

Reader for TensorFlow TensorProto files.

Supports Float64 tensors with shape [batch_size, feature_size] or [n]. Prefers tensor_content for efficient parsing, but still requires one copy to Vec.

Byte Order

This implementation assumes little-endian byte order, which is the standard on x86_64 platforms. TensorFlow typically uses host byte order.

pub struct TensorFlowReader {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

PyTorch tensor reader implementation.

Supports .pt/.pth files containing a single tensor saved with torch.save. The tensor must be 1D or 2D and will be converted to float64. Requires the pytorch feature to be enabled.

pub mod torch { /* ... */ }

Types

Struct TorchReader

Reader for PyTorch .pt/.pth tensor files.

pub struct TorchReader {
    // Some fields omitted
}
Fields
Name Type Documentation
private fields Some fields have been omitted
Implementations
Methods
Trait Implementations

Re-export ArrowIPCReader

pub use arrow_ipc::ArrowIPCReader;

Re-export NumpyReader

pub use numpy::NumpyReader;

Re-export ParquetReader

pub use parquet::ParquetReader;

Re-export ParquetStreamingReader

pub use parquet::ParquetStreamingReader;

Re-export TensorFlowReader

pub use tensorflow::TensorFlowReader;

Re-export TorchReader

pub use torch::TorchReader;

Module tf_proto

TensorFlow TensorProto protobuf definitions.

This module contains the generated protobuf code for TensorFlow TensorProto format. The code is generated at build time by prost-build from proto/tensor.proto.

pub mod tf_proto { /* ... */ }

Modules

Module tensorflow

pub mod tensorflow { /* ... */ }

Types

Struct TensorProto

Attributes:

TensorProto - only define necessary fields, field numbers match TensorFlow official

pub struct TensorProto {
    pub dtype: i32,
    pub tensor_shape: ::core::option::Option<TensorShapeProto>,
    pub tensor_content: ::prost::bytes::Bytes,
    pub double_val: ::prost::alloc::vec::Vec<f64>,
}
Fields
Name Type Documentation
dtype i32 Field 1: dtype (enum DataType in TF, but varint in wire format)
DT_DOUBLE = 2 (see tensorflow/core/framework/types.proto)
tensor_shape ::core::option::Option<TensorShapeProto> Field 2: tensor_shape
tensor_content ::prost::bytes::Bytes Field 4: tensor_content (preferred for efficient parsing)
double_val ::prost::alloc::vec::Vec<f64> Field 6: double_val (fallback, only used when tensor_content is empty)
Implementations
Trait Implementations

Attributes:

pub struct TensorShapeProto {
    pub dim: ::prost::alloc::vec::Vec<Dim>,
    pub unknown_rank: bool,
}
Fields
Name Type Documentation
dim ::prost::alloc::vec::Vec<Dim> Field 2: dim (field number matches official)
unknown_rank bool Field 3: unknown_rank (optional; helps with better error messages)
Implementations
Trait Implementations

Attributes:

pub struct Dim {
    pub size: i64,
}
Fields
Name Type Documentation
size i64 Field 1: size

Skip name field (field number 2) to reduce parsing overhead
Implementations
Trait Implementations

Struct QdpEngine

Main entry point for Mahout QDP

Manages GPU context and dispatches encoding tasks. Provides unified interface for device management, memory allocation, and DLPack.

pub struct QdpEngine {
    // Some fields omitted
}

Fields

Name Type Documentation
private fields Some fields have been omitted

Implementations

Methods
Trait Implementations

Macro profile_scope

Attributes:

No-op version when observability is disabled

Compiler eliminates this completely, zero runtime cost.

pub macro_rules! profile_scope {
    /* macro_rules! profile_scope {
    ($name:expr) => { ... };
} */
}

Macro profile_mark

Attributes:

No-op version when observability is disabled

pub macro_rules! profile_mark {
    /* macro_rules! profile_mark {
    ($name:expr) => { ... };
} */
}

Re-exports

Re-export MahoutError

pub use error::MahoutError;

Re-export Result

pub use error::Result;

Re-export cuda_error_to_string

Attributes:

pub use error::cuda_error_to_string;

Re-export Precision

pub use gpu::memory::Precision;

Re-export DataSource

Attributes:

pub use pipeline_runner::DataSource;

Re-export PipelineConfig

Attributes:

pub use pipeline_runner::PipelineConfig;

Re-export PipelineIterator

Attributes:

pub use pipeline_runner::PipelineIterator;

Re-export PipelineRunResult

Attributes:

pub use pipeline_runner::PipelineRunResult;

Re-export run_latency_pipeline

Attributes:

pub use pipeline_runner::run_latency_pipeline;

Re-export run_throughput_pipeline

Attributes:

pub use pipeline_runner::run_throughput_pipeline;

Re-export QuantumEncoder

pub use gpu::QuantumEncoder;