Skip to content

Commit

Permalink
Merge pull request #109 from ThibaultLejemble/cuda
Browse files Browse the repository at this point in the history
Fix compilation of Cuda example
  • Loading branch information
nmellado authored Oct 3, 2023
2 parents 0a48bd0 + e683f55 commit 23cc0f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Ponca changelog
--------------------------------------------------------------------------------
Current head (v.1.2 RC)

- Examples
- Fix example cuda/ponca_ssgls (#109)

--------------------------------------------------------------------------------
v.1.1 RC
This release improves the Spatial Partitioning Package with new features and
Expand Down
8 changes: 5 additions & 3 deletions examples/cuda/ponca_ssgls.cu
Original file line number Diff line number Diff line change
Expand Up @@ -271,21 +271,23 @@ class ProjectedWeightFunc: public Ponca::DistWeightFunc<ScreenSpacePoint,Ponca::
public:
typedef ScreenSpacePoint::Scalar Scalar;
typedef ScreenSpacePoint::VectorType VectorType;
typedef Ponca::DistWeightFunc<ScreenSpacePoint,Ponca::SmoothWeightKernel<Scalar> >::WeightReturnType WeightReturnType;


PONCA_MULTIARCH inline ProjectedWeightFunc(const Scalar& _t = Scalar(1.), const Scalar _dz = 0.f)
: Ponca::DistWeightFunc<ScreenSpacePoint,Ponca::SmoothWeightKernel<Scalar> >(_t),
m_dz(_dz) {}

PONCA_MULTIARCH inline Scalar w(const VectorType& _relativePos, const ScreenSpacePoint& _attributes) const
PONCA_MULTIARCH inline WeightReturnType w(const VectorType& _relativePos, const ScreenSpacePoint& _attributes) const
{
PONCA_MULTIARCH_STD_MATH(abs);
Scalar d = _attributes.spos().norm();
const float dz = abs(_relativePos[2]);
if (d > m_t || (m_dz != Scalar(0) && dz > m_dz))
{
return Scalar(0.);
return {Scalar(0.), _relativePos};
}
return m_wk.f(d/m_t);
return {m_wk.f(d/m_t), _relativePos};
}
private:
float m_dz;
Expand Down

0 comments on commit 23cc0f0

Please sign in to comment.