Skip to content

Commit

Permalink
Change when conversion Realf -> Real happens in acceleration.
Browse files Browse the repository at this point in the history
This is faster, but leads to slightly different numerical results as the accumulation is now done in single and not double precision. Difference within expected range, accuracty of SP.
  • Loading branch information
Sebastian von Alfthan committed May 21, 2014
1 parent 71f369e commit d37d1e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.o
version.cpp
\#*\#
*~
*~
vlasiator
3 changes: 2 additions & 1 deletion vlasovsolver/cpu_acc_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ bool map_1d(SpatialCell* spatial_cell,
for(uint target_i = 0; target_i < 4;target_i ++ ){
const uint tblock=target_block[target_i];
const uint tcell=target_cell[target_i];
const Real tval=target_density[target_i];
/*do the conversion from Real to Realf here, faster than doin in accumulation*/
const Realf tval=target_density[target_i];
/*check that we are within sane limits. If gk is negative,
* or above blocks_per_dim * blockcells_per_dim then we
* are outside of the target grid.*/
Expand Down

0 comments on commit d37d1e7

Please sign in to comment.