| 585 | * \param batch the batch index (output) |
| 586 | */ |
| 587 | __host__ __device__ CUMAT_STRONG_INLINE void index(Index index, Index& row, Index& col, Index& batch) const |
| 588 | { |
| 589 | if (CUMAT_IS_ROW_MAJOR(Flags)) { |
| 590 | batch = index / (rows() * cols()); |
| 591 | index -= batch * rows() * cols(); |
| 592 | row = index / cols(); |
| 593 | index -= row * cols(); |
| 594 | col = index; |
| 595 | } |
| 596 | else { |
| 597 | batch = index / (rows() * cols()); |
| 598 | index -= batch * rows() * cols(); |
| 599 | col = index / rows(); |
| 600 | index -= col * rows(); |
| 601 | row = index; |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | /** |
| 606 | * \brief Computes the linear index from the three coordinates row, column and batch |
no test coverage detected