Skip to content

Commit

Permalink
simplify size calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Aug 2, 2023
1 parent ee4cd17 commit a3b2be0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/base/kernel_launch_generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ void run1d_reduction_cached(std::shared_ptr<gko::EXEC_TYPE> exec,
static_cast<int64>(size));
// The temporary storage (used for partial sums) must be smaller than
// the input array
ASSERT_LE(temp.get_num_elems() / sizeof(int64), size);
ASSERT_LE(temp.get_num_elems(), size * sizeof(int64));
}
}

Expand Down Expand Up @@ -477,7 +477,7 @@ void run2d_reduction_cached(std::shared_ptr<gko::EXEC_TYPE> exec,
static_cast<int64>(dim[0] + dim[1]));
// The temporary storage (used for partial sums) must be smaller than
// the input array
ASSERT_LE(temp.get_num_elems() / sizeof(int64), dim[0] * dim[1]);
ASSERT_LE(temp.get_num_elems(), dim[0] * dim[1] * sizeof(int64));
}
}

Expand Down Expand Up @@ -569,7 +569,7 @@ void run2d_row_reduction_cached(std::shared_ptr<gko::EXEC_TYPE> exec,
GKO_ASSERT_ARRAY_EQ(host_ref, output);
// The temporary storage (used for partial sums) must be smaller than
// the input array
ASSERT_LE(temp.get_num_elems() / sizeof(int64), dim[0] * dim[1]);
ASSERT_LE(temp.get_num_elems(), dim[0] * dim[1] * sizeof(int64));
}
}

Expand Down Expand Up @@ -660,7 +660,7 @@ void run2d_col_reduction_cached(std::shared_ptr<gko::EXEC_TYPE> exec,
dim, temp);

GKO_ASSERT_ARRAY_EQ(host_ref, output);
ASSERT_LE(temp.get_num_elems() / sizeof(int64), dim[0] * dim[1]);
ASSERT_LE(temp.get_num_elems(), dim[0] * dim[1] * sizeof(int64));
}
}

Expand Down

0 comments on commit a3b2be0

Please sign in to comment.