Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
Namespaces | Functions
AddAtomicMutex.h File Reference

Defines the lowering pass that insert mutex allocation code & locks for the atomic nodes that require mutex locks. More...

`#include "Expr.h"`
`#include <map>`

Go to the source code of this file.

## Namespaces
namespace | Halide
| This file defines the class FunctionDAG, which is our representation of a Halide pipeline, and contains methods to using Halide's bounds tools to query properties of it.
namespace | Halide::Internal

## Functions
Stmt | Halide::Internal::add_atomic_mutex (Stmt s, const std::vector< Function > &outputs)

## Detailed Description

Defines the lowering pass that insert mutex allocation code & locks for the atomic nodes that require mutex locks.

It also checks whether the atomic operation is valid. It rejects algorithms that have indexing on left-hand-side which references the buffer itself, e.g. f(clamp(f(r), 0, 100)) = f(r) + 1 If the SplitTuple pass does not lift out the Provide value as a let expression. This is confirmed by checking whether the Provide nodes inside an Atomic node have let binding values accessing the buffers inside the atomic node. Finally, it lifts the store indexing expressions inside the atomic node outside of the atomic to avoid side-effects inside those expressions being evaluated twice.

Definition in file AddAtomicMutex.h.