Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
wujingyue committed Dec 10, 2024
1 parent 016eb60 commit 6d03163
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/cpp/test_multidevice_lower_communication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// clang-format on

#include <gmock/gmock-matchers.h>
#include <gmock/gmock-more-matchers.h>
#include <gtest/gtest.h>

#include <ops/all_ops.h>
Expand All @@ -16,15 +17,23 @@

namespace nvfuser {

using testing::Each;
using testing::IsTrue;
using testing::Pointer;
using testing::Property;

namespace {
void assertIsCompiledToHostIrContainer(
const FusionExecutorCache& executor_cache) {
FusionKernelRuntime* runtime = executor_cache.getMostRecentKernelRuntime();
EXPECT_TRUE(runtime->executors().size() == 1);
for (const auto& ea : runtime->executors()) {
EXPECT_TRUE(ea->isA<HostIrExecutor>())
<< "failed to compile to a HostIrContainer with Communications";
}
EXPECT_EQ(runtime->executors().size(), 1);
EXPECT_THAT(
runtime->executors(),
Each(Pointer(Property(
"is a HostIrExecutor",
&ExecutorAbstract::isA<HostIrExecutor>,
IsTrue()))))
<< "failed to compile to a HostIrContainer with Communications";
}
} // namespace

Expand Down

0 comments on commit 6d03163

Please sign in to comment.