Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rank check on reductions #724

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/matx/operators/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto all(const InType &in, const int (&dims)[D])
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/any.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto any(const InType &in, const int (&dims)[D])
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/argmax.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto argmax(const InType &in, const int (&dims)[D])
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/argmin.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto argmin(const InType &in, const int (&dims)[D])
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
4 changes: 2 additions & 2 deletions include/matx/operators/max.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto max(const InType &in, const int (&dims)[D])
{
static_assert(D <= InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand All @@ -144,7 +144,7 @@ template <typename InType, int D>
[[deprecated("Use max() instead of rmax() for reductions")]]
__MATX_INLINE__ auto rmax(const InType &in, const int (&dims)[D])
{
static_assert(D <= InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/mean.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto mean(const InType &in, const int (&dims)[D])
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/median.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto median(const InType &in, const int (&dims)[D])
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
4 changes: 2 additions & 2 deletions include/matx/operators/min.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto min(const InType &in, const int (&dims)[D])
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand All @@ -144,7 +144,7 @@ template <typename InType, int D>
[[deprecated("Use min() instead of rmin() for reductions")]]
__MATX_INLINE__ auto rmin(const InType &in, const int (&dims)[D])
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/percentile.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto percentile(const InType &in, unsigned char q, const int (&dims)[D], PercentileMethod method = PercentileMethod::LINEAR)
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
MATX_ASSERT_STR(q < 100, matxInvalidParameter, "Percentile must be < 100");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);
Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/prod.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto prod(const InType &in, const int (&dims)[D])
{
static_assert(D <= InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/stdd.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto stdd(const InType &in, const int (&dims)[D])
{
static_assert(D <= InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/sum.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto sum(const InType &in, const int (&dims)[D])
{
static_assert(D <= InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
2 changes: 1 addition & 1 deletion include/matx/operators/var.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace detail {
template <typename InType, int D>
__MATX_INLINE__ auto var(const InType &in, const int (&dims)[D], int ddof = 1)
{
static_assert(D < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(D < InType::Rank(), "reduction dimensions must be < Rank of input");
auto perm = detail::getPermuteDims<InType::Rank()>(dims);
auto permop = permute(in, perm);

Expand Down
4 changes: 2 additions & 2 deletions include/matx/transforms/reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ void __MATX_INLINE__ mean_impl(OutType dest, const InType &in,
{
#ifdef __CUDACC__
MATX_NVTX_START("mean_impl(" + get_type_str(in) + ")", matx::MATX_NVTX_LOG_API)
static_assert(OutType::Rank() < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(OutType::Rank() < InType::Rank(), "reduction dimensions must be < Rank of input");

using inner_type = typename inner_op_type_t<typename InType::value_type>::type;
inner_type scale = 1;
Expand Down Expand Up @@ -1534,7 +1534,7 @@ void __MATX_INLINE__ mean_impl(OutType dest, const InType &in, [[maybe_unused]]
{
MATX_NVTX_START("mean_impl(" + get_type_str(in) + ")", matx::MATX_NVTX_LOG_API)

static_assert(OutType::Rank() < InType::Rank(), "reduction dimensions must be <= Rank of input");
static_assert(OutType::Rank() < InType::Rank(), "reduction dimensions must be < Rank of input");
using inner_type = typename inner_op_type_t<typename InType::value_type>::type;
inner_type scale = 1;

Expand Down