Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
SearchSpaceOptions.h
Go to the documentation of this file.
1#ifndef SEARCH_SPACE_OPTIONS_H
2#define SEARCH_SPACE_OPTIONS_H
3
4#include <bitset>
5
6#include "ASLog.h"
7
8namespace Halide {
9namespace Internal {
10namespace Autoscheduler {
11
13 constexpr static size_t option_compute_root = 0;
14 constexpr static size_t option_compute_inline = 1;
15 constexpr static size_t option_compute_at_block = 2;
16 constexpr static size_t option_compute_at_thread = 3;
17
18 std::bitset<4> options;
19
20 explicit SearchSpaceOptions(const std::string &bit_str)
21 : options{bit_str} {
22 aslog(1) << "Search space options:\n";
23 aslog(1) << "Input string: " << bit_str << "\n";
24 aslog(1) << "Compute root: " << compute_root() << "\n";
25 aslog(1) << "Compute inline: " << compute_inline() << "\n";
26 aslog(1) << "Compute at block: " << compute_at_block() << "\n";
27 aslog(1) << "Compute at thread: " << compute_at_thread() << "\n";
28 }
29
33
34 bool compute_root_only() const {
35 return options.count() == 1 && compute_root();
36 }
37
41
42 bool compute_inline_only() const {
43 return options.count() == 1 && compute_inline();
44 }
45
49
50 bool compute_at_block_only() const {
51 return options.count() == 1 && compute_at_block();
52 }
53
57
59 return options.count() == 1 && compute_at_thread();
60 }
61};
62
63} // namespace Autoscheduler
64} // namespace Internal
65} // namespace Halide
66
67#endif // SEARCH_SPACE_OPTIONS_H
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.