Skip to content

Commit

Permalink
#5 Fixed faulty copy back from staging area to main-memory copy in ou…
Browse files Browse the repository at this point in the history
…t of core diffusion.
  • Loading branch information
carljohnsen committed Sep 11, 2024
1 parent 360321d commit 63aaeac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/cpp/gpu/diffusion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,13 @@ namespace gpu {
const int64_t
src_index = ((int64_t)z+radius)*(int64_t)global_shape_padded.y*(int64_t)global_shape_padded.x + ((int64_t)y+radius)*(int64_t)global_shape_padded.x + (int64_t)x+radius,
dst_index = ((int64_t)start_z+(int64_t)z)*(int64_t)total_shape.y*(int64_t)total_shape.x + ((int64_t)start_y+(int64_t)y)*(int64_t)total_shape.x + (int64_t)start_x+(int64_t)x;
const bool
valid_z = start_z+z < total_shape.z,
valid_y = start_y+y < total_shape.y,
valid_x = start_x+x < total_shape.x;
if (valid_z && valid_y && valid_x) {
buf1[dst_index] = buf1_stage[src_index];
}
}
}
}
Expand Down

0 comments on commit 63aaeac

Please sign in to comment.