Skip to content

Commit

Permalink
Converted the error msg from a stringstream to a string
Browse files Browse the repository at this point in the history
  • Loading branch information
ldh4 committed Dec 1, 2023
1 parent 0e9ee83 commit c1e32ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions core/src/KokkosExp_MDRangePolicy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static_assert(false,
#include <impl/KokkosExp_Host_IterateTile.hpp>
#include <Kokkos_ExecPolicy.hpp>
#include <type_traits>
#include <sstream>

namespace Kokkos {

Expand Down Expand Up @@ -330,11 +329,12 @@ struct MDRangePolicy : public Kokkos::Impl::PolicyTraits<Properties...> {
const index_type length = m_upper[i] - m_lower[i];

if (m_upper[i] < m_lower[i]) {
std::stringstream msg;
msg << "Kokkos::MDRangePolicy bounds error: The lower bound ("
<< m_lower[i] << ") is greater than its upper bound (" << m_upper[i]
<< ") in rank " << i + 1 << ".";
Kokkos::abort(msg.str().c_str());
std::string msg =
"Kokkos::MDRangePolicy bounds error: The lower bound (" +
std::to_string(m_lower[i]) + ") is greater than its upper bound (" +
std::to_string(m_upper[i]) + ") in rank " + std::to_string(i + 1) +
".";
Kokkos::abort(msg.c_str());
}

if (m_tile[i] <= 0) {
Expand Down
4 changes: 3 additions & 1 deletion core/unit_test/default/TestDefaultDeviceDevelop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

namespace Test {

TEST(defaultdevicetype, development_test) {}
TEST(defaultdevicetype, development_test) {
Kokkos::parallel_for("Loop", Kokkos::RangePolicy<>(100, 1), KOKKOS_LAMBDA(int i) { printf("one\n"); } );
}

} // namespace Test

0 comments on commit c1e32ce

Please sign in to comment.