Skip to main content

singe_cusparse_sys/
lib.rs

1//! Raw FFI bindings for cuSPARSE.
2//!
3//! Prefer the safe `singe-cusparse` crate unless direct NVIDIA ABI access is required.
4
5#![allow(deprecated, warnings, unused_qualifications, clippy::all)]
6
7use num_enum::{IntoPrimitive, TryFromPrimitive};
8
9use singe_cuda_sys::{
10    library_types::{cudaDataType, cudaDataType_t, libraryPropertyType},
11    runtime::cudaStream_t,
12};
13
14#[cfg(feature = "cusparse_13_2")]
15include!("sys_12709.rs");
16
17#[cfg(test)]
18mod tests {
19    use std::ptr;
20
21    use super::*;
22
23    #[test]
24    fn it_works() {
25        let mut version = 0;
26        unsafe {
27            let mut ctx = ptr::null_mut();
28            assert_eq!(
29                cusparseCreate(&mut ctx),
30                cusparseStatus_t::CUSPARSE_STATUS_SUCCESS,
31            );
32            cusparseGetVersion(ctx, &mut version);
33        }
34        println!("cuSPARSE version: {}", version);
35        assert_ne!(version, 0);
36    }
37}