diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2014-10-02 13:50:59 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-01-19 11:15:56 +0100 |
commit | 3eb6f61e48f7ab6ddaa0e78d9140a4322dbb92fb (patch) | |
tree | 0e247879bc97dfc8427fd965aa7c3d3d47f7c935 /cuda/2d/arith.cu | |
parent | 9715fadb1511277add807fc033c32d417fa6ffe0 (diff) | |
download | astra-3eb6f61e48f7ab6ddaa0e78d9140a4322dbb92fb.tar.gz astra-3eb6f61e48f7ab6ddaa0e78d9140a4322dbb92fb.tar.bz2 astra-3eb6f61e48f7ab6ddaa0e78d9140a4322dbb92fb.tar.xz astra-3eb6f61e48f7ab6ddaa0e78d9140a4322dbb92fb.zip |
Add CUDA SIRT::doSlabCorrections() function
This function optionally compensates for effectively infinitely large slab-like
objects of finite thickness 1.
Diffstat (limited to 'cuda/2d/arith.cu')
-rw-r--r-- | cuda/2d/arith.cu | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cuda/2d/arith.cu b/cuda/2d/arith.cu index d1b189c..0f84e52 100644 --- a/cuda/2d/arith.cu +++ b/cuda/2d/arith.cu @@ -68,6 +68,14 @@ struct opMul { out *= in; } }; +struct opDiv { + __device__ void operator()(float& out, const float in) { + if (in > 0.000001f) // out is assumed to be positive + out /= in; + else + out = 0.0f; + } +}; struct opMul2 { __device__ void operator()(float& out, const float in1, const float in2) { out *= in1 * in2; @@ -682,6 +690,7 @@ INST_DtoD(opDividedBy) INST_toD(opInvert) INST_FtoD(opSet) INST_FtoD(opMul) +INST_DtoD(opDiv) INST_DFtoD(opMulMask) INST_FtoD(opAdd) INST_FtoD(opClampMin) |