Poplar and PopLibs
poplar::program::RepeatWhileFalse Class Reference

A program that executes a program repeatedly while a condition is false. More...

#include <Program.hpp>

Inheritance diagram for poplar::program::RepeatWhileFalse:
poplar::program::Program

Public Member Functions

 RepeatWhileFalse (const Program &cond, Tensor predicate, const Program &body, const DebugContext &debugContext={})
 Construct a repeat-while-false program. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RepeatWhileFalse()

poplar::program::RepeatWhileFalse::RepeatWhileFalse ( const Program cond,
Tensor  predicate,
const Program body,
const DebugContext debugContext = {} 
)

Construct a repeat-while-false program.

Parameters
condThe program executed before predicate is evaluated. The normal use case is that this will set the value of predicate.
predicateThe 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.
bodyThe body to execute when predicate is false.
debugContextOptional DebugId and program name.

The documentation for this class was generated from the following file: