set_conf_par_mm_driver Subroutine

private subroutine set_conf_par_mm_driver(this, mm_driver)

Type Bound

CONF_PAR_MM_DRIVER

Arguments

Type IntentOptional Attributes Name
class(CONF_PAR_MM_DRIVER), intent(inout) :: this
character(len=*), intent(in), optional :: mm_driver

Source Code

   SUBROUTINE set_conf_par_mm_driver(this, mm_driver)
      CLASS(CONF_PAR_MM_DRIVER), INTENT(INOUT) :: this
      CHARACTER(len=*), INTENT(IN), OPTIONAL           :: mm_driver

      CHARACTER(len=max_paramter_value_len) :: my_mm_driver

      IF (this%env_value(my_mm_driver)) RETURN

      ! Use User-code value
      IF (PRESENT(mm_driver) .AND. this%source .NE. 'E') THEN
         my_mm_driver = TRIM(mm_driver)
         this%source = 'U'
      END IF

      ! Check input value
      IF (PRESENT(mm_driver) .OR. this%source .EQ. 'E') THEN
         CALL uppercase(my_mm_driver)
         IF (my_mm_driver .EQ. mm_name_auto) THEN
            this%val = this%defval
         ELSE IF (my_mm_driver .EQ. mm_name_blas) THEN
            this%val = mm_driver_blas ! always available
         ELSE IF (my_mm_driver .EQ. mm_name_matmul) THEN
            this%val = mm_driver_matmul ! always available
         ELSE IF (my_mm_driver .EQ. mm_name_smm) THEN
            IF (.NOT. has_smm) DBCSR_ABORT("Support for libsmm not compiled in.")
            this%val = mm_driver_smm
         ELSE IF (my_mm_driver .EQ. mm_name_xsmm) THEN
            IF (.NOT. has_xsmm) DBCSR_ABORT("Support for libxsmm not compiled in.")
            this%val = mm_driver_xsmm
         ELSE
            DBCSR_ABORT("Unknown MM driver: "//TRIM(mm_driver))
         END IF
      END IF
   END SUBROUTINE set_conf_par_mm_driver