6 releases (3 breaking)

0.4.0-pre.2 Jun 18, 2019
0.4.0-pre.1 Mar 4, 2019
0.4.0-pre.0 Feb 14, 2019
0.3.0 Aug 31, 2018
0.1.0 Nov 8, 2016

#710 in Machine learning

Download history 12/week @ 2023-11-04 23/week @ 2023-11-11 17/week @ 2023-11-18 39/week @ 2023-11-25 19/week @ 2023-12-02 17/week @ 2023-12-09 23/week @ 2023-12-16 23/week @ 2023-12-23 11/week @ 2023-12-30 19/week @ 2024-01-06 15/week @ 2024-01-13 17/week @ 2024-01-20 26/week @ 2024-01-27 22/week @ 2024-02-03 37/week @ 2024-02-10 98/week @ 2024-02-17

185 downloads per month
Used in 2 crates

MIT/Apache

1MB
27K SLoC

guppybot.org docs.rs

These are Rust bindings to the CUDA toolkit APIs.

The FFI bindings are done via bindgen and are substantially whitelisted; see build.rs for the whitelisted APIs. High-level wrappers are located in top-level modules (driver, runtime, blas, and rand).


lib.rs:

Cargo features

CUDA version features

There are often multiple versions of CUDA installed, and different programs may require different CUDA versions. Therefore it is important to ensure that the FFI bindings are for the desired version of CUDA.

There are several features that pin the API bindings to specific CUDA versions:

  • cuda_6_5, cuda_7_0, cuda_7_5, cuda_8_0, cuda_9_0, cuda_9_1, cuda_9_2, cuda_10_0, cuda_10_1

One and only one of these features must be set somewhere in the cargo dependency graph in order for the cuda crate to be used, otherwise the crate will force a compile-time error.

For further details on CUDA version compatibility, please see: https://docs.nvidia.com/deploy/cuda-compatibility/index.html.

Recommendations

It is recommended that binary crates specify one and only one of these version features, whereas library crates should specify no features.

Other Cargo features

  • cuda_sys: This features substitutes the FFI bindings auto-generated by bindgen with the bindings provided by the cuda_sys crate. As of cuda_sys v0.2.0, these bindings are specific to CUDA 8.0 only.

  • fresh: For maintainers of the crate itself. This feature generates fresh FFI bindings using bindgen from the build script.

Dependencies

~46–310KB