Skip to content

Commit

Permalink
AsterSeeds: move loop to host
Browse files Browse the repository at this point in the history
  • Loading branch information
jaykalinani committed Sep 4, 2024
1 parent c5943c7 commit 75adf66
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions AsterSeeds/src/magBNS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern "C" void AsterSeeds_InitializeCenteredAvec_BNS(CCTK_ARGUMENTS) {
if (CCTK_EQUALS(Afield_config, "internal dipole")) {

/* computing cell centered vector potential components */
grid.loop_all_device<1, 1, 1>(
grid.loop_all<1, 1, 1>(
grid.nghostzones,
[=] CCTK_HOST(const Loop::PointDesc &p) CCTK_ATTRIBUTE_ALWAYS_INLINE {
// dummy initialization
Expand Down Expand Up @@ -49,7 +49,7 @@ extern "C" void AsterSeeds_InitializeCenteredAvec_BNS(CCTK_ARGUMENTS) {
} else if (CCTK_EQUALS(Afield_config, "external dipole")) {

/* computing cell centered vector potential components */
grid.loop_all_device<1, 1, 1>(
grid.loop_all<1, 1, 1>(
grid.nghostzones,
[=] CCTK_HOST(const Loop::PointDesc &p) CCTK_ATTRIBUTE_ALWAYS_INLINE {
// For star 1 at minus side
Expand Down Expand Up @@ -96,19 +96,19 @@ extern "C" void AsterSeeds_InitializeStagAvec_BNS(CCTK_ARGUMENTS) {
DECLARE_CCTK_ARGUMENTSX_AsterSeeds_InitializeStagAvec_BNS;
DECLARE_CCTK_PARAMETERS;

grid.loop_int_device<1, 0, 0>(
grid.loop_int<1, 0, 0>(
grid.nghostzones,
[=] CCTK_HOST(const Loop::PointDesc &p) CCTK_ATTRIBUTE_ALWAYS_INLINE {
Avec_x(p.I) = calc_avg_c2e(Avec_x_cent, p, 0);
});

grid.loop_int_device<0, 1, 0>(
grid.loop_int<0, 1, 0>(
grid.nghostzones,
[=] CCTK_HOST(const Loop::PointDesc &p) CCTK_ATTRIBUTE_ALWAYS_INLINE {
Avec_y(p.I) = calc_avg_c2e(Avec_y_cent, p, 1);
});

grid.loop_int_device<0, 0, 1>(
grid.loop_int<0, 0, 1>(
grid.nghostzones,
[=] CCTK_HOST(const Loop::PointDesc &p) CCTK_ATTRIBUTE_ALWAYS_INLINE {
Avec_z(p.I) = calc_avg_c2e(Avec_z_cent, p, 2);
Expand Down

0 comments on commit 75adf66

Please sign in to comment.