11#include <nlohmann/json.hpp>
34 nlohmann::json history_;
47 for (
auto& [key, value] : desc[
"subgraph"].items()) {
48 if (!value.contains(
"element_id")) {
51 auto element_id = value[
"element_id"].template get<size_t>();
52 auto* elem =
builder.find_element_by_id(element_id);
57 auto loop_info = loop_analysis.loop_info(loop);
58 value[
"loop_info"] = loop_info_to_json(loop_info);
85 bool skip_if_not_applicable =
false
88 if (!skip_if_not_applicable) {
89 throw transformations::
90 InvalidTransformationException(
"Transformation " + transformation.
name() +
" cannot be applied.");
99 std::string schema_error;
102 "Transformation '" + transformation.
name() +
"' produced an invalid description: " + schema_error
108 history_.push_back(desc);
123 template<
typename T,
typename... Args>
128 bool skip_if_not_applicable,
131 T transformation(std::forward<Args>(args)...);
132 this->
record(transformation,
builder, analysis_manager, skip_if_not_applicable);
139 void save(std::filesystem::path path)
const;
T & get()
Definition analysis.h:83
Definition loop_analysis.h:97
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
Base class for all structured control flow nodes in a StructuredSDFG.
Definition control_flow_node.h:44
Definition function_builder.h:10
element_cast_target_t< T > * dyn_cast(Element *element)
Efficient down-cast to T, or nullptr if element is not a T.
Definition element.h:246