diff --git a/Cargo.toml b/Cargo.toml index 6a3ef37..b60a71f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,3 +13,24 @@ keywords = ["GPGPU", "CUDA", "ffi"] license = "MIT" readme = "README.md" categories = [] + +[features] +default = ["cuda_8_0"] +cuda_6_5 = [] +cuda_7_0 = ["gte_cuda_7_0"] +cuda_7_5 = ["gte_cuda_7_0", "gte_cuda_7_5"] +cuda_8_0 = ["gte_cuda_7_0", "gte_cuda_7_5", "gte_cuda_8_0"] +cuda_9_0 = ["gte_cuda_7_0", "gte_cuda_7_5", "gte_cuda_8_0", "gte_cuda_9_0"] +cuda_9_1 = ["gte_cuda_7_0", "gte_cuda_7_5", "gte_cuda_8_0", "gte_cuda_9_0", "gte_cuda_9_1"] +cuda_9_2 = ["gte_cuda_7_0", "gte_cuda_7_5", "gte_cuda_8_0", "gte_cuda_9_0", "gte_cuda_9_1", "gte_cuda_9_2"] +cuda_10_0 = ["gte_cuda_7_0", "gte_cuda_7_5", "gte_cuda_8_0", "gte_cuda_9_0", "gte_cuda_9_1", "gte_cuda_9_2", "gte_cuda_10_0"] +gte_cuda_7_0 = [] +gte_cuda_7_5 = [] +gte_cuda_8_0 = [] +gte_cuda_9_0 = [] +gte_cuda_9_1 = [] +gte_cuda_9_2 = [] +gte_cuda_10_0 = [] + +[dependencies] +static_assertions = "0.3.1" diff --git a/src/cuda_fp16.rs b/src/cuda_fp16.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/lib.rs b/src/lib.rs index 68a42f1..e821a2e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,17 @@ +#[macro_use] extern crate static_assertions; + pub mod cublas; pub mod cuda; pub mod cudart; +#[cfg(feature = "gte_cuda_8_0")] +pub mod cuda_fp16; pub mod vector_types; +#[cfg(feature = "cuda_8_0")] +const_assert_eq!(cuda_8_0_api_version; cuda::__CUDA_API_VERSION, 8000); +#[cfg(feature = "cuda_8_0")] +const_assert_eq!(cuda_8_0_version; cuda::CUDA_VERSION, 8000); + #[test] fn cuda_version() { let mut d_ver = 0;