Halide
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 
21 namespace Halide {
22 namespace Internal {
23 
24 class Function;
25 
26 Stmt add_atomic_mutex(Stmt s, const std::map<std::string, Function> &env);
27 
28 } // namespace Internal
29 } // namespace Halide
30 
31 #endif
Halide::Internal::Stmt
A reference-counted handle to a statement node.
Definition: Expr.h:409
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AddAtomicMutex.h:21
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::Internal::add_atomic_mutex
Stmt add_atomic_mutex(Stmt s, const std::map< std::string, Function > &env)
Expr.h
Halide::Internal::Function
A reference-counted handle to Halide's internal representation of a function.
Definition: Function.h:38