53 static int const N = N_;
69 for (
int i = 0; i <
N; ++i) {
77 for (
int i = 0; i <
N; ++i) {
86 for (
int i = 0; i <
N; ++i) {
96 for (
int i = 0; i <
N; ++i) {
106 for (
int i = 0; i <
N; ++i) {
116 for (
int i = 0; i <
N; ++i) {
125 for (
int i = 0; i <
N; ++i) {
134 for (
int i = 0; i <
N; ++i) {
143 for (
int i = 0; i <
N; ++i) {
152 for (
int i = 0; i <
N; ++i) {
165 template <
typename T>
167 for (
int i = 0; i <
N; ++i) {
174 template <
typename T>
177 for (
int i = 0; i <
N; ++i) {
191 int&
at(
int dim) {
return idx[dim]; }
201 int const&
at(
int dim)
const {
return idx[dim]; }
207 for (
int i = 0; equal && i <
N; ++i) {
208 equal = (
idx[i] == b.
idx[i]);
220 for (
int i = 0; i <
N; ++i) {
229 int product =
idx[0];
230 for (
int i = 1; i <
N; ++i) {
242 int values[1] = {_0};
249 int values[2] = {_0, _1};
256 int values[3] = {_0, _1, _2};
263 int values[4] = {_0, _1, _2, _3};
CUTLASS_HOST_DEVICE int const & operator[](int dim) const
Member access operator.
Definition: coord.h:162
CUTLASS_HOST_DEVICE int count() const
Returns the product of all elements.
Definition: coord.h:228
Describes identity elements.
Definition: coord.h:38
CUTLASS_HOST_DEVICE bool operator==(Coord< N > const &b) const
Determines if two Coord<> objects are equal.
Definition: coord.h:205
CUTLASS_HOST_DEVICE Coord & operator+=(Coord const &b)
In-place addition.
Definition: coord.h:124
CUTLASS_HOST_DEVICE bool operator!=(Coord< N > const &b) const
Not equal.
Definition: coord.h:215
CUTLASS_HOST_DEVICE Coord< 1 > make_Coord(int _0)
Helper to make a 2-element coordinate.
Definition: coord.h:241
CUTLASS_HOST_DEVICE Coord< 3 > get_Coord_hwc(Coord< 4 > const &coord)
Getter.
Definition: coord.h:279
CUTLASS_HOST_DEVICE Coord< 3 > get_Coord_dhw(Coord< 4 > const &coord)
Getter.
Definition: coord.h:283
CUTLASS_HOST_DEVICE Coord & clamp(Coord< N > const &max, Coord< N > const &min=Coord< N >())
Clamps a coordinate to a range specified by maximum and minimum values.
Definition: coord.h:219
CUTLASS_HOST_DEVICE int const & at() const
Gets the index of a given Coord element.
Definition: coord.h:195
CUTLASS_HOST_DEVICE Coord operator/(Coord const &b) const
Element-wise division.
Definition: coord.h:114
Kind
Definition: coord.h:41
CUTLASS_HOST_DEVICE T dot(Coord const &b, T sum) const
Computes the dot product of two Coord instances.
Definition: coord.h:166
CUTLASS_HOST_DEVICE Coord(int _idx[])
Constructs from an array of integers.
Definition: coord.h:76
CUTLASS_HOST_DEVICE int & at(int dim)
Access via index; may limit unrolling potential.
Definition: coord.h:191
CUTLASS_HOST_DEVICE int & operator[](int dim)
Member access operator.
Definition: coord.h:159
CUTLASS_HOST_DEVICE Coord & operator-=(Coord const &b)
In-place subtraction.
Definition: coord.h:133
CUTLASS_HOST_DEVICE Coord operator*(Coord const &b) const
Element-wise multiplication.
Definition: coord.h:104
CUTLASS_HOST_DEVICE Coord(int value=0)
Default ctor initializes uniformly.
Definition: coord.h:68
CUTLASS_HOST_DEVICE Coord< 2 > get_Coord_hw(Coord< 3 > const &coord)
Getter.
Definition: coord.h:271
static int const N
Definition: coord.h:53
CUTLASS_HOST_DEVICE T dot(Coord const &b) const
Computes the dot product of two Coord instances.
Definition: coord.h:175
CUTLASS_HOST_DEVICE Coord operator-(Coord const &b) const
Element-wise subtraction.
Definition: coord.h:94
#define CUTLASS_HOST_DEVICE
Definition: cutlass.h:46
Statically-sized array specifying Coords within a tensor.
Definition: coord.h:48
CUTLASS_HOST_DEVICE int & at()
Gets the index of a given Coord element.
Definition: coord.h:185
int idx[N]
Indices.
Definition: coord.h:60
CUTLASS_HOST_DEVICE int const & at(int dim) const
Access via index; may limit unrolling potential.
Definition: coord.h:201
Basic include for CUTLASS macros.
CUTLASS_HOST_DEVICE Coord & operator*=(Coord const &b)
In-place multiplication.
Definition: coord.h:142
CUTLASS_HOST_DEVICE Coord operator+(Coord const &b) const
Element-wise addition.
Definition: coord.h:84
CUTLASS_HOST_DEVICE Coord & operator/=(Coord const &b)
In-place division.
Definition: coord.h:151