Skip to content

Commit 168fb4e

Browse files
committed
gpu: move particle injection back
to before pushing particles. The GPU code is expecting this order, though it certainly is not desirable to have two different ways of doing it depending on whether GPU is used or not.
1 parent c8e3a88 commit 168fb4e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/include/psc.hxx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,15 @@ struct Psc
363363
prof_stop(pr_collision);
364364
}
365365

366+
#ifdef USE_CUDA
367+
// === particle injection
368+
prof_start(pr_inject_prts);
369+
for (auto injector : injectors_) {
370+
injector->inject(mprts_, mflds_);
371+
}
372+
prof_stop(pr_inject_prts);
373+
#endif
374+
366375
if (checks_.continuity.should_do_check(timestep)) {
367376
mpi_printf(comm, "***** Checking continuity (1 of 2)...\n");
368377
prof_start(pr_checks);
@@ -376,12 +385,14 @@ struct Psc
376385
pushp_.push_mprts(mprts_, mflds_);
377386
prof_stop(pr_push_prts);
378387

388+
#ifndef USE_CUDA
379389
// === particle injection
380390
prof_start(pr_inject_prts);
381391
for (auto injector : injectors_) {
382392
injector->inject(mprts_, mflds_);
383393
}
384394
prof_stop(pr_inject_prts);
395+
#endif
385396

386397
// === external current
387398
prof_start(pr_external_current);

0 commit comments

Comments
 (0)