Poplar and PopLibs
|
A program that executes a program repeatedly while a condition is false. More...
#include <Program.hpp>
Public Member Functions | |
RepeatWhileFalse (const Program &cond, Tensor predicate, const Program &body, const DebugContext &debugContext={}) | |
Construct a repeat-while-false program. More... | |
A program that executes a program repeatedly while a condition is false.
The program starts by executing the condition program, cond
, which should set the value of predicate
. If predicate
is true, then the loop exits. If predicate
is false then the body
program is executed and then it loops to execute cond
program again.
This is like a C while statement with an inverted condition.
poplar::program::RepeatWhileFalse::RepeatWhileFalse | ( | const Program & | cond, |
Tensor | predicate, | ||
const Program & | body, | ||
const DebugContext & | debugContext = {} |
||
) |
Construct a repeat-while-false program.
cond | The program executed before predicate is evaluated. The normal use case is that this will set the value of predicate . |
predicate | The scalar tensor (of type BOOL, UNSIGNED_INT, INT, SHORT or UNSIGNED_SHORT) that determines whether to execute body . Any non-zero value of the predicate is treated as true. |
body | The body to execute when predicate is false. |
debugContext | Optional DebugId and program name. |