|
docc 0.8.3 (0d44999b)
C++ API 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). | |
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.
| symbolic::Expression sdfg::tiles::Swizzle::apply | ( | const symbolic::Expression & | offset | ) | const |
Permute a linear offset (a symbolic bit_xor of shifted/masked fields).
|
inline |
|
inline |
| int sdfg::tiles::Swizzle::base = 0 |
M: low bit position left untouched below the field.
| int sdfg::tiles::Swizzle::bits = 0 |
B: width of the swizzled field (0 = identity).
| int sdfg::tiles::Swizzle::shift = 0 |
S: distance between the two fields (sign = direction).