ONE - On-device Neural Engine
Loading...
Searching...
No Matches
TestHelper.h File Reference
#include "Check.h"
#include "ProgressReporter.h"
#include "Passes.h"
#include <logo/Pass.h>
#include <logo/Phase.h>
#include <loco.h>
#include <memory>
#include <gtest/gtest.h>

Go to the source code of this file.

Data Structures

class  exo::test::TypeShapeReadyPhase
 Phase for test, that is used to test pass. This phase initially adds TypeInferencePass and ShapeInferencePass. More...
 

Namespaces

namespace  exo
 
namespace  exo::test
 

Macros

#define EXO_TEST_ASSERT_NODE_COUNT(OUTPUTS, COUNT)
 Check the number of nodes in a graph starting from OUTPUTS.
 

Functions

template<typename LocoNodeT >
LocoNodeT * exo::test::get_only_succ (loco::Node *parent)
 Get the only succ object of type LocoNodeT. (The name only succ comes from English word only child.) parent must have 1 succ only. When there is no succ of type LocoNodeT, nullptr will be returned.
 
template<typename T >
T * exo::test::find_first_node_bytype (loco::Graph *g)
 

Macro Definition Documentation

◆ EXO_TEST_ASSERT_NODE_COUNT

#define EXO_TEST_ASSERT_NODE_COUNT (   OUTPUTS,
  COUNT 
)
Value:
{ \
auto v = loco::postorder_traversal(OUTPUTS); \
ASSERT_EQ(v.size(), (COUNT)); \
}
#define COUNT(X)
Definition Macro.h:20
std::vector< loco::Node * > postorder_traversal(const std::vector< loco::Node * > &roots)
Generate postorder traversal sequence starting from "roots".
Definition Algorithm.cpp:53

Check the number of nodes in a graph starting from OUTPUTS.

Definition at line 36 of file TestHelper.h.

37 { \
38 auto v = loco::postorder_traversal(OUTPUTS); \
39 ASSERT_EQ(v.size(), (COUNT)); \
40 }