docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
tile_target.h
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4
8#include "sdfg/tiles/tile.h"
9#include "sdfg/types/type.h"
10
11namespace sdfg {
12namespace tiles {
13
40public:
41 virtual ~TileTarget() = default;
42
47 virtual std::optional<AxisSchedule> classify(const structured_control_flow::ScheduleType& sched) const = 0;
48
55 virtual Space space(Level level) const = 0;
56
64
71
77
81 virtual unsigned lane_width() const = 0;
82
85 virtual std::optional<BankModel> bank_model(Space space) const {
86 return std::nullopt;
87 }
88
92 virtual bool supports_async_staging(const types::StorageType& storage) const {
93 return has_scratchpad() && storage == storage_type(Space::Shared);
94 }
95
97 virtual size_t min_async_bytes() const {
98 return 4;
99 }
100
102 virtual size_t max_tile_elements() const {
103 return size_t{1} << 16;
104 }
105
113};
114
115} // namespace tiles
116} // namespace sdfg
Represents a schedule type for Map nodes.
Definition structured_loop.h:31
Definition tile_target.h:39
bool has_scratchpad() const
Whether this target exposes any on-chip cooperative tier below global memory (a scratchpad hierarchy)...
Definition tile_target.h:61
virtual size_t min_async_bytes() const
The narrowest per-lane async (CpAsync) transfer in bytes; narrower copies stay synchronous.
Definition tile_target.h:97
virtual std::optional< BankModel > bank_model(Space space) const
The banks of the memory realizing space, if it is banked (GPU shared memory).
Definition tile_target.h:85
virtual std::optional< AxisSchedule > classify(const structured_control_flow::ScheduleType &sched) const =0
Classify one loop's sched into target-neutral cooperation facts (AxisSchedule: level,...
virtual data_flow::ImplementationType implementation_type() const =0
The implementation selector this target stamps onto its tile codegen library nodes (cp....
virtual unsigned lane_width() const =0
The SIMD lane / subgroup width, used only to keep a subgroup's cooperative stores bank-conflict-free ...
virtual Space space(Level level) const =0
The memory Space backing cooperation at each Level on this target: a GPU maps Group -> Shared,...
virtual types::StorageType storage_type(Space space) const =0
The concrete buffer that realizes an abstract cooperation Space on this target: e....
virtual ~TileTarget()=default
virtual size_t max_tile_elements() const
The most elements a staging buffer local to one of this target's loops may hold.
Definition tile_target.h:102
virtual bool supports_cooperative_staging(const structured_control_flow::ScheduleType &sched) const =0
Whether sched can host a block-cooperative shared-memory staging copy driven by its own parallel thre...
virtual bool supports_async_staging(const types::StorageType &storage) const
Whether staging buffers of storage can be multi-buffered so that a loop prefetches its next tile asyn...
Definition tile_target.h:92
Represents the storage location and management characteristics of data.
Definition type.h:64
Library node definitions for calling functions beyond simple instructions.
StringEnum ImplementationType
Implementation type identifier for library nodes.
Definition library_node.h:75
Definition gpu_tile_target.h:13
Space
Memory that backs cooperation at a level: Device/CPU -> Global (atomics/heap), Group -> Shared,...
Definition tile.h:36
@ Global
Definition tile.h:36
@ Shared
Definition tile.h:36
Level
Cooperation scope of a parallel axis, coarsest to finest — target-neutral tiers (OpenCL/SYCL vocabula...
Definition tile.h:32
@ Group
Definition tile.h:32
@ Subgroup
Definition tile.h:32
Definition analysis.h:7
Schedule-aware tile vocabulary: a Tile is a Layout (geometry from MemoryLayoutAnalysis) partitioned o...
Core type system definitions for sdfglib.