24 switch (target_level) {
44 if (value ==
"X_GRID") {
46 }
else if (value ==
"Y_GRID") {
48 }
else if (value ==
"Z_GRID") {
50 }
else if (value ==
"X_BLOCK") {
52 }
else if (value ==
"Y_BLOCK") {
54 }
else if (value ==
"Z_BLOCK") {
56 }
else if (value ==
"WARP") {
86 if (value ==
"register") {
88 }
else if (value ==
"shared") {
90 }
else if (value ==
"global") {
100 switch (target_level) {
140 auto it = schedule.
properties().find(
"target_level");
162 std::string expr_str = schedule.
properties().at(
"parallel_size");
171 auto it = schedule.
properties().find(
"lanes");
186 if (
lanes->as_int() < 1) {
207 std::string val = schedule.
properties().at(
"nested_sync");
208 return val ==
"true";
223 auto it = schedule.
properties().find(
"partial_storage");
246 auto it = schedule.
properties().find(
"partial_container");
247 return it == schedule.
properties().end() ? std::string() : it->second;
260 template<
typename Derived>
263 auto schedule_type = structured_control_flow::
267 return schedule_type;
Definition exceptions.h:8
virtual structured_control_flow::ScheduleType create_schedule_type() const =0
Base class for GPU schedule types (CUDA/ROCm) using CRTP pattern.
Definition gpu_offload_schedule_type.h:123
static structured_control_flow::ScheduleType create(const GpuArch &arch, const TargetLevel &target_level_, const symbolic::Integer ¶llel_size_)
Definition gpu_offload_schedule_type.h:271
static symbolic::Integer lanes(const structured_control_flow::ScheduleType &schedule)
Lanes that jointly execute each iteration (1 = one thread per iteration; the warp size = one wave per...
Definition gpu_offload_schedule_type.h:170
static void partial_container(structured_control_flow::ScheduleType &schedule, const std::string &container)
Set the container name for this reduction's shared partials.
Definition gpu_offload_schedule_type.h:253
static std::string partial_container(const structured_control_flow::ScheduleType &schedule)
Name of the SDFG container holding this reduction's shared partials.
Definition gpu_offload_schedule_type.h:245
static void nested_sync(structured_control_flow::ScheduleType &schedule, const bool nested_sync)
Set nested synchronization flag.
Definition gpu_offload_schedule_type.h:214
static std::optional< TargetLevel > target_level_if_exists(const structured_control_flow::ScheduleType &schedule)
Definition gpu_offload_schedule_type.h:139
static symbolic::Integer threads(const structured_control_flow::ScheduleType &schedule)
Hardware threads the schedule occupies along its dimension: parallel_size * lanes.
Definition gpu_offload_schedule_type.h:196
static ReduceStrategy partial_storage(const structured_control_flow::ScheduleType &schedule)
Where this (reduction) schedule's partials live / how they combine.
Definition gpu_offload_schedule_type.h:222
static structured_control_flow::ScheduleType create(const TargetLevel &target_level_, const symbolic::Integer ¶llel_size_)
Create a new GPU schedule type.
Definition gpu_offload_schedule_type.h:262
static symbolic::Integer parallel_size(const structured_control_flow::ScheduleType &schedule)
Get the parallel size from a schedule.
Definition gpu_offload_schedule_type.h:158
static void target_level(structured_control_flow::ScheduleType &schedule, const TargetLevel &target_level)
Set the target level for a schedule.
Definition gpu_offload_schedule_type.h:128
static TargetLevel target_level(const structured_control_flow::ScheduleType &schedule)
Get the target level from a schedule.
Definition gpu_offload_schedule_type.h:135
static void lanes(structured_control_flow::ScheduleType &schedule, const symbolic::Integer lanes)
Set the lanes per iteration.
Definition gpu_offload_schedule_type.h:182
static void parallel_size(structured_control_flow::ScheduleType &schedule, const symbolic::Integer parallel_size)
Set the parallel size for a schedule.
Definition gpu_offload_schedule_type.h:150
static bool nested_sync(const structured_control_flow::ScheduleType &schedule)
Check if nested synchronization is enabled.
Definition gpu_offload_schedule_type.h:203
static void partial_storage(structured_control_flow::ScheduleType &schedule, const ReduceStrategy strategy)
Set the reduction partial-storage strategy.
Definition gpu_offload_schedule_type.h:233
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
const std::string & value() const
Get the schedule type identifier.
Definition structured_loop.h:45
Integer integer(int64_t value)
Creates an integer constant.
SymEngine::RCP< const SymEngine::Integer > Integer
Reference-counted pointer to a SymEngine Integer constant.
Definition symbolic.h:77
Definition cuda_arch.h:11
TargetLevel
Definition gpu_offload_schedule_type.h:13
@ WARP
Definition gpu_offload_schedule_type.h:20
@ Z_BLOCK
Definition gpu_offload_schedule_type.h:19
@ Y_BLOCK
Definition gpu_offload_schedule_type.h:18
@ Y_GRID
Definition gpu_offload_schedule_type.h:15
@ Z_GRID
Definition gpu_offload_schedule_type.h:16
@ X_GRID
Definition gpu_offload_schedule_type.h:14
@ X_BLOCK
Definition gpu_offload_schedule_type.h:17
ReduceStrategy
Where a reduction's per-thread partials live, and hence how they combine.
Definition gpu_offload_schedule_type.h:71
@ Register
Definition gpu_offload_schedule_type.h:71
@ Global
Definition gpu_offload_schedule_type.h:71
@ Shared
Definition gpu_offload_schedule_type.h:71
ReduceStrategy default_reduce_strategy(TargetLevel target_level)
Definition gpu_offload_schedule_type.h:99
TargetLevel gpu_target_level(const structured_control_flow::ScheduleType &schedule)
Get the GPU target level from any GPU schedule type.
Definition gpu_offload_schedule_type.h:282
TargetLevel target_level_from_string(const std::string &value)
Definition gpu_offload_schedule_type.h:43
std::string to_string(const TargetLevel &target_level)
Definition gpu_offload_schedule_type.h:23
std::string reduce_strategy_to_string(ReduceStrategy strategy)
Definition gpu_offload_schedule_type.h:73
ReduceStrategy reduce_strategy_from_string(const std::string &value)
Definition gpu_offload_schedule_type.h:85
Definition cutout_serializer.h:13
@ Offloader
Definition structured_loop.h:22