Skip to content

Commit

Permalink
Move memory reference inside PRAGMA
Browse files Browse the repository at this point in the history
Causes a memory corruption when defining internal pos
  • Loading branch information
williamfgc committed Oct 21, 2023
1 parent 1359f2d commit a724445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Particle/SoaDistanceTableAATOMPTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ struct SoaDistanceTableAATOMPTarget :
auto* rsoa_dev_list_ptr =
coordinates_leader.getMultiWalkerRSoADevicePtrs().data();
auto* r_dr_ptr = mw_new_old_dist_displ.data();
auto* new_pos_ptr = coordinates_leader.getFusedNewPosBuffer().data();
const size_t new_pos_stride =
coordinates_leader.getFusedNewPosBuffer().capacity();

Expand All @@ -428,6 +427,7 @@ struct SoaDistanceTableAATOMPTarget :
for (int iw = 0; iw < nw; ++iw)
for (int team_id = 0; team_id < num_teams; team_id++) {
auto* source_pos_ptr = rsoa_dev_list_ptr[iw];
auto* new_pos_ptr = coordinates_leader.getFusedNewPosBuffer().data();
const size_t first = ChunkSizePerTeam * team_id;
const size_t last = omptarget::min(
first + ChunkSizePerTeam, num_sources_local);
Expand Down

0 comments on commit a724445

Please sign in to comment.