6#include <unordered_map>
22 mutable std::mutex mutex_;
23 std::unordered_map<std::string, std::shared_ptr<TileTarget>> targets_;
31 void register_target(
const std::string& schedule_value, std::shared_ptr<TileTarget> target) {
32 std::lock_guard<std::mutex> lock(mutex_);
33 targets_.emplace(schedule_value, std::move(target));
38 std::lock_guard<std::mutex> lock(mutex_);
39 auto it = targets_.find(schedule_value);
40 return it == targets_.end() ? nullptr : it->second.get();
Represents a schedule type for Map nodes.
Definition structured_loop.h:31
Maps a schedule value() to the TileTarget that owns it.
Definition tile_target_registry.h:21
bool drives_cooperative_copy(const structured_control_flow::ScheduleType &sched) const
True when sched is a group-level schedule whose parallel threads can drive a cooperative shared-memor...
void register_target(const std::string &schedule_value, std::shared_ptr< TileTarget > target)
Definition tile_target_registry.h:31
std::optional< Level > classify_level(const structured_control_flow::ScheduleType &sched) const
The cooperation Level for sched, or std::nullopt when no registered target treats it as a scratchpad ...
data_flow::ImplementationType implementation_type(const std::string &schedule_value) const
The implementation selector the target owning schedule_value stamps onto its tile codegen library nod...
Definition tile_target_registry.h:47
const TileTarget * get(const std::string &schedule_value) const
The target owning schedule_value, or nullptr if none is registered.
Definition tile_target_registry.h:37
std::optional< AxisSchedule > classify(const structured_control_flow::ScheduleType &sched) const
Classify sched into cooperation facts via the owning target, or the neutral fallback when none is reg...
static TileTargetRegistry & instance()
Definition tile_target_registry.h:26
Definition tile_target.h:39
virtual data_flow::ImplementationType implementation_type() const =0
The implementation selector this target stamps onto its tile codegen library nodes (cp....
StringEnum ImplementationType
Implementation type identifier for library nodes.
Definition library_node.h:75
ImplementationType ImplementationType_NONE
Default implementation type indicating no specific implementation.
Definition library_node.h:84
Definition gpu_tile_target.h:13
The complete target-specific contract of the tile algebra.