anchor.diff:        REAL(LIBXSMM_DOUBLE_PRECISION), INTENT(INOUT) :: c(ldc,*)
       END SUBROUTINE
   
  -    ! Initialize the library
  -    PURE SUBROUTINE libxsmm_init() BIND(C)
  -    END SUBROUTINE
  -
  -    ! Build explicitly a kernel, do not rely on automatic JIT in dispatch
  -    TYPE(C_FUNPTR) PURE FUNCTION libxsmm_build_jit(single_precision, m, n, k) BIND(C)
  -      IMPORT :: C_FUNPTR, C_INT
  -      INTEGER(C_INT), VALUE, INTENT(IN) :: single_precision, m, n, k
  +    ! Initialize the library; pay for setup cost at a specific point.
  +    SUBROUTINE libxsmm_init() BIND(C)
  +    END SUBROUTINE
  +
  +    ! Query or JIT-generate a function; return zero if it does not exist or if JIT is not supported (single-precision).
  +    TYPE(C_FUNPTR) PURE FUNCTION libxsmm_smm_dispatch(alpha, beta, m, n, k, lda, ldb, ldc, flags, prefetch) BIND(C)
  +      IMPORT :: C_FUNPTR, C_FLOAT, C_INT
  +      REAL(C_FLOAT), VALUE, INTENT(IN) :: alpha, beta
  +      INTEGER(C_INT), VALUE, INTENT(IN) :: m, n, k, lda, ldb, ldc, flags, prefetch
       END FUNCTION
  -
  -    ! Build explicitly a kernel, do not rely on automatic JIT in dispatch, do not return the function pointer
  -    ! However, the JIT function is available for dispatch
  -    ! @TODO not all versions of gfortran seem to like this -> commented for now
  -    !PURE SUBROUTINE libxsmm_build_jit_only(single_precision, m, n, k) BIND(C, name="libxsmm_build_jit")
  -    !  IMPORT :: C_INT
  -    !  INTEGER(C_INT), VALUE, INTENT(IN) :: single_precision, m, n, k
  -    !END SUBROUTINE
  -
  -    ! Query the pointer of a generated function; zero if it does not exist, single-precision.
  -    TYPE(C_FUNPTR) PURE FUNCTION libxsmm_smm_dispatch(m, n, k) BIND(C)
  -      IMPORT :: C_FUNPTR, C_INT
  -      INTEGER(C_INT), VALUE, INTENT(IN) :: m, n, k
  -    END FUNCTION
  -    ! Query the pointer of a generated function; zero if it does not exist; double-precision.
  -    TYPE(C_FUNPTR) PURE FUNCTION libxsmm_dmm_dispatch(m, n, k) BIND(C)
  -      IMPORT :: C_FUNPTR, C_INT
  -      INTEGER(C_INT), VALUE, INTENT(IN) :: m, n, k
  +    ! Query or JIT-generate a function; return zero if it does not exist or if JIT is not supported (double-precision).
  +    TYPE(C_FUNPTR) PURE FUNCTION libxsmm_dmm_dispatch(alpha, beta, m, n, k, lda, ldb, ldc, flags, prefetch) BIND(C)
  +      IMPORT :: C_FUNPTR, C_DOUBLE, C_INT
  +      REAL(C_DOUBLE), VALUE, INTENT(IN) :: alpha, beta
  +      INTEGER(C_INT), VALUE, INTENT(IN) :: m, n, k, lda, ldb, ldc, flags, prefetch
       END FUNCTION
   
       ! Non-pure function returning the current clock tick using a platform-specific resolution.
  
positive.code:     ENDIF
    END SUBROUTINE
  
    ! Non-dispatched matrix-matrix multiplication using optimized code; single-precision.
    !DIR$ ATTRIBUTES OFFLOAD:MIC :: libxsmm_simm
    !DIR$ ATTRIBUTES INLINE :: libxsmm_simm
    SUBROUTINE libxsmm_simm(m, n, k, a, b, c)
      INTEGER(LIBXSMM_INTEGER_TYPE), PARAMETER :: T = LIBXSMM_SINGLE_PRECISION
      INTEGER(LIBXSMM_INTEGER_TYPE), INTENT(IN) :: m, n, k
      INTEGER(LIBXSMM_INTEGER_TYPE) :: i, j
      REAL(T), INTENT(IN), TARGET, CONTIGUOUS :: a(:,:), b(:,:)
      REAL(T), INTENT(INOUT) :: c($SHAPE_C1,$SHAPE_C2)
      REAL(T), POINTER :: x(:,:), y(:,:)
      IF (0.NE.LIBXSMM_COL_MAJOR.AND.LIBXSMM_BETA.NE.0) THEN
        !DIR$ OMP SIMD COLLAPSE(2)
        DO j = LBOUND(b, 2), LBOUND(b, 2) + n - 1
          !DIR$ LOOP COUNT(1, LIBXSMM_MAX_M, LIBXSMM_AVG_M)
          DO i = LBOUND(a, 1), LBOUND(a, 1) + m - 1
            c(i,j) = c(i,j) + DOT_PRODUCT(a(i,:), b(:,j))
          END DO
        END DO
      ELSE IF (LIBXSMM_BETA.NE.0) THEN
        x(1:$SHAPE_AT1,1:$SHAPE_AT2) => b(:,:)
        y(1:$SHAPE_BT1,1:$SHAPE_BT2) => a(:,:)
        !DIR$ OMP SIMD COLLAPSE(2)
        DO j = 1, m
          !DIR$ LOOP COUNT(1, LIBXSMM_MAX_N, LIBXSMM_AVG_N)
          DO i = 1, n
            c(i,j) = c(i,j) + DOT_PRODUCT(x(i,:), y(:,j))
          END DO
        END DO
      ELSE IF (0.NE.LIBXSMM_COL_MAJOR) THEN
        !DIR$ OMP SIMD COLLAPSE(2)
        DO j = LBOUND(b, 2), LBOUND(b, 2) + n - 1
          !DIR$ LOOP COUNT(1, LIBXSMM_MAX_M, LIBXSMM_AVG_M)
          DO i = LBOUND(a, 1), LBOUND(a, 1) + m - 1
            c(i,j) = DOT_PRODUCT(a(i,:), b(:,j))
          END DO
        END DO
      ELSE
  
negative.code:   INTEGER(LIBXSMM_INTEGER_TYPE), PARAMETER :: LIBXSMM_BETA            = $BETA
    INTEGER(LIBXSMM_INTEGER_TYPE), PARAMETER :: LIBXSMM_JIT             = $JIT
  
    ! Flag enumeration which can be IORed.
    INTEGER(LIBXSMM_INTEGER_TYPE), PARAMETER :: LIBXSMM_GEMM_FLAG_TRANS_A = 1, &
                                                LIBXSMM_GEMM_FLAG_TRANS_B = 2, &
                                                LIBXSMM_GEMM_FLAG_ALIGN_A = 4, &
                                                LIBXSMM_GEMM_FLAG_ALIGN_C = 8
  
    INTEGER(LIBXSMM_INTEGER_TYPE), PARAMETER :: LIBXSMM_GEMM_FLAG_DEFAULT = IOR( &
                                                  MERGE(LIBXSMM_GEMM_FLAG_ALIGN_A, 0, 1.LT.LIBXSMM_ALIGNED_LOADS), &
                                                  MERGE(LIBXSMM_GEMM_FLAG_ALIGN_C, 0, 1.LT.LIBXSMM_ALIGNED_STORES))
  
    ! Enumeration of the available prefetch strategies which can be IORed.
    !   LIBXSMM_PREFETCH_NONE:      No prefetching and no prefetch fn. signature.
    !   LIBXSMM_PREFETCH_SIGNATURE: Only function prefetch signature.
    !   LIBXSMM_PREFETCH_AL2:       Prefetch PA using accesses to A.
    !   LIBXSMM_PREFETCH_AL2_JPST:  Prefetch PA (aggressive).
    !   LIBXSMM_PREFETCH_BL2_VIA_C: Prefetch PB using accesses to C.
    !   LIBXSMM_PREFETCH_AL2_AHEAD: Prefetch A ahead.
    INTEGER(LIBXSMM_INTEGER_TYPE), PARAMETER :: LIBXSMM_PREFETCH_NONE       = 0, &
                                                LIBXSMM_PREFETCH_SIGNATURE  = 1, &
                                                LIBXSMM_PREFETCH_AL2        = 2, &
                                                LIBXSMM_PREFETCH_AL2_JPST   = 4, &
                                                LIBXSMM_PREFETCH_BL2_VIA_C  = 8, &
                                                LIBXSMM_PREFETCH_AL2_AHEAD  = 16, &
                                                LIBXSMM_PREFETCH_AL2BL2_VIA_C       = IOR(LIBXSMM_PREFETCH_BL2_VIA_C, &
                                                                                          LIBXSMM_PREFETCH_AL2), &
                                                LIBXSMM_PREFETCH_AL2BL2_VIA_C_JPST  = IOR(LIBXSMM_PREFETCH_BL2_VIA_C, &
                                                                                          LIBXSMM_PREFETCH_AL2_JPST), &
                                                LIBXSMM_PREFETCH_AL2BL2_VIA_C_AHEAD = IOR(LIBXSMM_PREFETCH_BL2_VIA_C, &
                                                                                          LIBXSMM_PREFETCH_AL2_AHEAD)
  
    ! Overloaded dispatch/JIT routines (single/double precision).
    INTERFACE libxsmm_mm_dispatch
      MODULE PROCEDURE smm_dispatch, dmm_dispatch
    END INTERFACE
  
    ! Overloaded BLAS routines (single/double precision).
    INTERFACE libxsmm_blasmm
      MODULE PROCEDURE libxsmm_sblasmm, libxsmm_dblasmm
    END INTERFACE
  
    ! Overloaded optimized routines (single/double precision).
    INTERFACE libxsmm_imm
      MODULE PROCEDURE libxsmm_simm, libxsmm_dimm
    END INTERFACE
  
    ! Overloaded auto-dispatch routines (single/double precision).
    INTERFACE libxsmm_mm
      MODULE PROCEDURE libxsmm_smm, libxsmm_dmm
    END INTERFACE
  
    ! Type of a function generated for a specific Alpha, Beta, and M, N, and K.
    ABSTRACT INTERFACE
      PURE SUBROUTINE LIBXSMM_SMM_FUNCTION(alpha, beta, a, b, c) BIND(C)
        IMPORT :: C_FLOAT
        REAL(C_FLOAT), VALUE, INTENT(IN) :: alpha, beta
        REAL(C_FLOAT), INTENT(IN) :: a(*), b(*)
        REAL(C_FLOAT), INTENT(INOUT) :: c(*)
      END SUBROUTINE
      PURE SUBROUTINE LIBXSMM_DMM_FUNCTION(alpha, beta, a, b, c) BIND(C)
        IMPORT :: C_DOUBLE
        REAL(C_DOUBLE), VALUE, INTENT(IN) :: alpha, beta
        REAL(C_DOUBLE), INTENT(IN) :: a(*), b(*)
        REAL(C_DOUBLE), INTENT(INOUT) :: c(*)
      END SUBROUTINE
    END INTERFACE
  
    !DIR$ ATTRIBUTES OFFLOAD:MIC :: sgemm, dgemm
    !DIR$ ATTRIBUTES OFFLOAD:MIC :: libxsmm_init, libxsmm_smm_dispatch, libxsmm_dmm_dispatch
    !DIR$ ATTRIBUTES OFFLOAD:MIC :: libxsmm_timer_tick, libxsmm_timer_duration
    INTERFACE
      SUBROUTINE sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
  