TODO(b/130417400) add a unit test
| 274 | |
| 275 | // TODO(b/130417400) add a unit test |
| 276 | inline int Offset(const Layout& layout, int row, int col) { |
| 277 | // TODO(benoitjacob) - should check this but this make the _slow tests take |
| 278 | // 5x longer. Find a mitigation like in Eigen with an 'internal' variant |
| 279 | // bypassing the check? |
| 280 | // RUY_DCHECK_GE(row, 0); |
| 281 | // RUY_DCHECK_GE(col, 0); |
| 282 | // RUY_DCHECK_LT(row, layout.rows); |
| 283 | // RUY_DCHECK_LT(col, layout.cols); |
| 284 | int row_stride = layout.order == Order::kColMajor ? 1 : layout.stride; |
| 285 | int col_stride = layout.order == Order::kRowMajor ? 1 : layout.stride; |
| 286 | return row * row_stride + col * col_stride; |
| 287 | } |
| 288 | |
| 289 | // TODO(b/130417400) add a unit test |
| 290 | inline int Offset(const PackedLayout& layout, int row, int col) { |
no test coverage detected