MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / index

Function index

extensions/include/cuMat/src/Matrix.h:587–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

Matrix.hFile · 0.70
coeffFunction · 0.70
setRawCoeffMethod · 0.70
getRawCoeffMethod · 0.70
MatrixBlockClass · 0.70

Calls 3

rowsFunction · 0.70
colsFunction · 0.70
batchesFunction · 0.70

Tested by

no test coverage detected