cuda-kat
CUDA kernel author's tools
|
Templated warp-shuffle operation variants. More...
Functions | |
template<typename T > | |
KAT_FD T | kat::shuffle_arbitrary (const T &t, int source_lane) |
Have each lane in a warp get a value from an (arbitrary) other lane. More... | |
template<typename T > | |
KAT_FD T | kat::shuffle_down (const T &t, unsigned int delta) |
template<typename T > | |
KAT_FD T | kat::shuffle_up (const T &t, unsigned int delta) |
template<typename T > | |
KAT_FD T | kat::shuffle_xor (const T &t, int mask) |
Have pairs of lanes exchange a value, with the pairing performed by XORing bits of the lane index. More... | |
Templated warp-shuffle operation variants.
KAT_FD T kat::shuffle_arbitrary | ( | const T & | t, |
int | source_lane | ||
) |
Have each lane in a warp get a value from an (arbitrary) other lane.
T | the type of datum to be shared with other lane(s); may be of arbitrary size, but (at least for now) must be plain-old-data. |
t | Each lane shares own value, which other lanes can choose to receive. |
source_lane | The lane whose value the current lane wants to get |
t
value of source_lane
KAT_FD T kat::shuffle_down | ( | const T & | t, |
unsigned int | delta | ||
) |
t | Each lane shares own value, which a lane with a higher index will get. |
delta | The difference in lane index to the source lane of the new value, i.e. a lane with index i gets the new value from lane i + delta. |
t
value of the lane with index delta
less than the calling lane's; a lane with a high index, above warp_size - delta
, has its own t
returned unchanged. KAT_FD T kat::shuffle_up | ( | const T & | t, |
unsigned int | delta | ||
) |
T | the type of datum to be shared with other lane(s); may be of arbitrary size, but (at least for now) must be plain-old-data. |
t | Each lane shares own value, which a lane with a lower index will get. |
delta | The difference in lane index to the source lane of the new value, i.e. a lane with index i gets the new value from the lane of index i - delta. |
t
value of the lane with index delta
less than the calling lane's; a lane with a low index, under delta
, has its own t
returned unchanged. KAT_FD T kat::shuffle_xor | ( | const T & | t, |
int | mask | ||
) |
Have pairs of lanes exchange a value, with the pairing performed by XORing bits of the lane index.
T | the type of datum to be shared with other lane(s); may be of arbitrary size, but (at least for now) must be plain-old-data. |
t | The value to exchange with a counterpart lane |
mask | Determines how lanes will be paired: The lane with index i is paired with the lane with index i ^ mask. |
t
value of the paired lane