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

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

#include <Program.hpp>

Inheritance diagram for poplar::program::RepeatWhileTrue:
poplar::program::Program

Public Member Functions

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

Detailed Description

A program that executes a program repeatedly while a condition is true.

The program starts by executing the condition program, cond, which should set the value of predicate. If predicate is false, then the loop exits. If predicate is true then the body program is executed, and then it loops to execute cond program again.

This is like a C while statement.

Constructor & Destructor Documentation

◆ RepeatWhileTrue()

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

Construct a repeat-while-true 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 true.
debugContextOptional DebugId and program name.

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