Skip to content
This repository was archived by the owner on Mar 29, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cublas-sys/bindgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ bindgen \
--with-derive-eq \
--with-derive-hash \
--with-derive-ord \
/opt/cuda/include/cublas.h \
-- -I/opt/cuda/include \
--size_t-is-usize \
"$CUDA_PATH/include/cublas.h" \
-- -I"$CUDA_PATH/include" \
> src/cublas.rs
47 changes: 43 additions & 4 deletions cublas-sys/src/cublas.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen */
/* automatically generated by rust-bindgen 0.55.1 */

#[repr(C)]
#[repr(align(8))]
Expand Down Expand Up @@ -81,18 +81,32 @@ pub type cudaStream_t = *mut CUstream_st;
pub enum cudaDataType_t {
CUDA_R_16F = 2,
CUDA_C_16F = 6,
CUDA_R_16BF = 14,
CUDA_C_16BF = 15,
CUDA_R_32F = 0,
CUDA_C_32F = 4,
CUDA_R_64F = 1,
CUDA_C_64F = 5,
CUDA_R_4I = 16,
CUDA_C_4I = 17,
CUDA_R_4U = 18,
CUDA_C_4U = 19,
CUDA_R_8I = 3,
CUDA_C_8I = 7,
CUDA_R_8U = 8,
CUDA_C_8U = 9,
CUDA_R_16I = 20,
CUDA_C_16I = 21,
CUDA_R_16U = 22,
CUDA_C_16U = 23,
CUDA_R_32I = 10,
CUDA_C_32I = 11,
CUDA_R_32U = 12,
CUDA_C_32U = 13,
CUDA_R_64I = 24,
CUDA_C_64I = 25,
CUDA_R_64U = 26,
CUDA_C_64U = 27,
}
pub use self::cudaDataType_t as cudaDataType;
#[repr(u32)]
Expand Down Expand Up @@ -220,8 +234,26 @@ pub enum cublasGemmAlgo_t {
pub enum cublasMath_t {
CUBLAS_DEFAULT_MATH = 0,
CUBLAS_TENSOR_OP_MATH = 1,
CUBLAS_PEDANTIC_MATH = 2,
CUBLAS_TF32_TENSOR_OP_MATH = 3,
CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION = 16,
}
pub use self::cudaDataType as cublasDataType_t;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum cublasComputeType_t {
CUBLAS_COMPUTE_16F = 64,
CUBLAS_COMPUTE_16F_PEDANTIC = 65,
CUBLAS_COMPUTE_32F = 68,
CUBLAS_COMPUTE_32F_PEDANTIC = 69,
CUBLAS_COMPUTE_32F_FAST_16F = 74,
CUBLAS_COMPUTE_32F_FAST_16BF = 75,
CUBLAS_COMPUTE_32F_FAST_TF32 = 77,
CUBLAS_COMPUTE_64F = 70,
CUBLAS_COMPUTE_64F_PEDANTIC = 71,
CUBLAS_COMPUTE_32I = 72,
CUBLAS_COMPUTE_32I_PEDANTIC = 73,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cublasContext {
Expand Down Expand Up @@ -249,6 +281,13 @@ extern "C" {
extern "C" {
pub fn cublasGetCudartVersion() -> usize;
}
extern "C" {
pub fn cublasSetWorkspace_v2(
handle: cublasHandle_t,
workspace: *mut ::std::os::raw::c_void,
workspaceSizeInBytes: usize,
) -> cublasStatus_t;
}
extern "C" {
pub fn cublasSetStream_v2(handle: cublasHandle_t, streamId: cudaStream_t) -> cublasStatus_t;
}
Expand Down Expand Up @@ -2280,7 +2319,7 @@ extern "C" {
C: *mut ::std::os::raw::c_void,
Ctype: cudaDataType,
ldc: ::std::os::raw::c_int,
computeType: cudaDataType,
computeType: cublasComputeType_t,
algo: cublasGemmAlgo_t,
) -> cublasStatus_t;
}
Expand Down Expand Up @@ -3042,7 +3081,7 @@ extern "C" {
Ctype: cudaDataType,
ldc: ::std::os::raw::c_int,
batchCount: ::std::os::raw::c_int,
computeType: cudaDataType,
computeType: cublasComputeType_t,
algo: cublasGemmAlgo_t,
) -> cublasStatus_t;
}
Expand All @@ -3069,7 +3108,7 @@ extern "C" {
ldc: ::std::os::raw::c_int,
strideC: ::std::os::raw::c_longlong,
batchCount: ::std::os::raw::c_int,
computeType: cudaDataType,
computeType: cublasComputeType_t,
algo: cublasGemmAlgo_t,
) -> cublasStatus_t;
}
Expand Down
3 changes: 2 additions & 1 deletion cuda-driver-sys/bindgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ bindgen \
--with-derive-eq \
--with-derive-hash \
--with-derive-ord \
wrapper.h -- -I/opt/cuda/include \
--size_t-is-usize \
wrapper.h -- -I"$CUDA_PATH/include" \
> src/cuda.rs
Loading