#[cfg(feature = "cuda")]
#[allow(
clippy::borrow_as_ptr,
clippy::ptr_as_ptr,
clippy::cast_sign_loss,
clippy::wildcard_imports
)]
pub mod sys;
#[cfg(feature = "cuda")]
#[allow(clippy::borrow_as_ptr, clippy::ptr_as_ptr, clippy::cast_sign_loss)]
mod context;
#[cfg(feature = "cuda")]
#[allow(clippy::borrow_as_ptr, clippy::not_unsafe_ptr_arg_deref)]
mod graph;
#[cfg(feature = "cuda")]
#[allow(clippy::ptr_as_ptr, clippy::borrow_as_ptr)]
mod memory;
#[cfg(feature = "cuda")]
#[allow(clippy::borrow_as_ptr, clippy::ptr_as_ptr)]
mod module;
#[cfg(feature = "cuda")]
#[allow(clippy::borrow_as_ptr)]
mod stream;
mod types;
pub use types::*;
#[cfg(feature = "cuda")]
pub use context::{cuda_available, device_count, CudaContext};
#[cfg(feature = "cuda")]
pub use graph::{CaptureMode, CudaGraph, CudaGraphExec};
#[cfg(feature = "cuda")]
pub use memory::GpuBuffer;
#[cfg(feature = "cuda")]
pub use module::CudaModule;
#[cfg(feature = "cuda")]
pub use stream::{CudaStream, DEFAULT_STREAM};
#[cfg(not(feature = "cuda"))]
#[must_use]
pub fn cuda_available() -> bool {
false
}
#[cfg(not(feature = "cuda"))]
#[must_use]
pub fn device_count() -> usize {
0
}
#[cfg(all(test, feature = "cuda"))]
mod cuda_tests;
#[cfg(all(test, feature = "cuda"))]
mod memory_fuzz_tests;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_cuda_available_returns_bool() {
let _available: bool = cuda_available();
}
#[test]
#[cfg(not(feature = "cuda"))]
fn test_cuda_available_without_feature() {
assert!(!cuda_available());
}
#[test]
#[cfg(not(feature = "cuda"))]
fn test_device_count_without_feature() {
assert_eq!(device_count(), 0);
}
}