@@ -31,26 +31,28 @@ use necsim_impls_no_std::cogs::{
3131 event_sampler:: tracking:: { MinSpeciationTrackingEventSampler , SpeciationSample } ,
3232} ;
3333
34- use rust_cuda:: common:: RustToCuda ;
34+ use rust_cuda:: { common:: RustToCuda , safety :: NoAliasing } ;
3535
3636#[ rust_cuda:: common:: kernel(
37- pub use link_kernel! as impl SimulatableKernel <SimulationKernelArgs > for SimulationKernel
37+ pub use link_kernel! as impl SimulatableKernel <
38+ SimulationKernelArgs , SimulationKernelPtx ,
39+ > for SimulationKernel
3840) ]
3941#[ allow( clippy:: too_many_arguments) ]
4042#[ allow( clippy:: type_complexity) ]
4143pub fn simulate <
4244 M : MathsCore ,
43- H : Habitat < M > + RustToCuda ,
44- G : Rng < M , Generator : PrimeableRng > + RustToCuda ,
45- S : LineageStore < M , H > + RustToCuda ,
46- X : EmigrationExit < M , H , G , S > + RustToCuda ,
47- D : DispersalSampler < M , H , G > + RustToCuda ,
48- C : CoalescenceSampler < M , H , S > + RustToCuda ,
49- T : TurnoverRate < M , H > + RustToCuda ,
50- N : SpeciationProbability < M , H > + RustToCuda ,
51- E : MinSpeciationTrackingEventSampler < M , H , G , S , X , D , C , T , N > + RustToCuda ,
52- I : ImmigrationEntry < M > + RustToCuda ,
53- A : SingularActiveLineageSampler < M , H , G , S , X , D , C , T , N , E , I > + RustToCuda ,
45+ H : Habitat < M > + RustToCuda + NoAliasing ,
46+ G : Rng < M , Generator : PrimeableRng > + RustToCuda + NoAliasing ,
47+ S : LineageStore < M , H > + RustToCuda + NoAliasing ,
48+ X : EmigrationExit < M , H , G , S > + RustToCuda + NoAliasing ,
49+ D : DispersalSampler < M , H , G > + RustToCuda + NoAliasing ,
50+ C : CoalescenceSampler < M , H , S > + RustToCuda + NoAliasing ,
51+ T : TurnoverRate < M , H > + RustToCuda + NoAliasing ,
52+ N : SpeciationProbability < M , H > + RustToCuda + NoAliasing ,
53+ E : MinSpeciationTrackingEventSampler < M , H , G , S , X , D , C , T , N > + RustToCuda + NoAliasing ,
54+ I : ImmigrationEntry < M > + RustToCuda + NoAliasing ,
55+ A : SingularActiveLineageSampler < M , H , G , S , X , D , C , T , N , E , I > + RustToCuda + NoAliasing ,
5456 ReportSpeciation : Boolean ,
5557 ReportDispersal : Boolean ,
5658> (
@@ -135,13 +137,17 @@ pub fn simulate<
135137}
136138
137139// #[rust_cuda::common::kernel(
138- // pub use link_sort_kernel! as impl SortableKernel<SortKernelArgs> for
139- // SortKernel )]
140+ // pub use link_sort_kernel! as impl SortableKernel<
141+ // SortKernelArgs, SortKernelPtx,
142+ // > for SortKernel
143+ // )]
140144// pub fn sort_events_step<ReportSpeciation: Boolean, ReportDispersal: Boolean>(
141- // #[kernel(pass = LendRustToCuda, jit)] event_buffer_reporter: &mut
142- // ShallowCopy<
143- // necsim_impls_cuda::event_buffer::EventBuffer<ReportSpeciation,
144- // ReportDispersal>, >,
145+ // #[kernel(pass = LendRustToCuda, jit)]
146+ // event_buffer_reporter: &mut ShallowCopy<
147+ // necsim_impls_cuda::event_buffer::EventBuffer<
148+ // ReportSpeciation, ReportDispersal,
149+ // >,
150+ // >,
145151// #[kernel(pass = SafeDeviceCopy)] size: usize,
146152// #[kernel(pass = SafeDeviceCopy)] stride: usize,
147153// ) {
@@ -152,7 +158,9 @@ pub fn simulate<
152158// }
153159
154160#[ rust_cuda:: common:: kernel(
155- pub use link_even_odd_sort_kernel! as impl EvenOddSortableKernel <EvenOddSortKernelArgs > for EvenOddSortKernel
161+ pub use link_even_odd_sort_kernel! as impl EvenOddSortableKernel <
162+ EvenOddSortKernelArgs , EvenOddSortKernelPtx ,
163+ > for EvenOddSortKernel
156164) ]
157165pub fn even_odd_sort_events_step < ReportSpeciation : Boolean , ReportDispersal : Boolean > (
158166 #[ kernel( pass = LendRustToCuda , jit) ] event_buffer_reporter : & mut ShallowCopy <
@@ -168,7 +176,9 @@ pub fn even_odd_sort_events_step<ReportSpeciation: Boolean, ReportDispersal: Boo
168176}
169177
170178#[ rust_cuda:: common:: kernel(
171- pub use link_bitonic_global_sort_step_kernel! as impl BitonicGlobalSortSteppableKernel <BitonicGlobalSortStepKernelArgs > for BitonicGlobalSortStepKernel
179+ pub use link_bitonic_global_sort_step_kernel! as impl BitonicGlobalSortSteppableKernel <
180+ BitonicGlobalSortStepKernelArgs , BitonicGlobalSortStepKernelPtx ,
181+ > for BitonicGlobalSortStepKernel
172182) ]
173183pub fn bitonic_global_sort_events_step < ReportSpeciation : Boolean , ReportDispersal : Boolean > (
174184 #[ kernel( pass = LendRustToCuda , jit) ] event_buffer_reporter : & mut ShallowCopy <
@@ -184,7 +194,9 @@ pub fn bitonic_global_sort_events_step<ReportSpeciation: Boolean, ReportDispersa
184194}
185195
186196#[ rust_cuda:: common:: kernel(
187- pub use link_bitonic_shared_sort_step_kernel! as impl BitonicSharedSortSteppableKernel <BitonicSharedSortStepKernelArgs > for BitonicSharedSortStepKernel
197+ pub use link_bitonic_shared_sort_step_kernel! as impl BitonicSharedSortSteppableKernel <
198+ BitonicSharedSortStepKernelArgs , BitonicSharedSortStepKernelPtx ,
199+ > for BitonicSharedSortStepKernel
188200) ]
189201pub fn bitonic_shared_sort_events_step < ReportSpeciation : Boolean , ReportDispersal : Boolean > (
190202 #[ kernel( pass = LendRustToCuda , jit) ] event_buffer_reporter : & mut ShallowCopy <
@@ -199,7 +211,9 @@ pub fn bitonic_shared_sort_events_step<ReportSpeciation: Boolean, ReportDispersa
199211}
200212
201213#[ rust_cuda:: common:: kernel(
202- pub use link_bitonic_shared_sort_prep_kernel! as impl BitonicSharedSortPreparableKernel <BitonicSharedSortPrepKernelArgs > for BitonicSharedSortPrepKernel
214+ pub use link_bitonic_shared_sort_prep_kernel! as impl BitonicSharedSortPreparableKernel <
215+ BitonicSharedSortPrepKernelArgs , BitonicSharedSortPrepKernelPtx ,
216+ > for BitonicSharedSortPrepKernel
203217) ]
204218pub fn bitonic_shared_sort_events_prep < ReportSpeciation : Boolean , ReportDispersal : Boolean > (
205219 #[ kernel( pass = LendRustToCuda , jit) ] event_buffer_reporter : & mut ShallowCopy <
@@ -215,10 +229,10 @@ pub fn bitonic_shared_sort_events_prep<ReportSpeciation: Boolean, ReportDispersa
215229mod cuda_prelude {
216230 use core:: arch:: nvptx;
217231
218- use rust_cuda:: device:: utils ;
232+ use rust_cuda:: device:: alloc :: PTXAllocator ;
219233
220234 #[ global_allocator]
221- static _GLOBAL_ALLOCATOR: utils :: PTXAllocator = utils :: PTXAllocator ;
235+ static _GLOBAL_ALLOCATOR: PTXAllocator = PTXAllocator ;
222236
223237 #[ cfg( not( debug_assertions) ) ]
224238 #[ panic_handler]
0 commit comments