Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Halide::Internal::For Struct Reference

A for loop. More...

#include <IR.h>

Inheritance diagram for Halide::Internal::For:
Halide::Internal::StmtNode< For > Halide::Internal::BaseStmtNode Halide::Internal::IRNode

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.
 
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, Partition partition_policy, DeviceAPI device_api, Stmt body)
 

Public Attributes

std::string name
 
Expr min
 
Expr extent
 
ForType for_type
 
DeviceAPI device_api
 
Stmt body
 
Partition partition_policy
 
- 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.
 
IRNodeType node_type
 Each IR node subclass has a unique identifier.
 

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 819 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,
Partition partition_policy,
DeviceAPI device_api,
Stmt body )
static

◆ is_unordered_parallel()

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

Definition at line 833 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 836 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 820 of file IR.h.

◆ min

Expr Halide::Internal::For::min

Definition at line 821 of file IR.h.

◆ extent

Expr Halide::Internal::For::extent

Definition at line 821 of file IR.h.

◆ for_type

ForType Halide::Internal::For::for_type

Definition at line 822 of file IR.h.

Referenced by is_parallel(), and is_unordered_parallel().

◆ device_api

DeviceAPI Halide::Internal::For::device_api

Definition at line 823 of file IR.h.

◆ body

Stmt Halide::Internal::For::body

Definition at line 824 of file IR.h.

◆ partition_policy

Partition Halide::Internal::For::partition_policy

Definition at line 825 of file IR.h.

◆ _node_type

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

Definition at line 840 of file IR.h.


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