Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Halide::Internal::For Struct Reference

A for loop. More...

`#include <IR.h>`

Inheritance diagram for Halide::Internal::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.
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 848 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 862 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 865 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 849 of file IR.h.

## ◆ min

Expr Halide::Internal::For::min

Definition at line 850 of file IR.h.

## ◆ extent

Expr Halide::Internal::For::extent

Definition at line 850 of file IR.h.

## ◆ for_type

ForType Halide::Internal::For::for_type

Definition at line 851 of file IR.h.

Referenced by is_parallel(), and is_unordered_parallel().

## ◆ device_api

DeviceAPI Halide::Internal::For::device_api

Definition at line 852 of file IR.h.

## ◆ body

Stmt Halide::Internal::For::body

Definition at line 853 of file IR.h.

## ◆ partition_policy

Partition Halide::Internal::For::partition_policy

Definition at line 854 of file IR.h.

## ◆ _node_type

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

Definition at line 869 of file IR.h.

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

- src/IR.h