From e3a55967a560802d8543f33057b9bc78d6a41371 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Sun, 23 Jun 2024 16:03:10 +0200 Subject: [PATCH] Modify CUDA code to compile with 12.4/12.5 --- cuda/CUDA/psi_cuda_CopyCooToElg.cuh | 19 +++++++++---------- cuda/CUDA/psi_cuda_CopyCooToHlg.cuh | 2 -- cuda/CUDA/psi_cuda_c_CopyCooToElg.cu | 4 +--- cuda/CUDA/psi_cuda_c_CopyCooToHlg.cu | 3 --- cuda/CUDA/psi_cuda_d_CopyCooToElg.cu | 3 --- cuda/CUDA/psi_cuda_d_CopyCooToHlg.cu | 3 --- cuda/CUDA/psi_cuda_s_CopyCooToElg.cu | 3 --- cuda/CUDA/psi_cuda_s_CopyCooToHlg.cu | 3 --- cuda/CUDA/psi_cuda_z_CopyCooToElg.cu | 3 --- cuda/CUDA/psi_cuda_z_CopyCooToHlg.cu | 3 --- cuda/ccusparse.c | 1 - cuda/cintrf.h | 7 +++---- cuda/dcusparse.c | 1 - cuda/diagdev.h | 1 + cuda/dnsdev.h | 1 + cuda/elldev.h | 1 + cuda/fcusparse.c | 1 - cuda/fcusparse.h | 1 + cuda/hdiagdev.h | 1 + cuda/hlldev.h | 2 +- cuda/scusparse.c | 1 - cuda/vectordev.h | 4 ++-- cuda/zcusparse.c | 1 - 23 files changed, 21 insertions(+), 48 deletions(-) diff --git a/cuda/CUDA/psi_cuda_CopyCooToElg.cuh b/cuda/CUDA/psi_cuda_CopyCooToElg.cuh index 98aac050..5b723be1 100644 --- a/cuda/CUDA/psi_cuda_CopyCooToElg.cuh +++ b/cuda/CUDA/psi_cuda_CopyCooToElg.cuh @@ -1,8 +1,6 @@ #include #include -#include "cintrf.h" -#include "vectordev.h" #include "psi_cuda_common.cuh" @@ -62,11 +60,9 @@ __global__ void CONCAT(GEN_PSI_FUNC_NAME(TYPE_SYMBOL),_krn)(int ii, int nrws, ir += ldv; } idiag[i]=idval; - } - void CONCAT(GEN_PSI_FUNC_NAME(TYPE_SYMBOL),_)(spgpuHandle_t handle, int nrws, int i, int nr, int nza, int baseIdx, int hacksz, int ldv, int nzm, int *rS,int *devIdisp, int *devJa, VALUE_TYPE *devVal, @@ -76,8 +72,10 @@ void CONCAT(GEN_PSI_FUNC_NAME(TYPE_SYMBOL),_)(spgpuHandle_t handle, int nrws, i dim3 grid ((nrws + THREAD_BLOCK - 1) / THREAD_BLOCK); CONCAT(GEN_PSI_FUNC_NAME(TYPE_SYMBOL),_krn) - <<< grid, block, 0, handle->currentStream >>>(i,nrws, nr, nza, baseIdx, hacksz, ldv, nzm, - rS,devIdisp,devJa,devVal,idiag, rP,cM); + <<< grid, block, 0, handle->currentStream >>>(i,nrws, nr, nza, baseIdx, + hacksz, ldv, nzm, + rS,devIdisp,devJa,devVal, + idiag, rP,cM); } @@ -89,16 +87,17 @@ GEN_PSI_FUNC_NAME(TYPE_SYMBOL) (spgpuHandle_t handle, int nr, int nc, int nza, int baseIdx, int hacksz, int ldv, int nzm, int *rS,int *devIdisp, int *devJa, VALUE_TYPE *devVal, int *idiag, int *rP, VALUE_TYPE *cM) -{ int i,j, nrws; +{ int i, nrws; //int maxNForACall = THREAD_BLOCK*handle->maxGridSizeX; int maxNForACall = max(handle->maxGridSizeX, THREAD_BLOCK*handle->maxGridSizeX); - //fprintf(stderr,"Loop on j: %d\n",j); for (i=0; i #include -#include "cintrf.h" -#include "vectordev.h" #include "psi_cuda_common.cuh" diff --git a/cuda/CUDA/psi_cuda_c_CopyCooToElg.cu b/cuda/CUDA/psi_cuda_c_CopyCooToElg.cu index e069ff1e..651a8d9f 100644 --- a/cuda/CUDA/psi_cuda_c_CopyCooToElg.cu +++ b/cuda/CUDA/psi_cuda_c_CopyCooToElg.cu @@ -2,9 +2,7 @@ #include #include "cintrf.h" -#include "vectordev.h" - - #define VALUE_TYPE cuFloatComplex #define TYPE_SYMBOL c #include "psi_cuda_CopyCooToElg.cuh" + diff --git a/cuda/CUDA/psi_cuda_c_CopyCooToHlg.cu b/cuda/CUDA/psi_cuda_c_CopyCooToHlg.cu index f2b5c86d..e36728b1 100644 --- a/cuda/CUDA/psi_cuda_c_CopyCooToHlg.cu +++ b/cuda/CUDA/psi_cuda_c_CopyCooToHlg.cu @@ -2,9 +2,6 @@ #include #include "cintrf.h" -#include "vectordev.h" - - #define VALUE_TYPE cuFloatComplex #define TYPE_SYMBOL c #include "psi_cuda_CopyCooToHlg.cuh" diff --git a/cuda/CUDA/psi_cuda_d_CopyCooToElg.cu b/cuda/CUDA/psi_cuda_d_CopyCooToElg.cu index f306ffe1..233bae06 100644 --- a/cuda/CUDA/psi_cuda_d_CopyCooToElg.cu +++ b/cuda/CUDA/psi_cuda_d_CopyCooToElg.cu @@ -2,9 +2,6 @@ #include #include "cintrf.h" -#include "vectordev.h" - - #define VALUE_TYPE double #define TYPE_SYMBOL d #include "psi_cuda_CopyCooToElg.cuh" diff --git a/cuda/CUDA/psi_cuda_d_CopyCooToHlg.cu b/cuda/CUDA/psi_cuda_d_CopyCooToHlg.cu index 9c0e371e..94e076ae 100644 --- a/cuda/CUDA/psi_cuda_d_CopyCooToHlg.cu +++ b/cuda/CUDA/psi_cuda_d_CopyCooToHlg.cu @@ -2,9 +2,6 @@ #include #include "cintrf.h" -#include "vectordev.h" - - #define VALUE_TYPE double #define TYPE_SYMBOL d #include "psi_cuda_CopyCooToHlg.cuh" diff --git a/cuda/CUDA/psi_cuda_s_CopyCooToElg.cu b/cuda/CUDA/psi_cuda_s_CopyCooToElg.cu index 76e10de1..e083708c 100644 --- a/cuda/CUDA/psi_cuda_s_CopyCooToElg.cu +++ b/cuda/CUDA/psi_cuda_s_CopyCooToElg.cu @@ -2,9 +2,6 @@ #include #include "cintrf.h" -#include "vectordev.h" - - #define VALUE_TYPE float #define TYPE_SYMBOL s #include "psi_cuda_CopyCooToElg.cuh" diff --git a/cuda/CUDA/psi_cuda_s_CopyCooToHlg.cu b/cuda/CUDA/psi_cuda_s_CopyCooToHlg.cu index c2d76c0a..90ad5fdf 100644 --- a/cuda/CUDA/psi_cuda_s_CopyCooToHlg.cu +++ b/cuda/CUDA/psi_cuda_s_CopyCooToHlg.cu @@ -2,9 +2,6 @@ #include #include "cintrf.h" -#include "vectordev.h" - - #define VALUE_TYPE float #define TYPE_SYMBOL s #include "psi_cuda_CopyCooToHlg.cuh" diff --git a/cuda/CUDA/psi_cuda_z_CopyCooToElg.cu b/cuda/CUDA/psi_cuda_z_CopyCooToElg.cu index a57ad637..b5ec817d 100644 --- a/cuda/CUDA/psi_cuda_z_CopyCooToElg.cu +++ b/cuda/CUDA/psi_cuda_z_CopyCooToElg.cu @@ -2,9 +2,6 @@ #include #include "cintrf.h" -#include "vectordev.h" - - #define VALUE_TYPE cuDoubleComplex #define TYPE_SYMBOL z #include "psi_cuda_CopyCooToElg.cuh" diff --git a/cuda/CUDA/psi_cuda_z_CopyCooToHlg.cu b/cuda/CUDA/psi_cuda_z_CopyCooToHlg.cu index 2ff9b869..24d39ec4 100644 --- a/cuda/CUDA/psi_cuda_z_CopyCooToHlg.cu +++ b/cuda/CUDA/psi_cuda_z_CopyCooToHlg.cu @@ -2,9 +2,6 @@ #include #include "cintrf.h" -#include "vectordev.h" - - #define VALUE_TYPE cuDoubleComplex #define TYPE_SYMBOL z #include "psi_cuda_CopyCooToHlg.cuh" diff --git a/cuda/ccusparse.c b/cuda/ccusparse.c index a5fee796..6b5c8ea6 100644 --- a/cuda/ccusparse.c +++ b/cuda/ccusparse.c @@ -35,7 +35,6 @@ #include #include -#include "cintrf.h" #include "fcusparse.h" #include "ccusparse.h" diff --git a/cuda/cintrf.h b/cuda/cintrf.h index 3a1f6476..7119378a 100644 --- a/cuda/cintrf.h +++ b/cuda/cintrf.h @@ -37,10 +37,9 @@ #include #include "core.h" -#include "cuda_util.h" -#include "vector.h" -#include "vectordev.h" - +//#include "cuda_util.h" +//#include "vector.h" +//#include "vectordev.h" #define ELL_PITCH_ALIGN_S 32 #define ELL_PITCH_ALIGN_D 16 diff --git a/cuda/dcusparse.c b/cuda/dcusparse.c index 41f93603..9af4ce38 100644 --- a/cuda/dcusparse.c +++ b/cuda/dcusparse.c @@ -35,7 +35,6 @@ #include #include -#include "cintrf.h" #include "fcusparse.h" #include "dcusparse.h" diff --git a/cuda/diagdev.h b/cuda/diagdev.h index 2efbea92..3a062fb7 100644 --- a/cuda/diagdev.h +++ b/cuda/diagdev.h @@ -33,6 +33,7 @@ #define _DIAGDEV_H_ #include "cintrf.h" +#include "vectordev.h" #include "dia.h" struct DiagDevice diff --git a/cuda/dnsdev.h b/cuda/dnsdev.h index 1c335bf9..aa536105 100644 --- a/cuda/dnsdev.h +++ b/cuda/dnsdev.h @@ -34,6 +34,7 @@ #define _DNSDEV_H_ #include "cintrf.h" +#include "vectordev.h" #include "cuComplex.h" #include "cublas_v2.h" diff --git a/cuda/elldev.h b/cuda/elldev.h index 5305057a..4e69bb3a 100644 --- a/cuda/elldev.h +++ b/cuda/elldev.h @@ -34,6 +34,7 @@ #define _ELLDEV_H_ #include "cintrf.h" +#include "vectordev.h" #include "cuComplex.h" #include "ell.h" diff --git a/cuda/fcusparse.c b/cuda/fcusparse.c index e8e46c63..094348ce 100644 --- a/cuda/fcusparse.c +++ b/cuda/fcusparse.c @@ -34,7 +34,6 @@ #include #include -#include "cintrf.h" #include "fcusparse.h" static cusparseHandle_t *cusparse_handle=NULL; diff --git a/cuda/fcusparse.h b/cuda/fcusparse.h index 6ef22db2..02a45fa3 100644 --- a/cuda/fcusparse.h +++ b/cuda/fcusparse.h @@ -40,6 +40,7 @@ #include #endif #include "cintrf.h" +#include "vectordev.h" int FcusparseCreate(); int FcusparseDestroy(); diff --git a/cuda/hdiagdev.h b/cuda/hdiagdev.h index 5cd9f803..c02fcc69 100644 --- a/cuda/hdiagdev.h +++ b/cuda/hdiagdev.h @@ -33,6 +33,7 @@ #define _HDIAGDEV_H_ #include "cintrf.h" +#include "vectordev.h" #include "hdia.h" struct HdiagDevice diff --git a/cuda/hlldev.h b/cuda/hlldev.h index e4f8259e..3b47f5ea 100644 --- a/cuda/hlldev.h +++ b/cuda/hlldev.h @@ -34,7 +34,7 @@ #include "cintrf.h" #include "hell.h" - +#include "vectordev.h" typedef struct hlldevice { diff --git a/cuda/scusparse.c b/cuda/scusparse.c index da21506c..b0229907 100644 --- a/cuda/scusparse.c +++ b/cuda/scusparse.c @@ -35,7 +35,6 @@ #include #include -#include "cintrf.h" #include "fcusparse.h" #include "scusparse.h" diff --git a/cuda/vectordev.h b/cuda/vectordev.h index 8eca7063..df5fbd82 100644 --- a/cuda/vectordev.h +++ b/cuda/vectordev.h @@ -28,13 +28,12 @@ /* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ - #pragma once //#include "utils.h" #include "cuda_runtime.h" //#include "common.h" -#include "cintrf.h" +//#include "cintrf.h" #include struct MultiVectDevice @@ -85,3 +84,4 @@ int allocMultiVecDevice(void ** remoteMultiVec, struct MultiVectorDeviceParams * int getMultiVecDeviceSize(void* deviceVec); int getMultiVecDeviceCount(void* deviceVec); int getMultiVecDevicePitch(void* deviceVec); + diff --git a/cuda/zcusparse.c b/cuda/zcusparse.c index 62b94b3b..93142d22 100644 --- a/cuda/zcusparse.c +++ b/cuda/zcusparse.c @@ -35,7 +35,6 @@ #include #include -#include "cintrf.h" #include "fcusparse.h" #include "zcusparse.h"