Loading...
Searching...
No Matches
SearchSpaceOptions.h
Go to the documentation of this file.
#ifndef SEARCH_SPACE_OPTIONS_H
#define SEARCH_SPACE_OPTIONS_H
#include <bitset>
#include "ASLog.h"
namespace Halide {
namespace Internal {
namespace Autoscheduler {
struct SearchSpaceOptions {
constexpr static size_t option_compute_root = 0;
constexpr static size_t option_compute_inline = 1;
constexpr static size_t option_compute_at_block = 2;
constexpr static size_t option_compute_at_thread = 3;
std::bitset<4> options;
explicit SearchSpaceOptions(const std::string &bit_str)
: options{bit_str} {
aslog(1) << "Search space options:\n";
aslog(1) << "Input string: " << bit_str << "\n";
aslog(1) << "Compute root: " << compute_root() << "\n";
aslog(1) << "Compute inline: " << compute_inline() << "\n";
aslog(1) << "Compute at block: " << compute_at_block() << "\n";
aslog(1) << "Compute at thread: " << compute_at_thread() << "\n";
}
bool compute_root() const {
return options.test(SearchSpaceOptions::option_compute_root) || compute_at_block() || compute_at_thread();
}
bool compute_root_only() const {
return options.count() == 1 && compute_root();
}
bool compute_inline() const {
return options.test(SearchSpaceOptions::option_compute_inline);
}
bool compute_inline_only() const {
return options.count() == 1 && compute_inline();
}
bool compute_at_block() const {
return options.test(SearchSpaceOptions::option_compute_at_block);
}
bool compute_at_block_only() const {
return options.count() == 1 && compute_at_block();
}
bool compute_at_thread() const {
return options.test(SearchSpaceOptions::option_compute_at_thread);
}
bool compute_at_thread_only() const {
return options.count() == 1 && compute_at_thread();
}
};
} // namespace Autoscheduler
} // namespace Internal
} // namespace Halide
#endif // SEARCH_SPACE_OPTIONS_H
ASLog.h
Halide::Internal::aslog
Definition ASLog.h:16
Halide::Internal::Autoscheduler
Definition AutoSchedule.h:10
Halide::Internal
Definition AbstractGenerator.h:24
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
Halide::Internal::Autoscheduler::SearchSpaceOptions::options
std::bitset< 4 > options
Definition SearchSpaceOptions.h:18
Halide::Internal::Autoscheduler::SearchSpaceOptions::SearchSpaceOptions
SearchSpaceOptions(const std::string &bit_str)
Definition SearchSpaceOptions.h:20
Halide::Internal::Autoscheduler::SearchSpaceOptions::option_compute_at_thread
static constexpr size_t option_compute_at_thread
Definition SearchSpaceOptions.h:16
Halide::Internal::Autoscheduler::SearchSpaceOptions::compute_inline_only
bool compute_inline_only() const
Definition SearchSpaceOptions.h:42
Halide::Internal::Autoscheduler::SearchSpaceOptions::compute_at_thread_only
bool compute_at_thread_only() const
Definition SearchSpaceOptions.h:58
Halide::Internal::Autoscheduler::SearchSpaceOptions::option_compute_root
static constexpr size_t option_compute_root
Definition SearchSpaceOptions.h:13
Halide::Internal::Autoscheduler::SearchSpaceOptions::option_compute_at_block
static constexpr size_t option_compute_at_block
Definition SearchSpaceOptions.h:15
Halide::Internal::Autoscheduler::SearchSpaceOptions::compute_at_block
bool compute_at_block() const
Definition SearchSpaceOptions.h:46
Halide::Internal::Autoscheduler::SearchSpaceOptions::compute_at_block_only
bool compute_at_block_only() const
Definition SearchSpaceOptions.h:50
Halide::Internal::Autoscheduler::SearchSpaceOptions::compute_root_only
bool compute_root_only() const
Definition SearchSpaceOptions.h:34
Halide::Internal::Autoscheduler::SearchSpaceOptions::compute_root
bool compute_root() const
Definition SearchSpaceOptions.h:30
Halide::Internal::Autoscheduler::SearchSpaceOptions::option_compute_inline
static constexpr size_t option_compute_inline
Definition SearchSpaceOptions.h:14
Halide::Internal::Autoscheduler::SearchSpaceOptions::compute_inline
bool compute_inline() const
Definition SearchSpaceOptions.h:38
Halide::Internal::Autoscheduler::SearchSpaceOptions::compute_at_thread
bool compute_at_thread() const
Definition SearchSpaceOptions.h:54