pub mod arrow_host;
mod column;
mod consumer_import;
mod errors;
pub(crate) mod execution;
mod frame;
mod import_graph;
pub(crate) mod projection;
mod runtime_lease;
mod table;
mod table_export;
#[cfg(any(test, feature = "test-hooks"))]
pub(crate) mod testing_hooks;
use column::{prepare_from_owned_column, prepare_host_from_owned_column};
use consumer_import::{
dataframe_import_names, import_column_from_prepared_export, import_table_from_prepared_export,
wrap_imported_dataframe, wrap_imported_series,
};
use errors::{
checked_child_index, checked_column_index, checked_invalid_view_i32_from_usize, invalid_view_contract_error,
map_cudf_error, map_interop_error,
};
use execution::{prepared_device_event_readiness, prepared_device_readiness, to_static_bindings, to_static_readiness};
use prepared::{
InteropError, InteropErrorKind, PreparedAccess, PreparedColumnExport, PreparedTableExport, ProducerReadiness,
};
use projection::{prepared_column_projection_from_view, prepared_host_column_projection_from_view};
pub use rapids_interop as contract;
use rapids_interop::{
BoundBytes, BufferBinding, BufferId, ColumnId, ColumnLayout, CudaEventHandle, CudaStreamHandle,
DataType as InteropDataType, DeviceMemoryResourceHandle, ExecutionBinding, PhysicalValidity, Placement,
SemanticColumn, SemanticTable, TypeId as InteropTypeId,
};
mod prepared {
pub use rapids_interop::{
InteropError, InteropErrorKind, PreparedAccess, PreparedColumnExport, PreparedTableExport, ProducerReadiness,
};
}
use table_export::{
prepare_device_table_export_from_columns, prepare_device_table_export_from_columns_with_readiness,
prepare_host_table_export_from_columns, prepare_host_table_export_from_view, prepare_table_export_from_view,
prepare_table_export_from_view_with_readiness,
};
use crate::{
core::{
column::{Column, ColumnView, copy_view_to_owned},
error,
table::{Table, TableView},
types::{DataType, TypeId},
},
frame::{dataframe::DataFrame, series::Series},
ops::dictionary,
runtime::{CudaEvent, CudaStream, Runtime, execution_domain::ExecutionDomain},
};
pub fn cuda_stream_handle(stream: &CudaStream) -> Result<rapids_interop::CudaStreamHandle<'_>, InteropError> {
unsafe {
rapids_interop::CudaStreamHandle::from_raw_on_device(stream.interop_raw_handle(), stream.device().ordinal_raw())
}
.map_err(|error| error.with_context("operation", "interop::cuda_stream_handle"))
}
pub fn cuda_event_handle(event: &CudaEvent) -> Result<rapids_interop::CudaEventHandle<'_>, InteropError> {
let raw = event
.interop_raw_handle()
.map_err(|error| map_cudf_error(InteropErrorKind::ReadinessUnavailable, "interop::cuda_event_handle", error))?;
unsafe { rapids_interop::CudaEventHandle::from_raw_on_device(raw, event.device().ordinal_raw()) }
.map_err(|error| error.with_context("operation", "interop::cuda_event_handle"))
}