From ea4218b66cc4868680e9395a530d19b001c54cab Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Tue, 11 Mar 2025 11:35:45 +0100
Subject: [PATCH 1/5] starpu: remove deprecated and incomplete code to switch
 to/from fake models

---
 runtime/starpu/include/runtime_codelet_profile.h |  1 -
 runtime/starpu/include/runtime_codelets.h        | 12 ------------
 runtime/starpu/include/runtime_profiling.h       | 10 ----------
 3 files changed, 23 deletions(-)

diff --git a/runtime/starpu/include/runtime_codelet_profile.h b/runtime/starpu/include/runtime_codelet_profile.h
index 361aeeb75..eac734b1f 100644
--- a/runtime/starpu/include/runtime_codelet_profile.h
+++ b/runtime/starpu/include/runtime_codelet_profile.h
@@ -73,7 +73,6 @@
 
 #define CHAMELEON_CL_CB_HEADER(name)                    \
     extern struct starpu_perfmodel*cl_##name##_save;    \
-    extern struct starpu_perfmodel cl_##name##_fake;    \
     void cl_##name##_callback();                        \
     void profiling_display_##name##_info(void)
 
diff --git a/runtime/starpu/include/runtime_codelets.h b/runtime/starpu/include/runtime_codelets.h
index e274d643a..42f97ef08 100644
--- a/runtime/starpu/include/runtime_codelets.h
+++ b/runtime/starpu/include/runtime_codelets.h
@@ -64,11 +64,6 @@
 #endif
 
 #define CODELETS_ALL(cl_name, cpu_func_name, gpu_func_name, _original_location_, gpu_flags) \
-    struct starpu_perfmodel cl_##cl_name##_fake = {                     \
-        .type   = STARPU_HISTORY_BASED,                                 \
-        .symbol = "fake_"#cl_name                                       \
-    };                                                                  \
-                                                                        \
     struct starpu_perfmodel cl_##cl_name##_model = {                    \
         .type   = STARPU_HISTORY_BASED,                                 \
         .symbol = ""#cl_name                                            \
@@ -92,11 +87,6 @@
     void cl_##cl_name##_restore_where(void)                             \
     {                                                                   \
         cl_##cl_name.where = (_original_location_);                     \
-    }                                                                   \
-                                                                        \
-    void cl_##cl_name##_restore_model(void)                             \
-    {                                                                   \
-        cl_##cl_name.model = &cl_##cl_name##_model;                     \
     }
 
 #if defined(CHAMELEON_SIMULATION)
@@ -117,8 +107,6 @@
 
 #define CODELETS_ALL_HEADER(name)                            \
      CHAMELEON_CL_CB_HEADER(name);                           \
-     void cl_##name##_load_fake_model(void);                 \
-     void cl_##name##_restore_model(void);                   \
      extern struct starpu_codelet cl_##name;                 \
      void cl_##name##_restrict_where(uint32_t where);        \
      void cl_##name##_restore_where(void)
diff --git a/runtime/starpu/include/runtime_profiling.h b/runtime/starpu/include/runtime_profiling.h
index e366c620c..dd71ca13f 100644
--- a/runtime/starpu/include/runtime_profiling.h
+++ b/runtime/starpu/include/runtime_profiling.h
@@ -43,14 +43,4 @@ void RUNTIME_profiling_cdisplay_all(void);
 void RUNTIME_profiling_ddisplay_all(void);
 void RUNTIME_profiling_sdisplay_all(void);
 
-void CHAMELEON_zload_FakeModel();
-void CHAMELEON_cload_FakeModel();
-void CHAMELEON_dload_FakeModel();
-void CHAMELEON_sload_FakeModel();
-
-void CHAMELEON_zrestore_Model();
-void CHAMELEON_crestore_Model();
-void CHAMELEON_drestore_Model();
-void CHAMELEON_srestore_Model();
-
 #endif /* _runtime_profiling_h_ */
-- 
GitLab


From daa73e90549c385b1563a296822a980c9eebfdb3 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Tue, 11 Mar 2025 13:39:37 +0100
Subject: [PATCH 2/5] starpu: remove deprecated fields for store the function
 pointers

---
 runtime/starpu/include/runtime_codelets.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/runtime/starpu/include/runtime_codelets.h b/runtime/starpu/include/runtime_codelets.h
index 42f97ef08..8e5b5b891 100644
--- a/runtime/starpu/include/runtime_codelets.h
+++ b/runtime/starpu/include/runtime_codelets.h
@@ -54,7 +54,7 @@
 #if defined(CHAMELEON_USE_CUDA)
 #define CODELET_GPU_FIELDS( gpu_func_name, gpu_flags )                 \
         CODELET_CUDA_FLAGS( gpu_flags )                                \
-        .cuda_func = ((gpu_func_name)),
+        .cuda_funcs = {(gpu_func_name)},
 #elif defined(CHAMELEON_USE_HIP)
 #define CODELET_GPU_FIELDS( gpu_func_name, gpu_flags )                 \
         CODELET_HIP_FLAGS( gpu_flags )                                 \
@@ -71,7 +71,7 @@
                                                                         \
     struct starpu_codelet cl_##cl_name = {                              \
         .where     = (_original_location_),                             \
-        .cpu_func  = ((cpu_func_name)),                                 \
+        .cpu_funcs = {(cpu_func_name)},                                 \
         CODELET_GPU_FIELDS( gpu_func_name, gpu_flags )                  \
         .nbuffers  = STARPU_VARIABLE_NBUFFERS,                          \
         .model     = &cl_##cl_name##_model,                             \
-- 
GitLab


From 2826b3f6fad6ff90752878a98472112713655c72 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Thu, 13 Mar 2025 15:04:17 +0100
Subject: [PATCH 3/5] starpu: Force requirement of 1.4 release

---
 runtime/starpu/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/starpu/CMakeLists.txt b/runtime/starpu/CMakeLists.txt
index 4fe2a9e76..e7f330d1b 100644
--- a/runtime/starpu/CMakeLists.txt
+++ b/runtime/starpu/CMakeLists.txt
@@ -36,7 +36,7 @@ include(CheckSymbolExists)
 include(CheckStructHasMember)
 include(CheckCSourceRuns)
 
-set(CHAMELEON_STARPU_VERSION "1.3" CACHE STRING "necessary STARPU API version")
+set(CHAMELEON_STARPU_VERSION "1.4" CACHE STRING "necessary STARPU API version")
 
 find_package(STARPU ${CHAMELEON_STARPU_VERSION} REQUIRED)
 
-- 
GitLab


From 67a311c614237e357c80990feecf424fa61722dd Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Thu, 13 Mar 2025 15:14:46 +0100
Subject: [PATCH 4/5] starpu: initialize need_submit with need_exec to siplify
 the test

---
 runtime/starpu/include/chameleon_starpu_internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/runtime/starpu/include/chameleon_starpu_internal.h b/runtime/starpu/include/chameleon_starpu_internal.h
index 9beea7b0e..c202955a8 100644
--- a/runtime/starpu/include/chameleon_starpu_internal.h
+++ b/runtime/starpu/include/chameleon_starpu_internal.h
@@ -347,7 +347,7 @@ starpu_cham_exchange_data_before_execution( const RUNTIME_option_t
                                             int                                     An,
                                             enum starpu_data_access_mode            mode )
 {
-    unsigned              need_submit = 0;
+    unsigned              need_submit = params.do_execute;
     starpu_data_handle_t *ptrtile     = chameleon_starpu_data_gethandle( A, Am, An );
 
     /*
@@ -369,7 +369,7 @@ starpu_cham_exchange_data_before_execution( const RUNTIME_option_t
         need_submit = 1;
     }
 
-    if ( !need_submit && !params->do_execute ) {
+    if ( !need_submit ) {
         return;
     }
 
-- 
GitLab


From fe76874b508d6deddabaab0f4990344cb984de0e Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Thu, 13 Mar 2025 15:17:12 +0100
Subject: [PATCH 5/5] Update ChangeLog

---
 ChangeLog | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ChangeLog b/ChangeLog
index 23cd6845a..545761d09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 chameleon-1.4.0
 ------------------------------------------------------------------------
+ - StarPU: Update the minimum requirement from 1.3 to 1.4
  - StarPU: When using starpu > 1.4.8, use the new distributed submit interface in the codelets instead of the classical insert task interface.
  - ci: use -Werror to prevent from adding warning to the code
  - Fix: all warning reported by the switch to -Werror
-- 
GitLab