docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::gpu::ReductionLayout Struct Reference

Dense mixed-radix indexing for a strided reduction output footprint. More...

#include <sdfg/targets/gpu/gpu_reduce_layout.h>

Classes

struct  Dimension
 One source-address axis, measured in scalar elements rather than bytes. More...

Public Member Functions

 ReductionLayout (symbolic::Expression origin, std::vector< Dimension > axes)
 Sort and normalize axes relative to origin.
symbolic::Expression unpack (symbolic::Expression slot) const
 Return the original address for a compact slot.
symbolic::Expression pack (symbolic::Expression index) const
 Return the compact slot for an original address, omitting gaps between axes.

Public Attributes

symbolic::Expression base
 Original address for the all-zero coordinate.
std::vector< Dimension > dimensions
int64_t extent = 1
 Number of compact slots, equal to the product of axis counts.

Detailed Description

Dense mixed-radix indexing for a strided reduction output footprint.

Maps reachable original addresses to contiguous partial-buffer slots. Dimensions are stored in increasing source-stride order, with unit-count axes removed. An empty dimension list represents a single output at base.

Constructor & Destructor Documentation

◆ ReductionLayout()

sdfg::gpu::ReductionLayout::ReductionLayout ( symbolic::Expression origin,
std::vector< Dimension > axes )

Sort and normalize axes relative to origin.

Exceptions
InvalidSDFGExceptionfor a null origin, nonpositive axes, overlapping dimensions, or a slot count/source span that overflows int64_t.

Member Function Documentation

◆ pack()

symbolic::Expression sdfg::gpu::ReductionLayout::pack ( symbolic::Expression index) const

Return the compact slot for an original address, omitting gaps between axes.

Precondition
index belongs to this footprint; no membership check is generated.

◆ unpack()

symbolic::Expression sdfg::gpu::ReductionLayout::unpack ( symbolic::Expression slot) const

Return the original address for a compact slot.

Precondition
slot is in [0, extent); no runtime bounds check is generated.

Member Data Documentation

◆ base

symbolic::Expression sdfg::gpu::ReductionLayout::base

Original address for the all-zero coordinate.

◆ dimensions

std::vector<Dimension> sdfg::gpu::ReductionLayout::dimensions

◆ extent

int64_t sdfg::gpu::ReductionLayout::extent = 1

Number of compact slots, equal to the product of axis counts.


The documentation for this struct was generated from the following file: