MyraMath
cycle


Source: tests/jobgraph/cycle.cpp

1 // ========================================================================= //
2 // This file is part of MyraMath, copyright (c) 2014-2019 by Ryan A Chilton //
3 // and distributed by MyraCore, LLC. See LICENSE.txt for license terms. //
4 // ========================================================================= //
5 
11 // JobGraph bits.
14 
15 // Reporting.
16 #include <tests/myratest.h>
17 
18 using namespace myra;
19 
20 ADD_TEST("cycle","[jobgraph]")
21  {
22  UserJobGraph G;
23  //
24  // j0 --> j1 --> j2 --> j3 --> j4
25  // ^ |
26  // | |
27  // \ /
28  // -----------
29  //
30  uint64_t j0 = G.insert([](){});
31  uint64_t j1 = G.insert([](){});
32  uint64_t j2 = G.insert([](){});
33  uint64_t j3 = G.insert([](){});
34  uint64_t j4 = G.insert([](){});
35  G.add_edge(j0,j1);
36  G.add_edge(j1,j2);
37  G.add_edge(j2,j3);
38  G.add_edge(j3,j1);
39  G.add_edge(j3,j4);
40  REQUIRE( !verify(G) );
41  }
uint64_t insert(const Functor &f)
Inserts a Job (in the form of a C++11 lambda) to this JobGraph, returns its unique JobID...
Definition: UserJobGraph.h:139
Given a JobGraph G, verifies it has valid topology.
Definition: syntax.dox:1
void add_edge(uint64_t j0, uint64_t j1)
Adds a dependency, that Job j0 must execute before Job j1.
Definition: UserJobGraph.h:159
Container-like JobGraph class, can be manually populated with user-defined Job&#39;s and dependencies...
Container-like JobGraph class, can be manually populated with user-defined Job&#39;s and dependencies...
Definition: UserJobGraph.h:31


Results: [PASS]


Go back to Summary of /test programs.