docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
plugins.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <memory>
5#include <string>
6
15
16namespace sdfg {
17namespace plugins {
18
28struct Context {
29 // Serialization
32
36
37 // Dispatchers
50
59
60 // Schedulers
66
67 // Tile targets
71
75
76protected:
77 std::unordered_map<std::string, docc::target::DoccTarget*> available_targets;
80
81public:
98
110
112 auto res = available_targets.insert_or_assign(target->short_name, target);
113 return res.second;
114 }
115
116 docc::target::DoccTarget* get_target_handler(const std::string& target) const {
117 auto it = available_targets.find(target);
118 if (it != available_targets.end()) {
119 return it->second;
120 }
121 return nullptr;
122 }
123};
124
125struct Plugin {
126 const char* name;
127 const char* version;
128 const char* description;
129
130 // Register callback
132
133 // SDFG lookup
134 std::list<std::unique_ptr<sdfg::StructuredSDFG>> (*sdfg_lookup)(std::string name);
135};
136
137} // namespace plugins
138} // namespace sdfg
Definition options.h:95
Registry for library node dispatchers.
Definition node_dispatcher_registry.h:245
static LibraryNodeDispatcherRegistry & instance()
Definition node_dispatcher_registry.h:251
Registry for map-specific dispatchers based on schedule type.
Definition node_dispatcher_registry.h:125
static MapDispatcherRegistry & instance()
Definition node_dispatcher_registry.h:131
Definition node_dispatcher_registry.h:67
static NodeDispatcherRegistry & instance()
Definition node_dispatcher_registry.h:73
Registry for reduce-specific dispatchers based on schedule type.
Definition node_dispatcher_registry.h:175
static ReduceDispatcherRegistry & instance()
Definition node_dispatcher_registry.h:181
Definition scheduler_registry.h:13
static SchedulerRegistry & instance()
Definition scheduler_registry.h:19
Registry for library node serializers.
Definition json_serializer.h:252
static LibraryNodeSerializerRegistry & instance()
Definition json_serializer.h:258
Maps a schedule value() to the TileTarget that owns it.
Definition tile_target_registry.h:21
static TileTargetRegistry & instance()
Definition tile_target_registry.h:26
Definition plugins.h:17
Definition analysis.h:7
Registry system for dispatchers and library node dispatchers.
Definition targets.h:31
std::string short_name
Definition targets.h:35
TODO this class is broken.
Definition plugins.h:28
bool add_target(docc::target::DoccTarget *target)
Definition plugins.h:111
codegen::NodeDispatcherRegistry & get_node_dispatcher_registry()
Definition plugins.h:38
serializer::LibraryNodeSerializerRegistry & get_library_node_serializer_registry()
Definition plugins.h:33
passes::scheduler::SchedulerRegistry & get_scheduler_registry()
Definition plugins.h:63
serializer::LibraryNodeSerializerRegistry & library_node_serializer_registry
Definition plugins.h:31
OptionRegistry & option_registry()
Definition plugins.h:72
codegen::MapDispatcherRegistry & map_dispatcher_registry
Definition plugins.h:54
codegen::ReduceDispatcherRegistry & get_reduce_dispatcher_registry()
Definition plugins.h:44
codegen::NodeDispatcherRegistry & node_dispatcher_registry
Definition plugins.h:52
static Context global_context()
Definition plugins.h:99
codegen::MapDispatcherRegistry & get_map_dispatcher_registry()
Definition plugins.h:41
tiles::TileTargetRegistry & get_tile_target_registry()
Definition plugins.h:68
passes::scheduler::SchedulerRegistry & scheduler_registry
Definition plugins.h:62
codegen::LibraryNodeDispatcherRegistry & get_library_node_dispatcher_registry()
Definition plugins.h:47
std::unordered_map< std::string, docc::target::DoccTarget * > available_targets
Definition plugins.h:77
codegen::ReduceDispatcherRegistry & reduce_dispatcher_registry
Definition plugins.h:56
tiles::TileTargetRegistry & tile_target_registry_
Definition plugins.h:79
OptionRegistry option_registry_
Definition plugins.h:78
codegen::LibraryNodeDispatcherRegistry & library_node_dispatcher_registry
Definition plugins.h:58
docc::target::DoccTarget * get_target_handler(const std::string &target) const
Definition plugins.h:116
Context(serializer::LibraryNodeSerializerRegistry &library_node_serializer_registry, codegen::NodeDispatcherRegistry &node_dispatcher_registry, codegen::MapDispatcherRegistry &map_dispatcher_registry, codegen::ReduceDispatcherRegistry &reduce_dispatcher_registry, codegen::LibraryNodeDispatcherRegistry &library_node_dispatcher_registry, passes::scheduler::SchedulerRegistry &scheduler_registry, tiles::TileTargetRegistry &tile_target_registry)
Definition plugins.h:83
Definition plugins.h:125
const char * name
Definition plugins.h:126
void(* register_plugin_callback)(Context &context)
Definition plugins.h:131
const char * description
Definition plugins.h:128
const char * version
Definition plugins.h:127