From d4488beccc2b39dcc81131c60d687f6b77679ce9 Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Thu, 18 Jun 2015 12:24:23 +0000
Subject: [PATCH] update f90 interface

---
 control/morse_f90.f90   | 14 +++++++-------
 include/CMakeLists.txt  |  1 +
 include/morse_fortran.h |  5 +++--
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/control/morse_f90.f90 b/control/morse_f90.f90
index 9c3b7b238..198e0c8bb 100644
--- a/control/morse_f90.f90
+++ b/control/morse_f90.f90
@@ -90,12 +90,12 @@ module morse
       integer, parameter :: dp = kind(0.0d0)
 
       interface
-         function MORSE_Init_c(cores) &
+         function MORSE_Init_c(cpus, gpus) &
           & bind(c, name='MORSE_Init')
             use iso_c_binding
             implicit none
             integer(kind=c_int) :: MORSE_Init_c
-            integer(kind=c_int), value :: cores
+            integer(kind=c_int), value :: cpus, gpus
          end function MORSE_Init_c
       end interface
 
@@ -209,11 +209,11 @@ module morse
       end interface
 
       interface
-         function MORSE_Init_Affinity_c(cores,bindtab) &
+         function MORSE_Init_Affinity_c(cores,gpus,bindtab) &
           & bind(c, name='MORSE_Init_Affinity')
             use iso_c_binding
             integer(kind=c_int) :: MORSE_Init_Affinity_c
-            integer(kind=c_int), value ::  cores
+            integer(kind=c_int), value ::  cores, gpus
             type(c_ptr), value :: bindtab
          end function MORSE_Init_Affinity_c
       end interface
@@ -296,12 +296,12 @@ module morse
 
    contains
 
-   subroutine morse_init(ncores,info)
+   subroutine morse_init(cores,gpus,info)
       use iso_c_binding
       implicit none
-      integer(kind=c_int), intent(in) :: ncores
+      integer(kind=c_int), intent(in) :: cores, gpus
       integer(kind=c_int), intent(out) :: info
-      info = morse_init_c(ncores)
+      info = morse_init_c(cores,gpus)
       morse_initialized = .true.
    end subroutine morse_init
 
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index b982cae52..061af84be 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -65,6 +65,7 @@ add_custom_target(chameleon_include ALL SOURCES ${CHAMELEON_HDRS})
 
 set(HDR_INSTALL
     morse_constants.h
+    morse_fortran.h
     morse_kernels.h
     morse_simulate.h
     morse_struct.h
diff --git a/include/morse_fortran.h b/include/morse_fortran.h
index 2a12c8675..5cf58ae11 100644
--- a/include/morse_fortran.h
+++ b/include/morse_fortran.h
@@ -164,12 +164,13 @@
 !   State machine switches
 !
       integer MORSE_WARNINGS, MORSE_ERRORS, MORSE_AUTOTUNING
-      integer MORSE_DAG
+      integer MORSE_DAG, MORSE_PROFILING_MODE, MORSE_PARALLEL_MODE
+      integer MORSE_BOUND
       parameter ( MORSE_WARNINGS       = 1 )
       parameter ( MORSE_ERRORS         = 2 )
       parameter ( MORSE_AUTOTUNING     = 3 )
       parameter ( MORSE_DAG            = 4 )
-      parameter ( MORSE_PROFILING_MOSE = 5 )
+      parameter ( MORSE_PROFILING_MODE = 5 )
       parameter ( MORSE_PARALLEL_MODE  = 6 )
       parameter ( MORSE_BOUND          = 7 )
 
-- 
GitLab