In-place block transpose.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real_8), | intent(inout), | DIMENSION(rows*columns) | :: | extent |
Matrix in the form of a 1-d array |
|
integer, | intent(in) | :: | rows |
input matrix size input matrix size |
||
integer, | intent(in) | :: | columns |
input matrix size input matrix size |
PURE_BLOCKOPS SUBROUTINE block_transpose_inplace_d (extent, rows, columns)
!! In-place block transpose.
#if defined(__LIBXSMM_TRANS) && 0
USE libxsmm, ONLY: libxsmm_itrans, libxsmm_ptr1
#endif
INTEGER, INTENT(IN) :: rows, columns
!! input matrix size
!! input matrix size
REAL(kind=real_8), DIMENSION(rows*columns), INTENT(INOUT) :: extent
!! Matrix in the form of a 1-d array
! ---------------------------------------------------------------------------
#if defined(__LIBXSMM_TRANS) && 0
CALL libxsmm_itrans(libxsmm_ptr1(extent), 8, rows, columns, rows)
#elif defined(__MKL)
CALL mkl_dimatcopy('C', 'T', rows, columns, 1.0_real_8, extent, rows, columns)
#else
REAL(kind=real_8), DIMENSION(rows*columns) :: extent_tr
INTEGER :: r, c
DO r = 1, columns
DO c = 1, rows
extent_tr(r + (c - 1)*columns) = extent(c + (r - 1)*rows)
END DO
END DO
DO r = 1, columns
DO c = 1, rows
extent(r + (c - 1)*columns) = extent_tr(r + (c - 1)*columns)
END DO
END DO
#endif
END SUBROUTINE block_transpose_inplace_d