Skip to content

Commit

Permalink
Fixes #581: Slight robustification of dimensions comparison functions
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalroz committed Mar 1, 2024
1 parent f274fea commit 6220a01
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cuda/api/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,22 @@ struct dimensions_t // this almost-inherits dim3
};

///@cond
constexpr bool operator==(const dim3& lhs, const dim3& rhs) noexcept
constexpr inline bool operator==(const dim3& lhs, const dim3& rhs) noexcept
{
return lhs.x == rhs.x and lhs.y == rhs.y and lhs.z == rhs.z;
}
constexpr bool operator==(const dimensions_t& lhs, const dimensions_t& rhs) noexcept
constexpr inline bool operator!=(const dim3& lhs, const dim3& rhs) noexcept
{
return not (lhs == rhs);
}
constexpr inline bool operator==(const dimensions_t& lhs, const dimensions_t& rhs) noexcept
{
return lhs.x == rhs.x and lhs.y == rhs.y and lhs.z == rhs.z;
}
constexpr inline bool operator!=(const dimensions_t& lhs, const dimensions_t& rhs) noexcept
{
return not (lhs == rhs);
}
///@endcond


Expand Down

0 comments on commit 6220a01

Please sign in to comment.