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

XOR-swizzle as a composition functor over a Layout. More...

#include <sdfg/tiles/swizzle.h>

Public Member Functions

bool is_identity () const
symbolic::Expression apply (const symbolic::Expression &offset) const
 Permute a linear offset (a symbolic bit_xor of shifted/masked fields).
bool operator== (const Swizzle &other) const

Public Attributes

int bits = 0
 B: width of the swizzled field (0 = identity).
int base = 0
 M: low bit position left untouched below the field.
int shift = 0
 S: distance between the two fields (sign = direction).

Detailed Description

XOR-swizzle as a composition functor over a Layout.

XOR is nonlinear, so a swizzle is not a (shape, stride) layout; following CuTe's Swizzle<B, M, S> it rides on top of a layout's offset. Applied identically to writes and reads, it is a pure relabelling (bank spreading).

Swizzle{bits=B, base=M, shift=S} XORs the B-bit field at position M with the field at M + |S|: yyy = (o >> (M + |S|)) & ((1 << B) - 1); o' = o XOR (yyy << M) an involution; bits == 0 is the identity.

Member Function Documentation

◆ apply()

symbolic::Expression sdfg::tiles::Swizzle::apply ( const symbolic::Expression & offset) const

Permute a linear offset (a symbolic bit_xor of shifted/masked fields).

◆ is_identity()

bool sdfg::tiles::Swizzle::is_identity ( ) const
inline

◆ operator==()

bool sdfg::tiles::Swizzle::operator== ( const Swizzle & other) const
inline

Member Data Documentation

◆ base

int sdfg::tiles::Swizzle::base = 0

M: low bit position left untouched below the field.

◆ bits

int sdfg::tiles::Swizzle::bits = 0

B: width of the swizzled field (0 = identity).

◆ shift

int sdfg::tiles::Swizzle::shift = 0

S: distance between the two fields (sign = direction).


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