From e2762f2d6a1ae3bedc40f94ec2612973069b4e30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Pr=C3=A9cigout?= <nathan.precigout@atos.net>
Date: Wed, 24 May 2023 12:09:50 +0200
Subject: [PATCH] Chameleon can now be compiled with cuda 12.x

---
 CMakeLists.txt                               | 6 +++---
 control/common.h                             | 1 -
 gpucublas/include/gpucublas.h                | 1 -
 runtime/starpu/include/chameleon_starpu.h.in | 2 --
 4 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32134886d..02be11f74 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -384,14 +384,14 @@ if(NOT CHAMELEON_SIMULATION)
         find_package(CUDA REQUIRED)
 
         if (CUDA_FOUND)
+            if(CUDA_VERSION VERSION_LESS "4.0")
+                message(WARNING "Cuda version must be at least 4.0")
+            endif(CUDA_VERSION VERSION_LESS "4.0")
             message("-- ${Blue}Add definition CHAMELEON_USE_CUDA"
             " - Activate CUDA in Chameleon${ColourReset}")
             # create imported target because not provided with old cmake
             add_library(CUDA::CUDA INTERFACE IMPORTED)
             add_library(CUDA::CUBLAS INTERFACE IMPORTED)
-            if(CUDA_VERSION VERSION_LESS "3.0")
-                set(CUDA_HOST_COMPILATION_CPP OFF)
-            endif(CUDA_VERSION VERSION_LESS "3.0")
             set(CUDA_BUILD_EMULATION OFF)
             if (CUDA_INCLUDE_DIRS)
                 set_target_properties(CUDA::CUDA PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CUDA_INCLUDE_DIRS}")
diff --git a/control/common.h b/control/common.h
index c86bf94ad..ef06cffb0 100644
--- a/control/common.h
+++ b/control/common.h
@@ -48,7 +48,6 @@
 #include <cuda.h>
 #include <cuda_runtime.h>
 #include <cuda_runtime_api.h>
-#include <cublas.h>
 #include <cublas_v2.h>
 #endif
 
diff --git a/gpucublas/include/gpucublas.h b/gpucublas/include/gpucublas.h
index 90f05f44b..8a9deb977 100644
--- a/gpucublas/include/gpucublas.h
+++ b/gpucublas/include/gpucublas.h
@@ -36,7 +36,6 @@
 #include <cuda.h>
 #include <cuComplex.h>
 
-#include <cublas.h>
 #include <cublas_v2.h>
 
 #define CUBLAS_SADDR(_a_) (&(_a_))
diff --git a/runtime/starpu/include/chameleon_starpu.h.in b/runtime/starpu/include/chameleon_starpu.h.in
index 22c3ca534..122bef359 100644
--- a/runtime/starpu/include/chameleon_starpu.h.in
+++ b/runtime/starpu/include/chameleon_starpu.h.in
@@ -67,8 +67,6 @@
 #include <starpu_scheduler.h>
 #include <starpu_cuda.h>
 
-#include <cublas.h>
-#include <starpu_cublas.h>
 #include <cublas_v2.h>
 #include <starpu_cublas_v2.h>
 #endif
-- 
GitLab