Skip to content

Commit

Permalink
Fix CUDA kernel compilation with new linker and higher recursion limit
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Dec 11, 2023
1 parent d1d6144 commit 4aab32d
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 30 deletions.
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions necsim/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contracts = "0.6.3"
serde = { version = "1.0", default-features = false, features = ["derive"] }

[target.'cfg(target_os = "cuda")'.dependencies]
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "b26635f", features = ["derive"], optional = true }
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b53e88", features = ["derive"], optional = true }

[target.'cfg(not(target_os = "cuda"))'.dependencies]
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "b26635f", features = ["derive", "host"], optional = true }
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b53e88", features = ["derive", "host"], optional = true }
4 changes: 2 additions & 2 deletions necsim/impls/cuda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contracts = "0.6.3"
serde = { version = "1.0", default-features = false, features = ["derive"] }

[target.'cfg(target_os = "cuda")'.dependencies]
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "b26635f", features = ["derive"] }
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b53e88", features = ["derive"] }

[target.'cfg(not(target_os = "cuda"))'.dependencies]
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "b26635f", features = ["derive", "host"] }
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b53e88", features = ["derive", "host"] }
4 changes: 2 additions & 2 deletions necsim/impls/no-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fnv = { version = "1.0", default-features = false, features = [] }
rand_core = "0.6"

[target.'cfg(target_os = "cuda")'.dependencies]
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "b26635f", features = ["derive"], optional = true }
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b53e88", features = ["derive"], optional = true }

[target.'cfg(not(target_os = "cuda"))'.dependencies]
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "b26635f", features = ["derive", "host"], optional = true }
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b53e88", features = ["derive", "host"], optional = true }
2 changes: 1 addition & 1 deletion rustcoalescence/algorithms/cuda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ thiserror = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_state = "0.4"
serde_derive_state = "0.4"
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "b26635f", features = ["host"] }
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b53e88", features = ["host"] }
2 changes: 1 addition & 1 deletion rustcoalescence/algorithms/cuda/cpu-kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ necsim-impls-no-std = { path = "../../../../necsim/impls/no-std", features = ["c
necsim-impls-cuda = { path = "../../../../necsim/impls/cuda" }
rustcoalescence-algorithms-cuda-gpu-kernel = { path = "../gpu-kernel" }

rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "b26635f", features = ["host"] }
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b53e88", features = ["host"] }
1 change: 1 addition & 0 deletions rustcoalescence/algorithms/cuda/cpu-kernel/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![deny(clippy::pedantic)]
#![allow(incomplete_features)]
#![feature(specialization)]
#![recursion_limit = "1024"]

use necsim_core::{
cogs::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pipelining = false

[target.nvptx64-nvidia-cuda]
rustflags = ["-Clink-args=--arch=sm_35", "-Cpanic=abort", "-Clinker-plugin-lto", "-Ccodegen-units=1", "-Clink-arg=-Olto"]
rustflags = ["-Clink-args=--arch=sm_35", "-Cpanic=abort", "-Clinker-plugin-lto", "-Ccodegen-units=1", "-Clink-arg=-O3", "-Clink-arg=--lto"]

[unstable]
build-std = ["core", "alloc"]
Expand Down
2 changes: 1 addition & 1 deletion rustcoalescence/algorithms/cuda/gpu-kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ necsim-core-bond = { path = "../../../../necsim/core/bond" }
necsim-impls-no-std = { path = "../../../../necsim/impls/no-std", features = ["cuda"] }
necsim-impls-cuda = { path = "../../../../necsim/impls/cuda" }

rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "b26635f", features = ["derive"] }
rust-cuda = { git = "https://github.com/juntyr/rust-cuda", rev = "6b53e88", features = ["derive"] }
2 changes: 2 additions & 0 deletions rustcoalescence/algorithms/cuda/gpu-kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#![cfg_attr(target_os = "cuda", feature(asm_experimental_arch))]
#![cfg_attr(target_os = "cuda", feature(stdsimd))]
#![cfg_attr(target_os = "cuda", feature(control_flow_enum))]
#![allow(long_running_const_eval)]
#![recursion_limit = "1024"]

extern crate alloc;

Expand Down
4 changes: 2 additions & 2 deletions rustcoalescence/algorithms/cuda/src/initialiser/fixup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ where
.extend(out_of_deme.into_iter().map(ExceptionalLineage::OutOfDeme));
},
OutOfDemeStrategy::Dispersal => {
fixable_lineages.extend(out_of_deme.into_iter());
fixable_lineages.extend(out_of_deme);
},
}

Expand All @@ -139,7 +139,7 @@ where
);
},
OutOfHabitatStrategy::UniformDispersal => {
fixable_lineages.extend(out_of_habitat.into_iter());
fixable_lineages.extend(out_of_habitat);
},
}

Expand Down
2 changes: 1 addition & 1 deletion rustcoalescence/algorithms/cuda/src/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ where
steps,
lineages: lineages
.into_iter()
.chain(passthrough.into_iter())
.chain(passthrough)
.collect(),
rng: simulation.rng_mut().clone(),
marker: PhantomData::<M>,
Expand Down

0 comments on commit 4aab32d

Please sign in to comment.