Halide 17.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
AddAtomicMutex.h
Go to the documentation of this file.
1#ifndef HALIDE_ADD_ATOMIC_MUTEX_H
2#define HALIDE_ADD_ATOMIC_MUTEX_H
3
4#include "Expr.h"
5#include <map>
6
7/** \file
8 * Defines the lowering pass that insert mutex allocation code & locks
9 * for the atomic nodes that require mutex locks. It also checks whether
10 * the atomic operation is valid. It rejects algorithms that have indexing
11 * on left-hand-side which references the buffer itself, e.g.
12 * f(clamp(f(r), 0, 100)) = f(r) + 1
13 * If the SplitTuple pass does not lift out the Provide value as a let
14 * expression. This is confirmed by checking whether the Provide nodes
15 * inside an Atomic node have let binding values accessing the buffers
16 * inside the atomic node.
17 * Finally, it lifts the store indexing expressions inside the atomic node
18 * outside of the atomic to avoid side-effects inside those expressions
19 * being evaluated twice. */
20
21namespace Halide {
22namespace Internal {
23
24class Function;
25
26Stmt add_atomic_mutex(Stmt s, const std::map<std::string, Function> &env);
27
28} // namespace Internal
29} // namespace Halide
30
31#endif
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Stmt add_atomic_mutex(Stmt s, const std::map< std::string, Function > &env)
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
Expr cast(Expr a)
Cast an expression to the halide type corresponding to the C++ type T.
Definition IROperator.h:364
A reference-counted handle to a statement node.
Definition Expr.h:419