Skip to content

Commit 9ea4893

Browse files
committed
Added compile-time-checked lints against local mem and register spills in CUDA kernels
1 parent 73ab8e9 commit 9ea4893

File tree

17 files changed

+180
-276
lines changed

17 files changed

+180
-276
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

necsim/core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ contracts = "0.6.3"
2020
serde = { version = "1.0", default-features = false, features = ["derive"] }
2121

2222
[target.'cfg(target_os = "cuda")'.dependencies]
23-
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "626cd48", features = ["derive"], optional = true }
23+
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b7c773", features = ["derive"], optional = true }
2424

2525
[target.'cfg(not(target_os = "cuda"))'.dependencies]
26-
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "626cd48", features = ["derive", "host"], optional = true }
26+
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b7c773", features = ["derive", "host"], optional = true }

necsim/impls/cuda/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ contracts = "0.6.3"
1515
serde = { version = "1.0", default-features = false, features = ["derive"] }
1616

1717
[target.'cfg(target_os = "cuda")'.dependencies]
18-
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "626cd48", features = ["derive"] }
18+
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b7c773", features = ["derive"] }
1919

2020
[target.'cfg(not(target_os = "cuda"))'.dependencies]
21-
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "626cd48", features = ["derive", "host"] }
21+
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b7c773", features = ["derive", "host"] }

necsim/impls/no-std/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rand_core = "0.6"
3131
rand_distr = { version = "0.4", default-features = false, features = [] }
3232

3333
[target.'cfg(target_os = "cuda")'.dependencies]
34-
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "626cd48", features = ["derive"], optional = true }
34+
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b7c773", features = ["derive"], optional = true }
3535

3636
[target.'cfg(not(target_os = "cuda"))'.dependencies]
37-
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "626cd48", features = ["derive", "host"], optional = true }
37+
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b7c773", features = ["derive", "host"], optional = true }

rustcoalescence/algorithms/cuda/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ thiserror = "1.0"
2323
serde = { version = "1.0", features = ["derive"] }
2424
serde_state = "0.4"
2525
serde_derive_state = "0.4"
26-
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "626cd48", features = ["host"] }
26+
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b7c773", features = ["host"] }

rustcoalescence/algorithms/cuda/cpu-kernel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ necsim-impls-no-std = { path = "../../../../necsim/impls/no-std", features = ["c
1414
necsim-impls-cuda = { path = "../../../../necsim/impls/cuda" }
1515
rustcoalescence-algorithms-cuda-gpu-kernel = { path = "../gpu-kernel" }
1616

17-
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "626cd48", features = ["host"] }
17+
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b7c773", features = ["host"] }

rustcoalescence/algorithms/cuda/cpu-kernel/src/lib.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ use rust_cuda::{
2727
error::{CudaError, CudaResult},
2828
function::{BlockSize, Function, GridSize},
2929
},
30+
safety::NoAliasing,
3031
};
3132

3233
use rustcoalescence_algorithms_cuda_gpu_kernel::{
33-
BitonicGlobalSortSteppableKernel, BitonicSharedSortPreparableKernel,
34-
BitonicSharedSortSteppableKernel, EvenOddSortableKernel, SimulatableKernel,
34+
BitonicGlobalSortStepKernelPtx, BitonicGlobalSortSteppableKernel,
35+
BitonicSharedSortPrepKernelPtx, BitonicSharedSortPreparableKernel,
36+
BitonicSharedSortStepKernelPtx, BitonicSharedSortSteppableKernel, EvenOddSortKernelPtx,
37+
EvenOddSortableKernel, SimulatableKernel, SimulationKernelPtx,
3538
};
3639

3740
mod link;
@@ -83,17 +86,17 @@ pub struct SimulationKernel<
8386

8487
impl<
8588
M: MathsCore,
86-
H: Habitat<M> + RustToCuda,
87-
G: Rng<M, Generator: PrimeableRng> + RustToCuda,
88-
S: LineageStore<M, H> + RustToCuda,
89-
X: EmigrationExit<M, H, G, S> + RustToCuda,
90-
D: DispersalSampler<M, H, G> + RustToCuda,
91-
C: CoalescenceSampler<M, H, S> + RustToCuda,
92-
T: TurnoverRate<M, H> + RustToCuda,
93-
N: SpeciationProbability<M, H> + RustToCuda,
94-
E: MinSpeciationTrackingEventSampler<M, H, G, S, X, D, C, T, N> + RustToCuda,
95-
I: ImmigrationEntry<M> + RustToCuda,
96-
A: SingularActiveLineageSampler<M, H, G, S, X, D, C, T, N, E, I> + RustToCuda,
89+
H: Habitat<M> + RustToCuda + NoAliasing,
90+
G: Rng<M, Generator: PrimeableRng> + RustToCuda + NoAliasing,
91+
S: LineageStore<M, H> + RustToCuda + NoAliasing,
92+
X: EmigrationExit<M, H, G, S> + RustToCuda + NoAliasing,
93+
D: DispersalSampler<M, H, G> + RustToCuda + NoAliasing,
94+
C: CoalescenceSampler<M, H, S> + RustToCuda + NoAliasing,
95+
T: TurnoverRate<M, H> + RustToCuda + NoAliasing,
96+
N: SpeciationProbability<M, H> + RustToCuda + NoAliasing,
97+
E: MinSpeciationTrackingEventSampler<M, H, G, S, X, D, C, T, N> + RustToCuda + NoAliasing,
98+
I: ImmigrationEntry<M> + RustToCuda + NoAliasing,
99+
A: SingularActiveLineageSampler<M, H, G, S, X, D, C, T, N, E, I> + RustToCuda + NoAliasing,
97100
ReportSpeciation: Boolean,
98101
ReportDispersal: Boolean,
99102
> SimulationKernel<M, H, G, S, X, D, C, T, N, E, I, A, ReportSpeciation, ReportDispersal>

0 commit comments

Comments
 (0)