Skip to content

Commit

Permalink
Fix a typo in SYCL version of scan (AMReX-Codes#3757)
Browse files Browse the repository at this point in the history
This is a small performance issue. With the typo, it always does a
memcpy from device to host to get the total sum even when it's told it's
not needed.
  • Loading branch information
WeiqunZhang authored Feb 13, 2024
1 parent 68244ec commit 30c7791
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Src/Base/AMReX_Scan.H
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ T PrefixSum (N n, FIN && fin, FOUT && fout, TYPE type, RetSum a_ret_sum = retSum

#ifndef AMREX_SYCL_NO_MULTIPASS_SCAN
if (nblocks > 1) {
return PrefixSum_mp<T>(n, std::forward<FIN>(fin), std::forward<FOUT>(fout), type, retSum);
return PrefixSum_mp<T>(n, std::forward<FIN>(fin), std::forward<FOUT>(fout), type, a_ret_sum);
}
#endif

Expand Down

0 comments on commit 30c7791

Please sign in to comment.