Halide
Halide::Internal::For Struct Reference

A for loop. More...

#include <IR.h>

Inherits Halide::Internal::StmtNode< For >.

Public Member Functions

bool is_unordered_parallel () const
 
bool is_parallel () const
 
- Public Member Functions inherited from Halide::Internal::StmtNode< For >
void accept (IRVisitor *v) const override
 We use the visitor pattern to traverse IR nodes throughout the compiler, so we have a virtual accept method which accepts visitors. More...
 
Stmt mutate_stmt (IRMutator *v) const override
 
 StmtNode ()
 
 ~StmtNode () override=default
 
- Public Member Functions inherited from Halide::Internal::BaseStmtNode
 BaseStmtNode (IRNodeType t)
 
- Public Member Functions inherited from Halide::Internal::IRNode
 IRNode (IRNodeType t)
 
virtual ~IRNode ()=default
 

Static Public Member Functions

static Stmt make (const std::string &name, Expr min, Expr extent, ForType for_type, DeviceAPI device_api, Stmt body)
 

Public Attributes

std::string name
 
Expr min
 
Expr extent
 
ForType for_type
 
DeviceAPI device_api
 
Stmt body
 
- Public Attributes inherited from Halide::Internal::IRNode
RefCount ref_count
 These classes are all managed with intrusive reference counting, so we also track a reference count. More...
 
IRNodeType node_type
 Each IR node subclass has a unique identifier. More...
 

Static Public Attributes

static const IRNodeType _node_type = IRNodeType::For
 

Detailed Description

A for loop.

Execute the 'body' statement for all values of the variable 'name' from 'min' to 'min + extent'. There are four types of For nodes. A 'Serial' for loop is a conventional one. In a 'Parallel' for loop, each iteration of the loop happens in parallel or in some unspecified order. In a 'Vectorized' for loop, each iteration maps to one SIMD lane, and the whole loop is executed in one shot. For this case, 'extent' must be some small integer constant (probably 4, 8, or 16). An 'Unrolled' for loop compiles to a completely unrolled version of the loop. Each iteration becomes its own statement. Again in this case, 'extent' should be a small integer constant.

Definition at line 788 of file IR.h.

Member Function Documentation

◆ make()

static Stmt Halide::Internal::For::make ( const std::string &  name,
Expr  min,
Expr  extent,
ForType  for_type,
DeviceAPI  device_api,
Stmt  body 
)
static

◆ is_unordered_parallel()

bool Halide::Internal::For::is_unordered_parallel ( ) const
inline

Definition at line 797 of file IR.h.

References for_type, and Halide::Internal::is_unordered_parallel().

◆ is_parallel()

bool Halide::Internal::For::is_parallel ( ) const
inline

Definition at line 800 of file IR.h.

References for_type, and Halide::Internal::is_parallel().

Member Data Documentation

◆ name

std::string Halide::Internal::For::name

Definition at line 789 of file IR.h.

◆ min

Expr Halide::Internal::For::min

Definition at line 790 of file IR.h.

◆ extent

Expr Halide::Internal::For::extent

Definition at line 790 of file IR.h.

◆ for_type

ForType Halide::Internal::For::for_type

Definition at line 791 of file IR.h.

Referenced by is_parallel(), and is_unordered_parallel().

◆ device_api

DeviceAPI Halide::Internal::For::device_api

Definition at line 792 of file IR.h.

◆ body

Stmt Halide::Internal::For::body

Definition at line 793 of file IR.h.

◆ _node_type

const IRNodeType Halide::Internal::For::_node_type = IRNodeType::For
static

Definition at line 804 of file IR.h.


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