Skip to content

Commit 2b500e5

Browse files
authored
Add cuda-{dynamic,static} to allow static-linking for cudarc (#11)
* Add `cuda-dynamic` and `cuda-static` `cudarc` sets the feature `dynamic-linking` by default, but instead this PR adds the features `cuda-dynamic` and `cuda-static` so that the `cuda` in `float8` still defaults to `dynamic-linking`, but still offering the possibility to use `cuda-static` with `static-linking` * Bump to 0.6.1 * Include `consts` to fix CI (e.g., `std::f64::consts::`)
1 parent 50cddd7 commit 2b500e5

5 files changed

Lines changed: 15 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
on:
1+
on:
22
schedule:
33
- cron: '0 0 * * 1'
44
push:
5-
branches:
5+
branches:
66
- master
77
pull_request:
8-
branches:
8+
branches:
99
- master
1010
workflow_dispatch:
1111

@@ -117,7 +117,7 @@ jobs:
117117
uses: crate-ci/typos@master
118118
with:
119119
config: .typos.toml
120-
120+
121121
# run `mlc` (`cargo install mlc`)
122122
# markdown-link-check:
123123
# runs-on: ubuntu-latest

.typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[default.extend-words]
2+
consts = "consts"

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "float8"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
rust-version = "1.70"
55
edition = "2021"
66
description = "8-bit floating point types for Rust"
@@ -38,13 +38,14 @@ cudarc = { version = "0.19.0", features = [
3838
"nvrtc",
3939
"f16",
4040
"cuda-version-from-build-system",
41-
"dynamic-linking",
4241
], default-features = false, optional = true }
4342

4443
[features]
4544
default = ["std"]
4645
std = ["half/std"]
47-
cuda = ["dep:cudarc"]
46+
cuda = ["cuda-dynamic"]
47+
cuda-dynamic = ["dep:cudarc", "cudarc?/dynamic-linking"]
48+
cuda-static = ["dep:cudarc", "cudarc?/static-linking"]
4849
all = [
4950
"std",
5051
"num-traits",

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,12 +1571,12 @@ macro_rules! from_t {
15711571
from_t!(F8E4M3);
15721572
from_t!(F8E5M2);
15731573

1574-
#[cfg(feature = "cuda")]
1574+
#[cfg(any(feature = "cuda-dynamic", feature = "cuda-static"))]
15751575
unsafe impl cudarc::driver::DeviceRepr for F8E4M3 {}
1576-
#[cfg(feature = "cuda")]
1576+
#[cfg(any(feature = "cuda-dynamic", feature = "cuda-static"))]
15771577
unsafe impl cudarc::driver::ValidAsZeroBits for F8E4M3 {}
15781578

1579-
#[cfg(feature = "cuda")]
1579+
#[cfg(any(feature = "cuda-dynamic", feature = "cuda-static"))]
15801580
unsafe impl cudarc::driver::safe::DeviceRepr for F8E5M2 {}
1581-
#[cfg(feature = "cuda")]
1581+
#[cfg(any(feature = "cuda-dynamic", feature = "cuda-static"))]
15821582
unsafe impl cudarc::driver::ValidAsZeroBits for F8E5M2 {}

0 commit comments

Comments
 (0)