Skip to main content

Crate cudf

Crate cudf 

Source
Expand description

§cudf – GPU-Accelerated DataFrames for Rust

cudf provides safe Rust bindings for NVIDIA’s libcudf, enabling GPU-accelerated DataFrame operations. The public API is fully safe, with the sole exception of DLPackTensor::from_raw_ptr which requires an unsafe block.

§Quick Start

use cudf::{Column, Table, Result};

fn main() -> Result<()> {
    // Create a GPU column from host data
    let prices = Column::from_slice(&[100.0f64, 200.5, 300.75, 150.25])?;
    let quantities = Column::from_slice(&[10i32, 20, 30, 15])?;

    // Inspect
    assert_eq!(prices.len(), 4);
    assert!(!prices.has_nulls());

    // Read back to host
    let host_prices: Vec<f64> = prices.to_vec()?;
    assert_eq!(host_prices, vec![100.0, 200.5, 300.75, 150.25]);

    Ok(())
}

§Architecture

This crate is the safe public API layer in a 3-crate stack:

+---------------------------------------------+
|  cudf (this crate) -- safe Rust API          |
+---------------------------------------------+
|  cudf-cxx -- cxx bridge + C++ shim layer    |
+---------------------------------------------+
|  cudf-sys -- links libcudf.so               |
+---------------------------------------------+

§Feature Flags

FeatureDefaultDescription
arrow-interopYesZero-copy conversion to/from arrow arrays

Re-exports§

pub use aggregation::AggregationKind;
pub use binaryop::BinaryOp;
pub use column::Column;
pub use column::CudfType;
pub use copying::OutOfBoundsPolicy;
pub use error::CudfError;
pub use error::Result;
pub use groupby::GroupBy;
pub use groupby::GroupByGroups;
pub use groupby::GroupByReplacePolicy;
pub use groupby::GroupByScan;
pub use groupby::GroupByScanOp;
pub use join::HashJoin;
pub use join::JoinResult;
pub use join::SemiJoinResult;
pub use json::JsonObjectOptions;
pub use partitioning::PartitionResult;
pub use quantiles::Interpolation;
pub use reduction::MinMaxResult;
pub use reduction::ReduceOp;
pub use reduction::ScanOp;
pub use replace::NullReplacePolicy;
pub use rolling::RollingAgg;
pub use scalar::Scalar;
pub use sorting::NullOrder;
pub use sorting::SortOrder;
pub use stream_compaction::DuplicateKeepOption;
pub use stream_compaction::NullEquality;
pub use table::Table;
pub use table::TableWithMetadata;
pub use types::DataType;
pub use types::NullHandling;
pub use types::TypeId;
pub use unary::UnaryOp;
pub use interop::DLPackTensor;
pub use interop::PackedTable;
pub use interop::SplitResult;

Modules§

aggregation
Aggregation kinds for groupby and other reduction operations.
binaryop
Binary operations on GPU-resident columns.
column
GPU-resident column type.
concatenate
Concatenation operations for columns and tables.
copying
GPU-accelerated copying operations.
datetime
GPU-accelerated datetime extraction operations.
dictionary
GPU-accelerated dictionary encoding and decoding.
error
Error types for cudf operations.
filling
Filling and sequence generation operations.
groupby
GPU-accelerated groupby aggregation.
hashing
GPU-accelerated hashing operations.
interop
Arrow interoperability, DLPack, and contiguous_split.
io
I/O operations for reading and writing GPU DataFrames.
join
Join operations on GPU tables.
json
GPU-accelerated JSONPath operations.
label_bins
GPU-accelerated bin labeling.
lists
GPU-accelerated list column operations.
merge
GPU-accelerated merge operations.
null_mask
Null mask utilities for GPU columns.
partitioning
GPU-accelerated partitioning operations.
quantiles
GPU-accelerated quantile operations.
reduction
GPU-accelerated reduction operations.
replace
GPU-accelerated null/NaN replacement and value clamping.
reshape
GPU-accelerated reshape operations.
rolling
GPU-accelerated rolling window operations.
round
GPU-accelerated rounding operations.
scalar
GPU-resident scalar type.
search
GPU-accelerated search operations.
sorting
GPU-accelerated sorting operations.
stream_compaction
Stream compaction operations for tables and columns.
strings
String operations on GPU string columns.
structs
GPU-accelerated struct column operations.
table
GPU-resident table type.
timezone
Timezone transition table support.
transform
GPU-accelerated data transformation operations.
transpose
GPU-accelerated table transposition.
types
Core type definitions for cudf.
unary
Unary operations on GPU-resident columns.