#[cfg(not(any(
feature = "cuda-12060",
feature = "cuda-12080",
feature = "cuda-12090",
feature = "cuda-13000"
)))]
compile_error!(
"onnx-genai CUDA build: no CUDA version selected. Enable exactly one of cuda-12060 | cuda-12080 | cuda-12090 | cuda-13000."
);
#[cfg(any(
all(feature = "cuda-12060", feature = "cuda-12080"),
all(feature = "cuda-12060", feature = "cuda-12090"),
all(feature = "cuda-12060", feature = "cuda-13000"),
all(feature = "cuda-12080", feature = "cuda-12090"),
all(feature = "cuda-12080", feature = "cuda-13000"),
all(feature = "cuda-12090", feature = "cuda-13000")
))]
compile_error!(
"onnx-genai CUDA build: multiple CUDA versions selected; cudarc bindings cannot compile with more than one. Enable exactly one of cuda-12060 | cuda-12080 | cuda-12090 | cuda-13000 (and set default-features = false on inter-crate deps if you override the default)."
);
pub mod arch;
pub mod blas;
pub mod capture;
pub mod cudnn;
pub mod cufft;
pub mod deferred_release;
mod dynamic_library;
pub mod error;
mod graph;
pub(crate) mod interleave_cache;
pub mod kernel_cache;
pub mod kernels;
mod optimizer;
pub mod pinned_pool;
pub mod provider;
pub mod runtime;
#[cfg(test)]
pub(crate) mod test_support;
mod trace;
pub use onnx_runtime_cuda_memory::{virtual_memory, vmm_allocator};
pub mod coarse_residency;
pub mod granule_transition;
pub mod prefill_double_buffer;
pub mod route_residency;
pub mod weight_paging;
pub use capture::{require_subgraph_graph_capturable, subgraph_graph_capturable};
pub use cufft::{CufftPlanCacheStats, cufft_plan_cache_stats};
pub use dynamic_library::set_wheel_search_paths;
pub use kernels::attention::AttentionKernel;
pub use kernels::block_quantized_moe::{
AdmittedBlockQuantizedMoeBanks, BlockQuantizedMoeBank, BlockQuantizedMoeBankIdentity,
BlockQuantizedMoePreparationCounts, BlockQuantizedMoeResidency, BlockQuantizedMoeTraffic,
admit_block_quantized_moe_banks, block_quantized_moe_preparation_counts,
};
pub use kernels::csa_checkpoint::{
CsaAttentionMode, CsaCheckpoint, CsaCheckpointJournal, CsaCursors, CsaLayerMetrics, CsaMetrics,
};
pub use kernels::dsa_index_select::{
DsaLaunchStats, DsaWorkspaceStats, dsa_launch_stats, dsa_workspace_stats,
reset_dsa_launch_stats, reset_dsa_workspace_stats,
};
#[cfg(feature = "gpu-tests")]
pub use kernels::dsa_index_select::{
dsa_plugin_capture_stats_for_test, set_dsa_plugin_capture_replays_for_test,
};
pub use kernels::einsum::{
CudaEinsumRoute, EinsumExecutionStats, EinsumRouteOverride, einsum_execution_stats,
execute_einsum_with_route, execute_einsum_with_route_and_memory_ceiling,
reset_einsum_execution_stats,
};
pub use kernels::gather::GATHER_CAPTURE_ERROR_INDEX;
pub use kernels::gather_block_quantized::GATHER_BLOCK_QUANTIZED_CAPTURE_ERROR_INDEX;
pub use kernels::group_query_attention::{
GQA_CAPTURE_ERROR_PAST_CAPACITY, GQA_CAPTURE_ERROR_PAST_NEGATIVE, GQA_CAPTURE_ERROR_POSITION,
GQA_CAPTURE_ERROR_PRESENT_CAPACITY, GQA_CAPTURE_ERROR_QUERY_NEGATIVE,
GQA_CAPTURE_ERROR_TOTAL_OVERFLOW, GroupQueryAttentionBackend, GroupQueryAttentionKernel,
gqa_capture_error_description,
};
pub use kernels::index_share::INDEX_SHARE_CAPTURE_ERROR_INDEX;
pub use kernels::indexing::SCATTER_CAPTURE_ERROR_INDEX;
pub use kernels::kv_cache_capacity_append::KV_CAPACITY_APPEND_CAPTURE_ERROR_POSITION;
pub use kernels::movement::{
MovementExecutionStats, movement_execution_stats, reset_movement_execution_stats,
};
pub use kernels::non_max_suppression::{
NmsExecutionStats, nms_execution_stats, reset_nms_execution_stats,
};
pub use kernels::planar_block_decode::{
AdmittedPlanarLinear, PLANAR_FORMAT_BLOCK_FP8, PLANAR_FORMAT_FP4_PLANAR, PlanarActivationDtype,
PlanarLinearDims, PlanarTensorLengths, admit_planar_linear, launch_planar_linear,
planar_matmul_capable_formats, warm_planar_linear,
};
#[cfg(any(test, feature = "gpu-tests"))]
pub use kernels::planar_block_moe::planar_moe_source_build_count;
pub use kernels::planar_block_moe::{
AdmittedPlanarMoe, PlanarMoeBank, PlanarMoeBufferLengths, PlanarMoeBuffers, PlanarMoeDims,
PlanarMoeProjection, admit_planar_moe, launch_planar_moe, planar_moe_capable_formats,
warm_planar_moe,
};
pub use kernels::reduce::REDUCE_CAPTURE_ERROR_AXES;
pub use kernels::stft::{StftExecutionStats, stft_last_execution_stats};
pub use kernels::unique::{
MAX_UNIQUE_ELEMENTS, UniqueExecutionStats, reset_unique_execution_stats, unique_execution_stats,
};
pub use kernels::{
CUDA_COVERED_OPS, CudaOpDescriptor, build_cuda_registry, build_cuda_registry_descriptors,
build_cuda_registry_with_metrics, cuda_supported_dtypes_for_op,
};
pub use pinned_pool::{PinnedStagingPool, global_pinned_alloc_calls, global_pinned_reuses};
#[doc(hidden)]
pub use provider::RoutePrepareCommitInterlock;
pub use provider::{
CudaExecutionProvider, DEFAULT_DEVICE_OFFLOAD_BUDGET_BYTES, dynamic_kv_weight_lending_enabled,
};
pub use weight_paging::{
CudaResidencyStats, CudaWeightPage, CudaWeightPager, CudaWeightResidency, DeviceOffloadPolicy,
EvictOrderProbe, GlobalOffloadStats, WEIGHT_OFFLOAD_ASYNC_PAGEIN_ENV,
WEIGHT_OFFLOAD_BYTE_AWARE_ENV, WEIGHT_OFFLOAD_DEVICE_BYTES_ENV, WEIGHT_OFFLOAD_ENV,
WEIGHT_OFFLOAD_EVICT_ORDER_ENV, WEIGHT_OFFLOAD_SCAN_RESISTANT_ENV,
WEIGHT_OFFLOAD_ZERO_COPY_HYBRID_ENV, WeightKeyTrace, byte_aware_residency_from_env,
evict_order_probe_from_env, global_offload_stats, pinned_hot_set, reset_global_offload_stats,
weight_paging_key_trace, zero_copy_hybrid_from_env,
};
pub fn device_argmax_scratch_words(elements: usize, batch: usize) -> usize {
kernels::device_argmax::scratch_words(elements, batch)
}
pub use onnx_runtime_ep_api::RawDeviceAllocationSiteStats as CudaRawAllocationSiteStats;
pub use runtime::{CudaAllocationCounts, CudaGraphExecutionCounts, CudaRuntime};