Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdhn committed Sep 24, 2024
1 parent 28d5981 commit f1fec89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/rxmesh/diff/diff_attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class DiffAttribute : public Attribute<Scalar<T, Size, WithHessian>, HandleT>
*/
std::shared_ptr<BaseAttributeType> to_passive()
{
auto ret = m_rxmesh->template add_vertex_attribute<T>(
std::string("rx:") + std::string(m_name), 1, HOST);
m_rxmesh->for_each_vertex(HOST, [&](VertexHandle vh) {
auto ret = this->m_rxmesh->template add_vertex_attribute<T>(
std::string("rx:") + std::string(this->m_name), 1, HOST);
this->m_rxmesh->for_each_vertex(HOST, [&](VertexHandle vh) {
(*ret)(vh) = this->operator()(vh).val;
});

Expand Down
2 changes: 1 addition & 1 deletion include/rxmesh/diff/scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ struct Scalar
assert(is_finite_scalar(a));
assert(is_finite_scalar(b));

assert(a.grad.size(), b.grad.size());
assert(a.grad.size() == b.grad.size());

return sqrt(a * a + b * b);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/RXMesh_test/test_scalar.cu
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ __inline__ __device__ void test_sqr(int* d_err, T eps)
using namespace rxmesh;
using Real2 = Scalar<T, 2, WithHessian>;

Real2 x = Real2::Scalar(4.0, 0);
Real2 y = Real2::Scalar(6.0, 1);
Real2 x(4.0, 0);
Real2 y(6.0, 1);
Real2 a = x * x + 7.0 * y * y - 8.0 * x + 2 * y;

Real2 a_sqr = sqr(a);
Expand Down

0 comments on commit f1fec89

Please sign in to comment.