Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
PrefetchDirective.h
Go to the documentation of this file.
1#ifndef HALIDE_PREFETCH_DIRECTIVE_H
2#define HALIDE_PREFETCH_DIRECTIVE_H
3
4/** \file
5 * Defines the PrefetchDirective struct
6 */
7
8#include <string>
9
10#include "Expr.h"
11#include "Parameter.h"
12
13namespace Halide {
14
15/** Different ways to handle accesses outside the original extents in a prefetch. */
17 /** Clamp the prefetched exprs by intersecting the prefetched region with
18 * the original extents. This may make the exprs of the prefetched region
19 * more complicated. */
20 Clamp,
21
22 /** Guard the prefetch with if-guards that ignores the prefetch if
23 * any of the prefetched region ever goes beyond the original extents
24 * (i.e. all or nothing). */
26
27 /** Leave the prefetched exprs as-is (no if-guards around the prefetch
28 * and no intersecting with the original extents). This makes the prefetch
29 * exprs simpler but this may cause prefetching of the region outside the original
30 * extents. This is good if prefetch won't fault when accessing region
31 * outside the original extents. */
33};
34
35namespace Internal {
36
38 std::string name;
39 std::string at; // the loop in which to do the prefetch
40 std::string from; // the loop-var to use as the base for prefetching. It must be nested outside loop_var (or be equal to loop_var).
41 Expr offset; // 'from + offset' will determine the bounds being prefetched.
43 // If it's a prefetch load from an image parameter, this points to that.
45};
46
47} // namespace Internal
48
49} // namespace Halide
50
51#endif // HALIDE_PREFETCH_DIRECTIVE_H
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines the internal representation of parameters to halide piplines.
A reference-counted handle to a parameter to a halide pipeline.
Definition Parameter.h:40
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
PrefetchBoundStrategy
Different ways to handle accesses outside the original extents in a prefetch.
@ Clamp
Clamp the prefetched exprs by intersecting the prefetched region with the original extents.
@ GuardWithIf
Guard the prefetch with if-guards that ignores the prefetch if any of the prefetched region ever goes...
@ NonFaulting
Leave the prefetched exprs as-is (no if-guards around the prefetch and no intersecting with the origi...
A fragment of Halide syntax.
Definition Expr.h:258