Modify CUDA code to compile with 12.4/12.5

repack-newsolve
sfilippone 6 months ago
parent 39cfcd3893
commit e3a55967a5

@ -1,8 +1,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include "cintrf.h"
#include "vectordev.h"
#include "psi_cuda_common.cuh" #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; ir += ldv;
} }
idiag[i]=idval; idiag[i]=idval;
} }
void CONCAT(GEN_PSI_FUNC_NAME(TYPE_SYMBOL),_)(spgpuHandle_t handle, int nrws, int i, int nr, int nza, 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 baseIdx, int hacksz, int ldv, int nzm,
int *rS,int *devIdisp, int *devJa, VALUE_TYPE *devVal, 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); dim3 grid ((nrws + THREAD_BLOCK - 1) / THREAD_BLOCK);
CONCAT(GEN_PSI_FUNC_NAME(TYPE_SYMBOL),_krn) CONCAT(GEN_PSI_FUNC_NAME(TYPE_SYMBOL),_krn)
<<< grid, block, 0, handle->currentStream >>>(i,nrws, nr, nza, baseIdx, hacksz, ldv, nzm, <<< grid, block, 0, handle->currentStream >>>(i,nrws, nr, nza, baseIdx,
rS,devIdisp,devJa,devVal,idiag, rP,cM); 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, (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 *rS,int *devIdisp, int *devJa, VALUE_TYPE *devVal,
int *idiag, int *rP, VALUE_TYPE *cM) int *idiag, int *rP, VALUE_TYPE *cM)
{ int i,j, nrws; { int i, nrws;
//int maxNForACall = THREAD_BLOCK*handle->maxGridSizeX; //int maxNForACall = THREAD_BLOCK*handle->maxGridSizeX;
int maxNForACall = max(handle->maxGridSizeX, THREAD_BLOCK*handle->maxGridSizeX); int maxNForACall = max(handle->maxGridSizeX, THREAD_BLOCK*handle->maxGridSizeX);
//fprintf(stderr,"Loop on j: %d\n",j); //fprintf(stderr,"Loop on j: %d\n",j);
for (i=0; i<nr; i+=nrws) { for (i=0; i<nr; i+=nrws) {
nrws = MIN(maxNForACall, nr - i); nrws = MIN(maxNForACall, nr - i);
//fprintf(stderr,"ifirst: %d i : %d nrws: %d i + ifirst + (nrws -1) -1 %d \n",ifirst,i,nrws,i + ifirst + (nrws -1) -1); //fprintf(stderr,"ifirst: %d i : %d nrws: %d i + ifirst + (nrws -1) -1 %d \n",ifirst,i,nrws,i + ifirst + (nrws -1) -1);
CONCAT(GEN_PSI_FUNC_NAME(TYPE_SYMBOL),_)(handle,nrws,i, nr, nza, baseIdx, hacksz, ldv, nzm, CONCAT(GEN_PSI_FUNC_NAME(TYPE_SYMBOL),_)(handle,nrws,i, nr, nza, baseIdx,
rS,devIdisp, devJa, devVal, idiag, rP, cM); hacksz, ldv, nzm,
rS,devIdisp, devJa, devVal,
idiag, rP, cM);
} }
} }

@ -1,8 +1,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include "cintrf.h"
#include "vectordev.h"
#include "psi_cuda_common.cuh" #include "psi_cuda_common.cuh"

@ -2,9 +2,7 @@
#include <stdio.h> #include <stdio.h>
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#define VALUE_TYPE cuFloatComplex #define VALUE_TYPE cuFloatComplex
#define TYPE_SYMBOL c #define TYPE_SYMBOL c
#include "psi_cuda_CopyCooToElg.cuh" #include "psi_cuda_CopyCooToElg.cuh"

@ -2,9 +2,6 @@
#include <stdio.h> #include <stdio.h>
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#define VALUE_TYPE cuFloatComplex #define VALUE_TYPE cuFloatComplex
#define TYPE_SYMBOL c #define TYPE_SYMBOL c
#include "psi_cuda_CopyCooToHlg.cuh" #include "psi_cuda_CopyCooToHlg.cuh"

@ -2,9 +2,6 @@
#include <stdio.h> #include <stdio.h>
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#define VALUE_TYPE double #define VALUE_TYPE double
#define TYPE_SYMBOL d #define TYPE_SYMBOL d
#include "psi_cuda_CopyCooToElg.cuh" #include "psi_cuda_CopyCooToElg.cuh"

@ -2,9 +2,6 @@
#include <stdio.h> #include <stdio.h>
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#define VALUE_TYPE double #define VALUE_TYPE double
#define TYPE_SYMBOL d #define TYPE_SYMBOL d
#include "psi_cuda_CopyCooToHlg.cuh" #include "psi_cuda_CopyCooToHlg.cuh"

@ -2,9 +2,6 @@
#include <stdio.h> #include <stdio.h>
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#define VALUE_TYPE float #define VALUE_TYPE float
#define TYPE_SYMBOL s #define TYPE_SYMBOL s
#include "psi_cuda_CopyCooToElg.cuh" #include "psi_cuda_CopyCooToElg.cuh"

@ -2,9 +2,6 @@
#include <stdio.h> #include <stdio.h>
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#define VALUE_TYPE float #define VALUE_TYPE float
#define TYPE_SYMBOL s #define TYPE_SYMBOL s
#include "psi_cuda_CopyCooToHlg.cuh" #include "psi_cuda_CopyCooToHlg.cuh"

@ -2,9 +2,6 @@
#include <stdio.h> #include <stdio.h>
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#define VALUE_TYPE cuDoubleComplex #define VALUE_TYPE cuDoubleComplex
#define TYPE_SYMBOL z #define TYPE_SYMBOL z
#include "psi_cuda_CopyCooToElg.cuh" #include "psi_cuda_CopyCooToElg.cuh"

@ -2,9 +2,6 @@
#include <stdio.h> #include <stdio.h>
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#define VALUE_TYPE cuDoubleComplex #define VALUE_TYPE cuDoubleComplex
#define TYPE_SYMBOL z #define TYPE_SYMBOL z
#include "psi_cuda_CopyCooToHlg.cuh" #include "psi_cuda_CopyCooToHlg.cuh"

@ -35,7 +35,6 @@
#include <cuda_runtime.h> #include <cuda_runtime.h>
#include <cusparse_v2.h> #include <cusparse_v2.h>
#include "cintrf.h"
#include "fcusparse.h" #include "fcusparse.h"
#include "ccusparse.h" #include "ccusparse.h"

@ -37,10 +37,9 @@
#include <stdio.h> #include <stdio.h>
#include "core.h" #include "core.h"
#include "cuda_util.h" //#include "cuda_util.h"
#include "vector.h" //#include "vector.h"
#include "vectordev.h" //#include "vectordev.h"
#define ELL_PITCH_ALIGN_S 32 #define ELL_PITCH_ALIGN_S 32
#define ELL_PITCH_ALIGN_D 16 #define ELL_PITCH_ALIGN_D 16

@ -35,7 +35,6 @@
#include <cuda_runtime.h> #include <cuda_runtime.h>
#include <cusparse_v2.h> #include <cusparse_v2.h>
#include "cintrf.h"
#include "fcusparse.h" #include "fcusparse.h"
#include "dcusparse.h" #include "dcusparse.h"

@ -33,6 +33,7 @@
#define _DIAGDEV_H_ #define _DIAGDEV_H_
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#include "dia.h" #include "dia.h"
struct DiagDevice struct DiagDevice

@ -34,6 +34,7 @@
#define _DNSDEV_H_ #define _DNSDEV_H_
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#include "cuComplex.h" #include "cuComplex.h"
#include "cublas_v2.h" #include "cublas_v2.h"

@ -34,6 +34,7 @@
#define _ELLDEV_H_ #define _ELLDEV_H_
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#include "cuComplex.h" #include "cuComplex.h"
#include "ell.h" #include "ell.h"

@ -34,7 +34,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <cuda_runtime.h> #include <cuda_runtime.h>
#include "cintrf.h"
#include "fcusparse.h" #include "fcusparse.h"
static cusparseHandle_t *cusparse_handle=NULL; static cusparseHandle_t *cusparse_handle=NULL;

@ -40,6 +40,7 @@
#include <cusparse.h> #include <cusparse.h>
#endif #endif
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
int FcusparseCreate(); int FcusparseCreate();
int FcusparseDestroy(); int FcusparseDestroy();

@ -33,6 +33,7 @@
#define _HDIAGDEV_H_ #define _HDIAGDEV_H_
#include "cintrf.h" #include "cintrf.h"
#include "vectordev.h"
#include "hdia.h" #include "hdia.h"
struct HdiagDevice struct HdiagDevice

@ -34,7 +34,7 @@
#include "cintrf.h" #include "cintrf.h"
#include "hell.h" #include "hell.h"
#include "vectordev.h"
typedef struct hlldevice typedef struct hlldevice
{ {

@ -35,7 +35,6 @@
#include <cuda_runtime.h> #include <cuda_runtime.h>
#include <cusparse_v2.h> #include <cusparse_v2.h>
#include "cintrf.h"
#include "fcusparse.h" #include "fcusparse.h"
#include "scusparse.h" #include "scusparse.h"

@ -28,13 +28,12 @@
/* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */ /* POSSIBILITY OF SUCH DAMAGE. */
#pragma once #pragma once
//#include "utils.h" //#include "utils.h"
#include "cuda_runtime.h" #include "cuda_runtime.h"
//#include "common.h" //#include "common.h"
#include "cintrf.h" //#include "cintrf.h"
#include <complex.h> #include <complex.h>
struct MultiVectDevice struct MultiVectDevice
@ -85,3 +84,4 @@ int allocMultiVecDevice(void ** remoteMultiVec, struct MultiVectorDeviceParams *
int getMultiVecDeviceSize(void* deviceVec); int getMultiVecDeviceSize(void* deviceVec);
int getMultiVecDeviceCount(void* deviceVec); int getMultiVecDeviceCount(void* deviceVec);
int getMultiVecDevicePitch(void* deviceVec); int getMultiVecDevicePitch(void* deviceVec);

@ -35,7 +35,6 @@
#include <cuda_runtime.h> #include <cuda_runtime.h>
#include <cusparse_v2.h> #include <cusparse_v2.h>
#include "cintrf.h"
#include "fcusparse.h" #include "fcusparse.h"
#include "zcusparse.h" #include "zcusparse.h"

Loading…
Cancel
Save