docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
schedule.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
8
9namespace sdfg {
10namespace omp {
11
20
30public:
40
48 if (schedule.properties().find("num_threads") == schedule.properties().end()) {
49 return SymEngine::null;
50 }
51 std::string expr_str = schedule.properties().at("num_threads");
52 auto expr = symbolic::parse(expr_str);
53 return expr;
54 }
55
61 static void omp_schedule(structured_control_flow::ScheduleType& schedule, const OpenMPSchedule schedule_type) {
62 schedule.set_property("omp_schedule", std::to_string(schedule_type));
63 }
64
71 if (schedule.properties().find("omp_schedule") == schedule.properties().end()) {
73 }
74 return static_cast<OpenMPSchedule>(std::stoi(schedule.properties().at("omp_schedule")));
75 }
76
77 static const std::string value() {
78 return "CPU_PARALLEL";
79 }
80
84};
85
86} // namespace omp
87} // namespace sdfg
CPU parallel schedule type with OpenMP support.
Definition schedule.h:29
static void omp_schedule(structured_control_flow::ScheduleType &schedule, const OpenMPSchedule schedule_type)
Set the OpenMP scheduling strategy.
Definition schedule.h:61
static void num_threads(structured_control_flow::ScheduleType &schedule, const symbolic::Expression num_threads)
Set the number of threads for parallel execution.
Definition schedule.h:36
static const symbolic::Expression num_threads(const structured_control_flow::ScheduleType &schedule)
Get the number of threads.
Definition schedule.h:46
static OpenMPSchedule omp_schedule(const structured_control_flow::ScheduleType &schedule)
Get the OpenMP scheduling strategy.
Definition schedule.h:70
static const std::string value()
Definition schedule.h:77
static structured_control_flow::ScheduleType create()
Definition schedule.h:81
Definition json_serializer.h:22
Represents a schedule type for Map nodes.
Definition structured_loop.h:31
const std::unordered_map< std::string, std::string > & properties() const
Get all schedule properties.
Definition structured_loop.h:53
void set_property(const std::string &key, const std::string &value)
Set a schedule property.
Definition structured_loop.h:70
Expression parse(const std::string &expr_str)
Parses a string into a symbolic expression.
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
Definition omp_map_dispatcher.h:10
OpenMPSchedule
OpenMP scheduling strategies.
Definition schedule.h:15
@ Guided
Chunk sizes decrease over time (dynamic with feedback).
Definition schedule.h:18
@ Static
Iterations distributed statically at compile time.
Definition schedule.h:16
@ Dynamic
Iterations distributed dynamically at runtime.
Definition schedule.h:17
Definition cutout_serializer.h:13
@ Parallelizer
Definition structured_loop.h:22
Definition analysis.h:7