Skip to content

Commit

Permalink
removed exponential table lookup by default. Has been replaced by a s…
Browse files Browse the repository at this point in the history
…imple call to exp.
  • Loading branch information
jtramm committed Jan 21, 2015
1 parent 6ed0866 commit 5246d7a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ NEW IN VERSION 2
particular system. This option is altered using the "-p" command line option
on the CUDA version (defaults to 100).

- Exponential Table lookup has been disabled by default. It was found that
on most architectures, it's actually faster to just do the EXP call than
it is to have to read from memory.

===============================================================================
NEW IN VERSION 1
===============================================================================
Expand Down
5 changes: 4 additions & 1 deletion src/cpu/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ void attenuate_segment( Input * restrict I, Source * restrict S,
#pragma vector_level(10)
#endif
for( int g = 0; g < egroups; g++)
expVal[g] = interpolateTable( table, tau[g] );
{
//expVal[g] = interpolateTable( table, tau[g] );
expVal[g] = 1.f - exp( -tau[g] ); // exp is faster on many architectures
}

// Flux Integral

Expand Down
3 changes: 2 additions & 1 deletion src/cuda/kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ __global__ void run_kernel( Input I, Source * S,
tau = sigT * ds;
sigT2 = sigT * sigT;

interpolateTable( table, tau, &expVal );
//interpolateTable( table, tau, &expVal );
expVal = 1.f - exp( -tau); // EXP function is fater than table lookup

// Flux Integral

Expand Down

0 comments on commit 5246d7a

Please sign in to comment.