Version: 0.2.0
Format Version: 57
qdp_coredlpackpub mod dlpack { /* ... */ }
DLDeviceTypeAttributes:
Other("#[allow(non_camel_case_types)]")Repr(AttributeRepr { kind: C, align: None, packed: None, int: None })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,
}
kDLCPUDiscriminant: 1
Discriminant value: 1
kDLCUDADiscriminant: 2
Discriminant value: 2
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn clone(self: &Self) -> DLDeviceType { /* ... */ }
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ }
fn equivalent(self: &Self, key: &K) -> bool { /* ... */ }
fn equivalent(self: &Self, key: &K) -> bool { /* ... */ }
fn equivalent(self: &Self, key: &K) -> bool { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
fn eq(self: &Self, other: &DLDeviceType) -> bool { /* ... */ }
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn to_owned(self: &Self) -> T { /* ... */ }
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
DLDeviceAttributes:
Repr(AttributeRepr { kind: C, align: None, packed: None, int: None })pub struct DLDevice {
pub device_type: DLDeviceType,
pub device_id: std::os::raw::c_int,
}
| Name | Type | Documentation |
|---|---|---|
device_type |
DLDeviceType |
|
device_id |
std::os::raw::c_int |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
DLDataTypeAttributes:
Repr(AttributeRepr { kind: C, align: None, packed: None, int: None })pub struct DLDataType {
pub code: u8,
pub bits: u8,
pub lanes: u16,
}
| Name | Type | Documentation |
|---|---|---|
code |
u8 |
|
bits |
u8 |
|
lanes |
u16 |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
DLTensorAttributes:
Repr(AttributeRepr { kind: C, align: None, packed: None, int: None })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,
}
| 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 |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
DLManagedTensorAttributes:
Repr(AttributeRepr { kind: C, align: None, packed: None, int: None })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)>,
}
| Name | Type | Documentation |
|---|---|---|
dl_tensor |
DLTensor |
|
manager_ctx |
*mut std::os::raw::c_void |
|
deleter |
Option<unsafe extern "C" fn(*mut DLManagedTensor)> |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
dlpack_stream_to_cudaMap DLPack stream integer to a CUDA stream pointer.
pub fn dlpack_stream_to_cuda(stream: i64) -> *mut std::os::raw::c_void { /* ... */ }
synchronize_streamAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/dlpack.rs:48:7: 48:26 (#0) }])]")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<()> { /* ... */ }
dlpack_deleterAttributes:
Other("#[allow(unsafe_op_in_unsafe_fn)]")Called by PyTorch to free tensor memory
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) { /* ... */ }
CUDA_STREAM_LEGACYAttributes:
Other("#[allow(clippy::manual_dangling_ptr)]")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 = _;
CUDA_STREAM_PER_THREADAttributes:
Other("#[allow(clippy::manual_dangling_ptr)]")pub const CUDA_STREAM_PER_THREAD: *mut std::os::raw::c_void = _;
DL_INTAttributes:
Other("#[allow(dead_code)]")pub const DL_INT: u8 = 0;
DL_UINTAttributes:
Other("#[allow(dead_code)]")pub const DL_UINT: u8 = 1;
DL_FLOATAttributes:
Other("#[allow(dead_code)]")pub const DL_FLOAT: u8 = 2;
DL_BFLOATAttributes:
Other("#[allow(dead_code)]")pub const DL_BFLOAT: u8 = 4;
DL_COMPLEXpub const DL_COMPLEX: u8 = 5;
errorpub mod error { /* ... */ }
MahoutErrorError types for Mahout QDP operations
pub enum MahoutError {
Cuda(String),
InvalidInput(String),
MemoryAllocation(String),
KernelLaunch(String),
DLPack(String),
Io(String),
NotImplemented(String),
}
CudaFields:
| Index | Type | Documentation |
|---|---|---|
| 0 | String |
InvalidInputFields:
| Index | Type | Documentation |
|---|---|---|
| 0 | String |
MemoryAllocationFields:
| Index | Type | Documentation |
|---|---|---|
| 0 | String |
KernelLaunchFields:
| Index | Type | Documentation |
|---|---|---|
| 0 | String |
DLPackFields:
| Index | Type | Documentation |
|---|---|---|
| 0 | String |
IoFields:
| Index | Type | Documentation |
|---|---|---|
| 0 | String |
NotImplementedFields:
| Index | Type | Documentation |
|---|---|---|
| 0 | String |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ }
fn fmt(self: &Self, __formatter: &mut ::core::fmt::Formatter<''_>) -> ::core::fmt::Result { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn to_string(self: &Self) -> String { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
ResultResult type alias for Mahout operations
pub type Result<T> = std::result::Result<T, MahoutError>;
cuda_error_to_stringAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/error.rs:48:7: 48:26 (#0) }])]")Convert CUDA error code to human-readable string
pub fn cuda_error_to_string(code: i32) -> &''static str { /* ... */ }
gpupub mod gpu { /* ... */ }
buffer_poolAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:17:7: 17:26 (#0) }])]")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 { /* ... */ }
PinnedBufferHandleAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/buffer_pool.rs:30:7: 30:26 (#0) }])]")Handle that automatically returns a buffer to the pool on drop.
pub struct PinnedBufferHandle {
// Some fields omitted
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn deref(self: &Self) -> &<Self as >::Target { /* ... */ }
fn deref_mut(self: &mut Self) -> &mut <Self as >::Target { /* ... */ }
fn drop(self: &mut Self) { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
PinnedBufferPoolAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/buffer_pool.rs:68:7: 68:26 (#0) }])]")Pool of pinned host buffers sized for a fixed batch shape.
pub struct PinnedBufferPool {
// Some fields omitted
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new(pool_size: usize, elements_per_buffer: usize) -> Result<Arc<Self>> { /* ... */ }
Create a pool with pool_size pinned buffers, each sized for elements_per_buffer f64 values.
pub fn acquire(self: &Arc<Self>) -> PinnedBufferHandle { /* ... */ }
Acquire a pinned buffer, blocking until one is available.
pub fn acquire_with_metrics(self: &Arc<Self>, metrics: Option<&PoolMetrics>) -> PinnedBufferHandle { /* ... */ }
Acquire a pinned buffer with optional metrics tracking.
pub fn try_acquire(self: &Arc<Self>) -> Option<PinnedBufferHandle> { /* ... */ }
Try to acquire a pinned buffer from the pool.
pub fn available(self: &Self) -> usize { /* ... */ }
Number of buffers currently available.
pub fn capacity(self: &Self) -> usize { /* ... */ }
Total number of buffers managed by this pool.
pub fn elements_per_buffer(self: &Self) -> usize { /* ... */ }
Fixed element capacity for each buffer in the pool.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
encodingspub mod encodings { /* ... */ }
amplitudeAttributes:
Other("#[allow(unused_unsafe)]")pub mod amplitude { /* ... */ }
AmplitudeEncoderAmplitude 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;
pub unsafe fn calculate_inv_norm_gpu_f32(device: &Arc<CudaDevice>, input_ptr: *const f32, len: usize) -> Result<f32> { /* ... */ }
Compute inverse L2 norm on GPU for float32 input using the reduction kernel.
pub unsafe fn calculate_inv_norm_gpu_f32_with_stream(device: &Arc<CudaDevice>, input_ptr: *const f32, len: usize, stream: *mut c_void) -> Result<f32> { /* ... */ }
Compute inverse L2 norm on GPU for float32 input on a given stream.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn encode(self: &Self, _device: &Arc<CudaDevice>, host_data: &[f64], num_qubits: usize) -> Result<GpuStateVector> { /* ... */ }
fn encode_batch(self: &Self, device: &Arc<CudaDevice>, batch_data: &[f64], num_samples: usize, sample_size: usize, num_qubits: usize) -> Result<GpuStateVector> { /* ... */ }
Encode multiple samples in a single GPU allocation and kernel launch
unsafe fn encode_from_gpu_ptr(self: &Self, device: &Arc<CudaDevice>, input_d: *const c_void, input_len: usize, num_qubits: usize, stream: *mut c_void) -> Result<GpuStateVector> { /* ... */ }
unsafe fn encode_batch_from_gpu_ptr(self: &Self, device: &Arc<CudaDevice>, input_batch_d: *const c_void, num_samples: usize, sample_size: usize, num_qubits: usize, stream: *mut c_void) -> Result<GpuStateVector> { /* ... */ }
fn name(self: &Self) -> &''static str { /* ... */ }
fn description(self: &Self) -> &''static str { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
angleAttributes:
Other("#[allow(unused_unsafe)]")pub mod angle { /* ... */ }
AngleEncoderAngle encoding: each qubit uses one rotation angle to form a product state.
pub struct AngleEncoder;
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn encode(self: &Self, device: &Arc<CudaDevice>, data: &[f64], num_qubits: usize) -> Result<GpuStateVector> { /* ... */ }
fn encode_batch(self: &Self, device: &Arc<CudaDevice>, batch_data: &[f64], num_samples: usize, sample_size: usize, num_qubits: usize) -> Result<GpuStateVector> { /* ... */ }
Encode multiple angle samples in a single GPU allocation and kernel launch
unsafe fn encode_from_gpu_ptr(self: &Self, device: &Arc<CudaDevice>, input_d: *const c_void, input_len: usize, num_qubits: usize, stream: *mut c_void) -> Result<GpuStateVector> { /* ... */ }
unsafe fn encode_batch_from_gpu_ptr(self: &Self, device: &Arc<CudaDevice>, input_batch_d: *const c_void, num_samples: usize, sample_size: usize, num_qubits: usize, stream: *mut c_void) -> Result<GpuStateVector> { /* ... */ }
fn validate_input(self: &Self, data: &[f64], num_qubits: usize) -> Result<()> { /* ... */ }
fn name(self: &Self) -> &''static str { /* ... */ }
fn description(self: &Self) -> &''static str { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
basisAttributes:
Other("#[allow(unused_unsafe)]")pub mod basis { /* ... */ }
BasisEncoderBasis 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;
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn encode(self: &Self, device: &Arc<CudaDevice>, data: &[f64], num_qubits: usize) -> Result<GpuStateVector> { /* ... */ }
fn encode_batch(self: &Self, device: &Arc<CudaDevice>, batch_data: &[f64], num_samples: usize, sample_size: usize, num_qubits: usize) -> Result<GpuStateVector> { /* ... */ }
Encode multiple basis indices in a single GPU allocation and kernel launch
unsafe fn encode_from_gpu_ptr(self: &Self, device: &Arc<CudaDevice>, input_d: *const c_void, input_len: usize, num_qubits: usize, stream: *mut c_void) -> Result<GpuStateVector> { /* ... */ }
unsafe fn encode_batch_from_gpu_ptr(self: &Self, device: &Arc<CudaDevice>, input_batch_d: *const c_void, num_samples: usize, sample_size: usize, num_qubits: usize, stream: *mut c_void) -> Result<GpuStateVector> { /* ... */ }
fn validate_input(self: &Self, data: &[f64], num_qubits: usize) -> Result<()> { /* ... */ }
fn name(self: &Self) -> &''static str { /* ... */ }
fn description(self: &Self) -> &''static str { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
iqppub mod iqp { /* ... */ }
IqpEncoderIQP encoding: creates entangled quantum states using diagonal phase gates.
Two variants are supported:
enable_zz = false: Single-qubit Z rotations only (n parameters)enable_zz = true: Full ZZ interactions (n + n*(n-1)/2 parameters)pub struct IqpEncoder {
// Some fields omitted
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn full() -> Self { /* ... */ }
Create an IQP encoder with full ZZ interactions.
pub fn z_only() -> Self { /* ... */ }
Create an IQP encoder with single-qubit Z rotations only.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn encode(self: &Self, device: &Arc<CudaDevice>, data: &[f64], num_qubits: usize) -> Result<GpuStateVector> { /* ... */ }
fn encode_batch(self: &Self, device: &Arc<CudaDevice>, batch_data: &[f64], num_samples: usize, sample_size: usize, num_qubits: usize) -> Result<GpuStateVector> { /* ... */ }
Encode multiple IQP samples in a single GPU allocation and kernel launch
fn validate_input(self: &Self, data: &[f64], num_qubits: usize) -> Result<()> { /* ... */ }
fn name(self: &Self) -> &''static str { /* ... */ }
fn description(self: &Self) -> &''static str { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
QuantumEncoderQuantum encoding strategy interface Implemented by: AmplitudeEncoder, AngleEncoder, BasisEncoder
pub trait QuantumEncoder: Send + Sync {
/* Associated items */
}
encode: Encode classical data to quantum state on GPUname: Strategy namedescription: Strategy descriptionfn encode_batch(self: &Self, _device: &Arc<CudaDevice>, _batch_data: &[f64], _num_samples: usize, _sample_size: usize, _num_qubits: usize) -> Result<GpuStateVector> { /* ... */ }
Encode multiple samples in a single GPU allocation and kernel launch (Batch Encoding)
fn validate_input(self: &Self, data: &[f64], num_qubits: usize) -> Result<()> { /* ... */ }
Validate input data before encoding
unsafe fn encode_from_gpu_ptr(self: &Self, _device: &Arc<CudaDevice>, _input_d: *const c_void, _input_len: usize, _num_qubits: usize, _stream: *mut c_void) -> Result<GpuStateVector> { /* ... */ }
Encode from existing GPU pointer (zero-copy). Default: not supported.
unsafe fn encode_batch_from_gpu_ptr(self: &Self, _device: &Arc<CudaDevice>, _input_batch_d: *const c_void, _num_samples: usize, _sample_size: usize, _num_qubits: usize, _stream: *mut c_void) -> Result<GpuStateVector> { /* ... */ }
Encode batch from existing GPU pointer (zero-copy). Default: not supported.
This trait is implemented for the following types:
AmplitudeEncoderAngleEncoderBasisEncoderIqpEncodervalidate_qubit_countValidates qubit count against practical limits.
Checks:
num_qubits - The number of qubits to validateOk(()) if the qubit count is validErr(MahoutError::InvalidInput) if the qubit count is invalidpub fn validate_qubit_count(num_qubits: usize) -> crate::error::Result<()> { /* ... */ }
get_encoderCreate encoder by name: “amplitude”, “angle”, “basis”, “iqp”, or “iqp-z”
pub fn get_encoder(name: &str) -> crate::error::Result<Box<dyn QuantumEncoder>> { /* ... */ }
MAX_QUBITSMaximum 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;
AmplitudeEncoderpub use amplitude::AmplitudeEncoder;
AngleEncoderpub use angle::AngleEncoder;
BasisEncoderpub use basis::BasisEncoder;
IqpEncoderpub use iqp::IqpEncoder;
memoryAttributes:
Other("#[allow(unused_unsafe)]")pub mod memory { /* ... */ }
PrecisionPrecision of the GPU state vector.
pub enum Precision {
Float32,
Float64,
}
Float32Float64fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn clone(self: &Self) -> Precision { /* ... */ }
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ }
fn equivalent(self: &Self, key: &K) -> bool { /* ... */ }
fn equivalent(self: &Self, key: &K) -> bool { /* ... */ }
fn equivalent(self: &Self, key: &K) -> bool { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
fn eq(self: &Self, other: &Precision) -> bool { /* ... */ }
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn to_owned(self: &Self) -> T { /* ... */ }
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
GpuBufferRawRAII wrapper for GPU memory buffer Automatically frees GPU memory when dropped
pub struct GpuBufferRaw<T> {
// Some fields omitted
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn ptr(self: &Self) -> *mut T { /* ... */ }
Get raw pointer to GPU memory
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
BufferStorageStorage wrapper for precision-specific GPU buffers
pub enum BufferStorage {
F32(GpuBufferRaw<qdp_kernels::CuComplex>),
F64(GpuBufferRaw<qdp_kernels::CuDoubleComplex>),
}
F32Fields:
| Index | Type | Documentation |
|---|---|---|
| 0 | GpuBufferRaw<qdp_kernels::CuComplex> |
F64Fields:
| Index | Type | Documentation |
|---|---|---|
| 0 | GpuBufferRaw<qdp_kernels::CuDoubleComplex> |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
GpuStateVectorQuantum 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
}
| Name | Type | Documentation |
|---|---|---|
num_qubits |
usize |
|
size_elements |
usize |
|
device_id |
usize |
CUDA device ordinal |
| private fields | … | Some fields have been omitted |
pub fn to_dlpack(self: &Self) -> *mut DLManagedTensor { /* ... */ }
Convert to DLPack format for PyTorch
pub fn new(_device: &Arc<CudaDevice>, qubits: usize, precision: Precision) -> Result<Self> { /* ... */ }
Create GPU state vector for n qubits with the given precision.
pub fn precision(self: &Self) -> Precision { /* ... */ }
Get current precision of the underlying buffer.
pub fn ptr_void(self: &Self) -> *mut c_void { /* ... */ }
Get raw GPU pointer for DLPack/FFI
pub fn ptr_f64(self: &Self) -> Option<*mut CuDoubleComplex> { /* ... */ }
Returns a double-precision pointer if the buffer stores complex128 data.
pub fn ptr_f32(self: &Self) -> Option<*mut CuComplex> { /* ... */ }
Returns a single-precision pointer if the buffer stores complex64 data.
pub fn num_qubits(self: &Self) -> usize { /* ... */ }
Get the number of qubits
pub fn size_elements(self: &Self) -> usize { /* ... */ }
Get the size in elements (2^n where n is number of qubits)
pub fn new_batch(_device: &Arc<CudaDevice>, num_samples: usize, qubits: usize) -> Result<Self> { /* ... */ }
Create GPU state vector for a batch of samples
pub fn to_precision(self: &Self, device: &Arc<CudaDevice>, target: Precision) -> Result<Self> { /* ... */ }
Convert the state vector to the requested precision (GPU-side).
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn clone(self: &Self) -> GpuStateVector { /* ... */ }
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn to_owned(self: &Self) -> T { /* ... */ }
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
PinnedHostBufferAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/memory.rs:572:7: 572:26 (#0) }])]")Pinned Host Memory Buffer (owned allocation).
Allocates page-locked memory to maximize H2D throughput in streaming IO paths.
pub struct PinnedHostBuffer {
// Some fields omitted
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new(elements: usize) -> Result<Self> { /* ... */ }
Allocate pinned memory
pub fn as_slice_mut(self: &mut Self) -> &mut [f64] { /* ... */ }
Get mutable slice to write data into
pub fn as_slice(self: &Self) -> &[f64] { /* ... */ }
Immutable slice view of the pinned region
pub fn ptr(self: &Self) -> *const f64 { /* ... */ }
Get raw pointer for CUDA memcpy
pub fn len(self: &Self) -> usize { /* ... */ }
pub fn is_empty(self: &Self) -> bool { /* ... */ }
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn drop(self: &mut Self) { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
overlap_trackerAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:23:7: 23:26 (#0) }])]")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 { /* ... */ }
OverlapTrackerTracks 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
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new(pool_size: usize, enabled: bool) -> Result<Self> { /* ... */ }
Create a new OverlapTracker for the given pool size.
pub fn record_copy_start(self: &Self, stream: &CudaStream, slot: usize) -> Result<()> { /* ... */ }
Record the start of a copy operation on the copy stream.
pub fn record_copy_end(self: &Self, stream: &CudaStream, slot: usize) -> Result<()> { /* ... */ }
Record the end of a copy operation on the copy stream.
pub fn record_compute_start(self: &Self, stream: &CudaStream, slot: usize) -> Result<()> { /* ... */ }
Record the start of a compute operation on the compute stream.
pub fn record_compute_end(self: &Self, stream: &CudaStream, slot: usize) -> Result<()> { /* ... */ }
Record the end of a compute operation on the compute stream.
pub fn calculate_overlap(self: &Self, chunk_idx: usize) -> Result<f64> { /* ... */ }
Calculate the overlap ratio for a specific chunk.
pub fn log_overlap(self: &Self, chunk_idx: usize) -> Result<()> { /* ... */ }
Log the overlap ratio for a specific chunk.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn drop(self: &mut Self) { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
pipelineAttributes:
Other("#[allow(unused_unsafe)]")pub mod pipeline { /* ... */ }
PipelineContextAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/pipeline.rs:47:7: 47:26 (#0) }])]")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
}
| Name | Type | Documentation |
|---|---|---|
stream_compute |
cudarc::driver::safe::CudaStream |
|
stream_copy |
cudarc::driver::safe::CudaStream |
|
| private fields | … | Some fields have been omitted |
pub fn new(device: &Arc<CudaDevice>, event_slots: usize) -> Result<Self> { /* ... */ }
pub unsafe fn async_copy_to_device(self: &Self, src: *const c_void, dst: *mut c_void, len_elements: usize) -> Result<()> { /* ... */ }
Async H2D copy on the copy stream.
pub unsafe fn record_copy_done(self: &Self, slot: usize) -> Result<()> { /* ... */ }
Record completion of the copy on the copy stream.
pub unsafe fn wait_for_copy(self: &Self, slot: usize) -> Result<()> { /* ... */ }
Make compute stream wait for the copy completion event.
pub unsafe fn sync_copy_stream(self: &Self) -> Result<()> { /* ... */ }
Sync copy stream (safe to reuse host buffer).
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn drop(self: &mut Self) { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
run_dual_stream_pipelineAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/pipeline.rs:252:7: 252:26 (#0) }])]")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.
device - The CUDA devicehost_data - Full source data to processkernel_launcher - Closure that launches the specific kernel for each chunkQDP_ENABLE_POOL_METRICS - Enable pool utilization metrics (set to “1” or “true”)QDP_ENABLE_OVERLAP_TRACKING - Enable H2D overlap tracking (set to “1” or “true”)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<()> { /* ... */ }
run_dual_stream_pipeline_alignedAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/pipeline.rs:276:7: 276:26 (#0) }])]")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<()> { /* ... */ }
pool_metricsAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:26:7: 26:26 (#0) }])]")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 { /* ... */ }
PoolMetricsPool 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
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new() -> Self { /* ... */ }
Create a new PoolMetrics instance with all counters initialized to zero.
pub fn record_acquire(self: &Self, available: usize) { /* ... */ }
Record an acquire operation with the number of available buffers at that time.
pub fn record_wait(self: &Self, wait_time_ns: u64) { /* ... */ }
Record a wait operation with the wait time in nanoseconds.
pub fn report(self: &Self) -> PoolUtilizationReport { /* ... */ }
Generate a utilization report from the current metrics.
pub fn reset(self: &Self) { /* ... */ }
Reset all metrics to their initial state.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ }
fn default() -> Self { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
PoolUtilizationReportPool 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,
}
| 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 |
pub fn print_summary(self: &Self) { /* ... */ }
Print a summary of the utilization report to the log.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn clone(self: &Self) -> PoolUtilizationReport { /* ... */ }
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn to_owned(self: &Self) -> T { /* ... */ }
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
PinnedBufferHandleAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:32:7: 32:26 (#0) }])]")pub use buffer_pool::PinnedBufferHandle;
PinnedBufferPoolAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:32:7: 32:26 (#0) }])]")pub use buffer_pool::PinnedBufferPool;
AmplitudeEncoderpub use encodings::AmplitudeEncoder;
AngleEncoderpub use encodings::AngleEncoder;
BasisEncoderpub use encodings::BasisEncoder;
QuantumEncoderpub use encodings::QuantumEncoder;
get_encoderpub use encodings::get_encoder;
GpuStateVectorpub use memory::GpuStateVector;
run_dual_stream_pipelineAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:36:7: 36:26 (#0) }])]")pub use pipeline::run_dual_stream_pipeline;
OverlapTrackerAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:39:7: 39:26 (#0) }])]")pub use overlap_tracker::OverlapTracker;
PipelineContextAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:41:7: 41:26 (#0) }])]")pub use pipeline::PipelineContext;
PoolMetricsAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:43:7: 43:26 (#0) }])]")pub use pool_metrics::PoolMetrics;
PoolUtilizationReportAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/gpu/mod.rs:43:7: 43:26 (#0) }])]")pub use pool_metrics::PoolUtilizationReport;
ioI/O utilities for reading and writing quantum data.
Provides efficient columnar data exchange via Apache Arrow and Parquet formats.
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 { /* ... */ }
ParquetBlockReaderStreaming Parquet reader for List
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;
arrow_to_vecConverts an Arrow Float64Array to Vec
pub fn arrow_to_vec(array: &arrow::array::Float64Array) -> Vec<f64> { /* ... */ }
arrow_to_vec_chunkedFlattens multiple Arrow Float64Arrays into a single Vec
pub fn arrow_to_vec_chunked(arrays: &[arrow::array::Float64Array]) -> Vec<f64> { /* ... */ }
read_parquetReads 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>> { /* ... */ }
write_parquetWrites Float64 data to a Parquet file.
path - Output file pathdata - Data to writecolumn_name - Column name (defaults to “data”)pub fn write_parquet<P: AsRef<std::path::Path>>(path: P, data: &[f64], column_name: Option<&str>) -> crate::error::Result<()> { /* ... */ }
read_parquet_to_arrowReads 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>> { /* ... */ }
write_arrow_to_parquetWrites an Arrow Float64Array to a Parquet file.
path - Output file patharray - Array to writecolumn_name - Column name (defaults to “data”)pub fn write_arrow_to_parquet<P: AsRef<std::path::Path>>(path: P, array: &arrow::array::Float64Array, column_name: Option<&str>) -> crate::error::Result<()> { /* ... */ }
read_parquet_batchReads batch data from a Parquet file with List<Float64> column format.
Returns flattened data suitable for batch encoding.
Tuple of (flattened_data, num_samples, sample_size)
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)> { /* ... */ }
read_arrow_ipc_batchReads batch data from an Arrow IPC file.
Supports FixedSizeList<Float64> and List<Float64> column formats.
Returns flattened data suitable for batch encoding.
Tuple of (flattened_data, num_samples, sample_size)
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)> { /* ... */ }
read_numpy_batchReads 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.
Tuple of (flattened_data, num_samples, sample_size)
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)> { /* ... */ }
read_torch_batchReads 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.
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)> { /* ... */ }
read_tensorflow_batchReads 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
Assumes little-endian byte order (standard on x86_64).
Tuple of (flattened_data, num_samples, sample_size)
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)> { /* ... */ }
preprocessingpub mod preprocessing { /* ... */ }
PreprocessorShared 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;
pub fn validate_input(host_data: &[f64], num_qubits: usize) -> Result<()> { /* ... */ }
Validates standard quantum input constraints.
pub fn calculate_l2_norm(host_data: &[f64]) -> Result<f64> { /* ... */ }
Calculates L2 norm of the input data in parallel on the CPU.
pub fn validate_batch(batch_data: &[f64], num_samples: usize, sample_size: usize, num_qubits: usize) -> Result<()> { /* ... */ }
Validates input constraints for batch processing.
pub fn calculate_batch_l2_norms(batch_data: &[f64], _num_samples: usize, sample_size: usize) -> Result<Vec<f64>> { /* ... */ }
Calculates L2 norms for a batch of samples in parallel.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
readerGeneric 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.
The reader system is based on two main traits:
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 { /* ... */ }
DataReaderGeneric 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 */
}
read_batch: Read all data from the source.fn get_sample_size(self: &Self) -> Option<usize> { /* ... */ }
Get the sample size if known before reading.
fn get_num_samples(self: &Self) -> Option<usize> { /* ... */ }
Get the total number of samples if known before reading.
This trait is implemented for the following types:
ArrowIPCReaderNumpyReaderParquetReaderParquetStreamingReaderTensorFlowReaderTorchReaderStreamingDataReaderStreaming 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 */
}
read_chunk: Read a chunk of data into the provided buffer.total_rows: Get the total number of rows/samples in the data source.This trait is implemented for the following types:
ParquetStreamingReaderreadersFormat-specific data reader implementations.
This module contains concrete implementations of the DataReader and
StreamingDataReader traits for various file formats.
ParquetReader], [ParquetStreamingReader]ArrowIPCReader]NumpyReader]TensorFlowReader]TorchReader] (feature: pytorch)pub mod readers { /* ... */ }
arrow_ipcArrow IPC format reader implementation.
pub mod arrow_ipc { /* ... */ }
ArrowIPCReaderReader for Arrow IPC files containing FixedSizeList
pub struct ArrowIPCReader {
// Some fields omitted
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self> { /* ... */ }
Create a new Arrow IPC reader.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn read_batch(self: &mut Self) -> Result<(Vec<f64>, usize, usize)> { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
numpyNumPy format reader implementation.
Provides support for reading .npy files containing 2D float64 arrays.
pub mod numpy { /* ... */ }
NumpyReaderReader for NumPy .npy files containing 2D float64 arrays.
[num_samples, sample_size]float64use 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
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self> { /* ... */ }
Create a new NumPy reader.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn read_batch(self: &mut Self) -> Result<(Vec<f64>, usize, usize)> { /* ... */ }
fn get_sample_size(self: &Self) -> Option<usize> { /* ... */ }
fn get_num_samples(self: &Self) -> Option<usize> { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
parquetParquet format reader implementation.
pub mod parquet { /* ... */ }
ParquetReaderReader for Parquet files containing List
pub struct ParquetReader {
// Some fields omitted
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new<P: AsRef<Path>>(path: P, batch_size: Option<usize>) -> Result<Self> { /* ... */ }
Create a new Parquet reader.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn read_batch(self: &mut Self) -> Result<(Vec<f64>, usize, usize)> { /* ... */ }
fn get_sample_size(self: &Self) -> Option<usize> { /* ... */ }
fn get_num_samples(self: &Self) -> Option<usize> { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
ParquetStreamingReaderStreaming Parquet reader for List
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
}
| Name | Type | Documentation |
|---|---|---|
total_rows |
usize |
|
| private fields | … | Some fields have been omitted |
pub fn new<P: AsRef<Path>>(path: P, batch_size: Option<usize>) -> Result<Self> { /* ... */ }
Create a new streaming Parquet reader.
pub fn get_sample_size(self: &Self) -> Option<usize> { /* ... */ }
Get the sample size (number of elements per sample).
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn read_batch(self: &mut Self) -> Result<(Vec<f64>, usize, usize)> { /* ... */ }
fn get_sample_size(self: &Self) -> Option<usize> { /* ... */ }
fn get_num_samples(self: &Self) -> Option<usize> { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn read_chunk(self: &mut Self, buffer: &mut [f64]) -> Result<usize> { /* ... */ }
fn total_rows(self: &Self) -> usize { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
tensorflowTensorFlow TensorProto format reader implementation.
pub mod tensorflow { /* ... */ }
TensorFlowReaderReader 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
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
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self> { /* ... */ }
Create a new TensorFlow reader from a file path.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn read_batch(self: &mut Self) -> Result<(Vec<f64>, usize, usize)> { /* ... */ }
fn get_sample_size(self: &Self) -> Option<usize> { /* ... */ }
fn get_num_samples(self: &Self) -> Option<usize> { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
torchPyTorch 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 { /* ... */ }
TorchReaderReader for PyTorch .pt/.pth tensor files.
pub struct TorchReader {
// Some fields omitted
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self> { /* ... */ }
Create a new PyTorch reader.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn read_batch(self: &mut Self) -> Result<(Vec<f64>, usize, usize)> { /* ... */ }
fn get_sample_size(self: &Self) -> Option<usize> { /* ... */ }
fn get_num_samples(self: &Self) -> Option<usize> { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
ArrowIPCReaderpub use arrow_ipc::ArrowIPCReader;
NumpyReaderpub use numpy::NumpyReader;
ParquetReaderpub use parquet::ParquetReader;
ParquetStreamingReaderpub use parquet::ParquetStreamingReader;
TensorFlowReaderpub use tensorflow::TensorFlowReader;
TorchReaderpub use torch::TorchReader;
tf_protoTensorFlow 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 { /* ... */ }
tensorflowpub mod tensorflow { /* ... */ }
TensorProtoAttributes:
Other("#[allow(clippy::derive_partial_eq_without_eq)]")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>,
}
| 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) |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn clone(self: &Self) -> TensorProto { /* ... */ }
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
fn fmt(self: &Self, f: &mut ::core::fmt::Formatter<''_>) -> ::core::fmt::Result { /* ... */ }
fn default() -> Self { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
fn encoded_len(self: &Self) -> usize { /* ... */ }
fn clear(self: &mut Self) { /* ... */ }
fn eq(self: &Self, other: &TensorProto) -> bool { /* ... */ }
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn to_owned(self: &Self) -> T { /* ... */ }
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
TensorShapeProtoAttributes:
Other("#[allow(clippy::derive_partial_eq_without_eq)]")pub struct TensorShapeProto {
pub dim: ::prost::alloc::vec::Vec<Dim>,
pub unknown_rank: bool,
}
| 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) |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn clone(self: &Self) -> TensorShapeProto { /* ... */ }
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
fn fmt(self: &Self, f: &mut ::core::fmt::Formatter<''_>) -> ::core::fmt::Result { /* ... */ }
fn default() -> Self { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
fn encoded_len(self: &Self) -> usize { /* ... */ }
fn clear(self: &mut Self) { /* ... */ }
fn eq(self: &Self, other: &TensorShapeProto) -> bool { /* ... */ }
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn to_owned(self: &Self) -> T { /* ... */ }
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
DimAttributes:
Other("#[allow(clippy::derive_partial_eq_without_eq)]")pub struct Dim {
pub size: i64,
}
| Name | Type | Documentation |
|---|---|---|
size |
i64 |
Field 1: size Skip name field (field number 2) to reduce parsing overhead |
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn clone(self: &Self) -> Dim { /* ... */ }
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
fn fmt(self: &Self, f: &mut ::core::fmt::Formatter<''_>) -> ::core::fmt::Result { /* ... */ }
fn default() -> Self { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
fn encoded_len(self: &Self) -> usize { /* ... */ }
fn clear(self: &mut Self) { /* ... */ }
fn eq(self: &Self, other: &Dim) -> bool { /* ... */ }
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn to_owned(self: &Self) -> T { /* ... */ }
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
QdpEngineMain 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
}
| Name | Type | Documentation |
|---|---|---|
| private fields | … | Some fields have been omitted |
pub fn new(device_id: usize) -> Result<Self> { /* ... */ }
Initialize engine on GPU device
pub fn new_with_precision(device_id: usize, precision: Precision) -> Result<Self> { /* ... */ }
Initialize engine with explicit precision.
pub fn encode(self: &Self, data: &[f64], num_qubits: usize, encoding_method: &str) -> Result<*mut DLManagedTensor> { /* ... */ }
Encode classical data into quantum state
pub fn device(self: &Self) -> &CudaDevice { /* ... */ }
Get CUDA device reference for advanced operations
pub fn synchronize(self: &Self) -> Result<()> { /* ... */ }
Block until all GPU work on the default stream has completed.
pub fn encode_batch(self: &Self, batch_data: &[f64], num_samples: usize, sample_size: usize, num_qubits: usize, encoding_method: &str) -> Result<*mut DLManagedTensor> { /* ... */ }
Encode multiple samples in a single fused kernel (most efficient)
pub fn run_dual_stream_encode(self: &Self, host_data: &[f64], num_qubits: usize, encoding_method: &str) -> Result<()> { /* ... */ }
Run dual-stream pipeline for encoding (H2D + kernel overlap). Exposes gpu::pipeline::run_dual_stream_pipeline.
pub fn encode_from_parquet(self: &Self, path: &str, num_qubits: usize, encoding_method: &str) -> Result<*mut DLManagedTensor> { /* ... */ }
Streaming Parquet encoder with multi-threaded IO
pub fn encode_from_arrow_ipc(self: &Self, path: &str, num_qubits: usize, encoding_method: &str) -> Result<*mut DLManagedTensor> { /* ... */ }
Load data from Arrow IPC file and encode into quantum state
pub fn encode_from_numpy(self: &Self, path: &str, num_qubits: usize, encoding_method: &str) -> Result<*mut DLManagedTensor> { /* ... */ }
Load data from NumPy .npy file and encode into quantum state
pub fn encode_from_torch(self: &Self, path: &str, num_qubits: usize, encoding_method: &str) -> Result<*mut DLManagedTensor> { /* ... */ }
Load data from PyTorch .pt/.pth file and encode into quantum state
pub fn encode_from_tensorflow(self: &Self, path: &str, num_qubits: usize, encoding_method: &str) -> Result<*mut DLManagedTensor> { /* ... */ }
Load data from TensorFlow TensorProto file and encode into quantum state
pub unsafe fn encode_from_gpu_ptr(self: &Self, input_d: *const std::ffi::c_void, input_len: usize, num_qubits: usize, encoding_method: &str) -> Result<*mut DLManagedTensor> { /* ... */ }
Encode from existing GPU pointer (zero-copy for CUDA tensors)
pub unsafe fn encode_from_gpu_ptr_with_stream(self: &Self, input_d: *const std::ffi::c_void, input_len: usize, num_qubits: usize, encoding_method: &str, stream: *mut std::ffi::c_void) -> Result<*mut DLManagedTensor> { /* ... */ }
Encode from existing GPU pointer with a specific CUDA stream.
pub unsafe fn encode_from_gpu_ptr_f32(self: &Self, input_d: *const f32, input_len: usize, num_qubits: usize) -> Result<*mut DLManagedTensor> { /* ... */ }
Encode from existing GPU pointer (float32 input, amplitude encoding only)
pub unsafe fn encode_from_gpu_ptr_f32_with_stream(self: &Self, input_d: *const f32, input_len: usize, num_qubits: usize, stream: *mut c_void) -> Result<*mut DLManagedTensor> { /* ... */ }
Encode from existing GPU pointer (float32) on a specified CUDA stream.
pub unsafe fn encode_batch_from_gpu_ptr(self: &Self, input_batch_d: *const std::ffi::c_void, num_samples: usize, sample_size: usize, num_qubits: usize, encoding_method: &str) -> Result<*mut DLManagedTensor> { /* ... */ }
Encode batch from existing GPU pointer (zero-copy for CUDA tensors)
pub unsafe fn encode_batch_from_gpu_ptr_with_stream(self: &Self, input_batch_d: *const std::ffi::c_void, num_samples: usize, sample_size: usize, num_qubits: usize, encoding_method: &str, stream: *mut std::ffi::c_void) -> Result<*mut DLManagedTensor> { /* ... */ }
Encode batch from existing GPU pointer with a specific CUDA stream.
fn type_id(self: &Self) -> TypeId { /* ... */ }
fn borrow(self: &Self) -> &T { /* ... */ }
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
fn clone(self: &Self) -> QdpEngine { /* ... */ }
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
fn from(t: T) -> T { /* ... */ }
Returns the argument unchanged.
fn into(self: Self) -> U { /* ... */ }
Calls U::from(self).
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
unsafe fn drop(ptr: usize) { /* ... */ }
fn to_owned(self: &Self) -> T { /* ... */ }
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
profile_scopeAttributes:
Other("#[attr = CfgTrace([Not(NameValue { name: \"feature\", value: Some(\"observability\"), span: qdp-core/src/profiling.rs:46:11: 46:36 (#0) }, qdp-core/src/profiling.rs:46:10: 46:37 (#0))])]")MacroExportNo-op version when observability is disabled
Compiler eliminates this completely, zero runtime cost.
pub macro_rules! profile_scope {
/* macro_rules! profile_scope {
($name:expr) => { ... };
} */
}
profile_markAttributes:
Other("#[attr = CfgTrace([Not(NameValue { name: \"feature\", value: Some(\"observability\"), span: qdp-core/src/profiling.rs:71:11: 71:36 (#0) }, qdp-core/src/profiling.rs:71:10: 71:37 (#0))])]")MacroExportNo-op version when observability is disabled
pub macro_rules! profile_mark {
/* macro_rules! profile_mark {
($name:expr) => { ... };
} */
}
MahoutErrorpub use error::MahoutError;
Resultpub use error::Result;
cuda_error_to_stringAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/lib.rs:36:7: 36:26 (#0) }])]")pub use error::cuda_error_to_string;
Precisionpub use gpu::memory::Precision;
DataSourceAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/lib.rs:44:7: 44:26 (#0) }])]")pub use pipeline_runner::DataSource;
PipelineConfigAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/lib.rs:44:7: 44:26 (#0) }])]")pub use pipeline_runner::PipelineConfig;
PipelineIteratorAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/lib.rs:44:7: 44:26 (#0) }])]")pub use pipeline_runner::PipelineIterator;
PipelineRunResultAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/lib.rs:44:7: 44:26 (#0) }])]")pub use pipeline_runner::PipelineRunResult;
run_latency_pipelineAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/lib.rs:44:7: 44:26 (#0) }])]")pub use pipeline_runner::run_latency_pipeline;
run_throughput_pipelineAttributes:
Other("#[attr = CfgTrace([NameValue { name: \"target_os\", value: Some(\"linux\"), span: qdp-core/src/lib.rs:44:7: 44:26 (#0) }])]")pub use pipeline_runner::run_throughput_pipeline;
QuantumEncoderpub use gpu::QuantumEncoder;