openvm-cuda-backend 2.0.0

OpenVM CUDA prover backend for the SWIRL proof system
1
2
3
4
5
6
7
8
9
10
11
use openvm_cuda_common::error::CudaError;

extern "C" {
    fn _cuda_get_sm_count(device_id: u32, out_sm_count: *mut u32) -> i32;
}

pub fn get_sm_count(device_id: u32) -> Result<u32, CudaError> {
    let mut sm_count = 0u32;
    unsafe { CudaError::from_result(_cuda_get_sm_count(device_id, &mut sm_count))? };
    Ok(sm_count)
}