1#include "config-f90.h"
2
3module elpa_autotune_impl
4  use elpa_abstract_impl
5  use, intrinsic :: iso_c_binding
6  implicit none
7#ifdef ENABLE_AUTOTUNING
8  type, extends(elpa_autotune_t) :: elpa_autotune_impl_t
9    class(elpa_abstract_impl_t), pointer :: parent => NULL()
10    integer :: current = 0
11    real(kind=C_DOUBLE) :: min_val = 0.0_C_DOUBLE
12    integer :: min_loc = 0
13    integer :: cardinality = 0
14    integer :: level = 0
15    integer :: domain = 0
16    contains
17      procedure, public :: print => elpa_autotune_print
18      procedure, public :: destroy => elpa_autotune_destroy
19  end type
20
21  contains
22
23    !> \brief function to print the autotuning
24    !> Parameters
25    !> \param   self  class(elpa_autotune_impl_t) the allocated ELPA autotune object
26    subroutine elpa_autotune_print(self, error)
27      implicit none
28      class(elpa_autotune_impl_t), intent(in) :: self
29#ifdef USE_FORTRAN2008
30      integer, intent(out), optional :: error
31#else
32      integer, intent(out)           :: error
33#endif
34      !print *, "Print me"
35    end subroutine
36
37    !> \brief function to destroy an elpa autotune object
38    !> Parameters
39    !> \param   self  class(elpa_autotune_impl_t) the allocated ELPA autotune object
40    !> \param   error integer, optional error code
41    subroutine elpa_autotune_destroy(self, error)
42      implicit none
43      class(elpa_autotune_impl_t), intent(inout) :: self
44#ifdef USE_FORTRAN2008
45      integer, optional, intent(out)             :: error
46#else
47      integer, intent(out)                       :: error
48#endif
49
50      ! nothing to do atm
51      if (present(error)) error = ELPA_OK
52    end subroutine
53#endif
54end module
55