diff --git a/cuda/base_cusparse_mod.F90 b/cuda/base_cusparse_mod.F90 index 9f5628be..94a8255f 100644 --- a/cuda/base_cusparse_mod.F90 +++ b/cuda/base_cusparse_mod.F90 @@ -79,9 +79,6 @@ module base_cusparse_mod enumerator cusparse_direction_column end enum - -#if defined(HAVE_CUDA) && defined(HAVE_SPGPU) - interface function FcusparseCreate() & & bind(c,name="FcusparseCreate") result(res) @@ -113,5 +110,4 @@ contains res = FcusparseDestroy() end function closeFcusparse -#endif end module base_cusparse_mod diff --git a/cuda/c_cusparse_mod.F90 b/cuda/c_cusparse_mod.F90 index e7d37173..59f37732 100644 --- a/cuda/c_cusparse_mod.F90 +++ b/cuda/c_cusparse_mod.F90 @@ -43,9 +43,6 @@ module c_cusparse_mod end type c_Hmat #endif - -#if defined(HAVE_CUDA) && defined(HAVE_SPGPU) - interface CSRGDeviceFree function c_CSRGDeviceFree(Mat) & & bind(c,name="c_CSRGDeviceFree") result(res) @@ -300,6 +297,4 @@ module c_cusparse_mod end interface #endif -#endif - end module c_cusparse_mod diff --git a/cuda/ccusparse.c b/cuda/ccusparse.c index 6f1cfdb3..c5430306 100644 --- a/cuda/ccusparse.c +++ b/cuda/ccusparse.c @@ -33,7 +33,6 @@ #include #include -#ifdef HAVE_SPGPU #include #include #include "cintrf.h" @@ -94,4 +93,3 @@ #include "fcusparse_fct.h" -#endif diff --git a/cuda/cintrf.h b/cuda/cintrf.h index 1a3528aa..3a1f6476 100644 --- a/cuda/cintrf.h +++ b/cuda/cintrf.h @@ -36,7 +36,6 @@ #include #include -#if defined(HAVE_SPGPU) && defined(HAVE_CUDA) #include "core.h" #include "cuda_util.h" #include "vector.h" @@ -45,7 +44,4 @@ #define ELL_PITCH_ALIGN_S 32 #define ELL_PITCH_ALIGN_D 16 - -#endif - #endif diff --git a/cuda/cuda_util.c b/cuda/cuda_util.c index 0fe4a8b7..09265410 100644 --- a/cuda/cuda_util.c +++ b/cuda/cuda_util.c @@ -32,8 +32,6 @@ #include "cuda_util.h" -#if defined(HAVE_CUDA) - static int hasUVA=-1; static struct cudaDeviceProp *prop=NULL; @@ -440,10 +438,6 @@ void psb_cudaDestroyCublasHandle() psb_cublas_handle=NULL; } - - - - /* Simple memory tools */ int allocateInt(void **d_int, int n) @@ -803,6 +797,3 @@ double etime() } - - -#endif diff --git a/cuda/cuda_util.h b/cuda/cuda_util.h index 789c08f4..95c8d1dc 100644 --- a/cuda/cuda_util.h +++ b/cuda/cuda_util.h @@ -38,7 +38,6 @@ #include #include -#if defined(HAVE_CUDA) #include "cuda_runtime.h" #include "core.h" #include "cuComplex.h" @@ -134,6 +133,5 @@ void freeDoubleComplex(void *); double etime(); -#endif #endif diff --git a/cuda/cvectordev.c b/cuda/cvectordev.c index 1dc16667..518154d5 100644 --- a/cuda/cvectordev.c +++ b/cuda/cvectordev.c @@ -32,7 +32,6 @@ #include #include -#if defined(HAVE_SPGPU) //#include "utils.h" //#include "common.h" #include "cvectordev.h" @@ -321,5 +320,4 @@ int absMultiVecDeviceFloatComplex(int n, cuFloatComplex alpha, void *deviceVecA) return(i); } -#endif diff --git a/cuda/cvectordev.h b/cuda/cvectordev.h index f58fcca7..27c8984a 100644 --- a/cuda/cvectordev.h +++ b/cuda/cvectordev.h @@ -31,7 +31,6 @@ #pragma once -#if defined(HAVE_SPGPU) //#include "utils.h" #include #include "cuComplex.h" @@ -77,5 +76,3 @@ int absMultiVecDeviceFloatComplex(int n, cuFloatComplex alpha, void *deviceVecA) int absMultiVecDeviceFloatComplex2(int n, cuFloatComplex alpha, void *deviceVecA, void *deviceVecB); - -#endif diff --git a/cuda/d_cusparse_mod.F90 b/cuda/d_cusparse_mod.F90 index cd8bd52f..509253e6 100644 --- a/cuda/d_cusparse_mod.F90 +++ b/cuda/d_cusparse_mod.F90 @@ -43,9 +43,6 @@ module d_cusparse_mod end type d_Hmat #endif - -#if defined(HAVE_CUDA) && defined(HAVE_SPGPU) - interface CSRGDeviceFree function d_CSRGDeviceFree(Mat) & & bind(c,name="d_CSRGDeviceFree") result(res) @@ -298,8 +295,7 @@ module d_cusparse_mod integer(c_int) :: res end function d_HYBGHost2Device end interface -#endif - + #endif end module d_cusparse_mod diff --git a/cuda/dcusparse.c b/cuda/dcusparse.c index 9659c1f9..f14e787c 100644 --- a/cuda/dcusparse.c +++ b/cuda/dcusparse.c @@ -33,7 +33,6 @@ #include #include -#ifdef HAVE_SPGPU #include #include #include "cintrf.h" @@ -92,4 +91,3 @@ #include "fcusparse_fct.h" -#endif diff --git a/cuda/diagdev.c b/cuda/diagdev.c index a2acf1f4..0cf78a41 100644 --- a/cuda/diagdev.c +++ b/cuda/diagdev.c @@ -34,7 +34,6 @@ #include #include #include -#if defined(HAVE_SPGPU) //new DiagDeviceParams getDiagDeviceParams(unsigned int rows, unsigned int columns, unsigned int diags, unsigned int elementType) { @@ -111,7 +110,6 @@ void freeDiagDevice(void* remoteMatrix) //new int FallocDiagDevice(void** deviceMat, unsigned int rows, unsigned int columns,unsigned int diags,unsigned int elementType) { int i; -#ifdef HAVE_SPGPU DiagDeviceParams p; p = getDiagDeviceParams(rows, columns, diags,elementType); @@ -120,15 +118,11 @@ int FallocDiagDevice(void** deviceMat, unsigned int rows, unsigned int columns,u fprintf(stderr,"From routine : %s : %d \n","FallocEllDevice",i); } return(i); -#else - return SPGPU_UNSUPPORTED; -#endif } int writeDiagDeviceDouble(void* deviceMat, double* a, int* off, int n) { int i,fo,fa; char buf_a[255], buf_o[255],tmp[255]; -#ifdef HAVE_SPGPU struct DiagDevice *devMat = (struct DiagDevice *) deviceMat; // Ex updateFromHost function /* memset(buf_a,'\0',255); */ @@ -159,14 +153,10 @@ int writeDiagDeviceDouble(void* deviceMat, double* a, int* off, int n) return SPGPU_SUCCESS; else return SPGPU_UNSUPPORTED; -#else - return SPGPU_UNSUPPORTED; -#endif } int readDiagDeviceDouble(void* deviceMat, double* a, int* off) { int i; -#ifdef HAVE_SPGPU struct DiagDevice *devMat = (struct DiagDevice *) deviceMat; i = readRemoteBuffer((void *) a, (void *)devMat->cM,devMat->rows*devMat->diags*sizeof(double)); i = readRemoteBuffer((void *) off, (void *)devMat->off, devMat->diags*sizeof(int)); @@ -174,9 +164,6 @@ int readDiagDeviceDouble(void* deviceMat, double* a, int* off) fprintf(stderr,"From routine : %s : %d \n","readEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } //new @@ -188,7 +175,6 @@ int spmvDiagDeviceDouble(void *deviceMat, double alpha, void* deviceX, struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; spgpuHandle_t handle=psb_cudaGetHandle(); -#ifdef HAVE_SPGPU #ifdef VERBOSE /*__assert(x->count_ == x->count_, "ERROR: x and y don't share the same number of vectors");*/ /*__assert(x->size_ >= devMat->columns, "ERROR: x vector's size is not >= to matrix size (columns)");*/ @@ -201,16 +187,12 @@ int spmvDiagDeviceDouble(void *deviceMat, double alpha, void* deviceX, //cudaSync(); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeDiagDeviceFloat(void* deviceMat, float* a, int* off, int n) { int i,fo,fa; char buf_a[255], buf_o[255],tmp[255]; -#ifdef HAVE_SPGPU struct DiagDevice *devMat = (struct DiagDevice *) deviceMat; // Ex updateFromHost function /* memset(buf_a,'\0',255); */ @@ -241,14 +223,10 @@ int writeDiagDeviceFloat(void* deviceMat, float* a, int* off, int n) return SPGPU_SUCCESS; else return SPGPU_UNSUPPORTED; -#else - return SPGPU_UNSUPPORTED; -#endif } int readDiagDeviceFloat(void* deviceMat, float* a, int* off) { int i; -#ifdef HAVE_SPGPU struct DiagDevice *devMat = (struct DiagDevice *) deviceMat; i = readRemoteBuffer((void *) a, (void *)devMat->cM,devMat->rows*devMat->diags*sizeof(float)); i = readRemoteBuffer((void *) off, (void *)devMat->off, devMat->diags*sizeof(int)); @@ -256,9 +234,6 @@ int readDiagDeviceFloat(void* deviceMat, float* a, int* off) fprintf(stderr,"From routine : %s : %d \n","readEllDeviceFloat",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } //new @@ -270,7 +245,6 @@ int spmvDiagDeviceFloat(void *deviceMat, float alpha, void* deviceX, struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; spgpuHandle_t handle=psb_cudaGetHandle(); -#ifdef HAVE_SPGPU #ifdef VERBOSE /*__assert(x->count_ == x->count_, "ERROR: x and y don't share the same number of vectors");*/ /*__assert(x->size_ >= devMat->columns, "ERROR: x vector's size is not >= to matrix size (columns)");*/ @@ -283,9 +257,5 @@ int spmvDiagDeviceFloat(void *deviceMat, float alpha, void* deviceX, //cudaSync(); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } -#endif diff --git a/cuda/diagdev.h b/cuda/diagdev.h index 83f38289..2efbea92 100644 --- a/cuda/diagdev.h +++ b/cuda/diagdev.h @@ -32,7 +32,6 @@ #ifndef _DIAGDEV_H_ #define _DIAGDEV_H_ -#ifdef HAVE_SPGPU #include "cintrf.h" #include "dia.h" @@ -88,8 +87,4 @@ int spmvDiagDeviceFloat(void *deviceMat, float alpha, void* deviceX, -#else -#define CINTRF_UNSUPPORTED -1 -#endif - #endif diff --git a/cuda/diagdev_mod.F90 b/cuda/diagdev_mod.F90 index cbcc029e..70d58d4e 100644 --- a/cuda/diagdev_mod.F90 +++ b/cuda/diagdev_mod.F90 @@ -41,8 +41,6 @@ module diagdev_mod integer(c_int) :: firstIndex end type diagdev_parms -#ifdef HAVE_SPGPU - interface function FgetDiagDeviceParams(rows, columns, elementType, firstIndex) & & result(res) bind(c,name='getDiagDeviceParams') @@ -65,7 +63,6 @@ module diagdev_mod end function FallocDiagDevice end interface - interface writeDiagDevice function writeDiagDeviceFloat(deviceMat,a,off,n) & @@ -174,7 +171,6 @@ module diagdev_mod end function getDiagTimer end interface - interface function getDiagDevicePitch(deviceMat) & & bind(c,name='getDiagDevicePitch') result(res) @@ -225,7 +221,4 @@ module diagdev_mod end function spmvDiagDeviceDoubleComplex end interface spmvDiagDevice -#endif - - end module diagdev_mod diff --git a/cuda/dnsdev.c b/cuda/dnsdev.c index 25cddc87..0a991012 100644 --- a/cuda/dnsdev.c +++ b/cuda/dnsdev.c @@ -31,8 +31,6 @@ #include #include "dnsdev.h" -#if defined(HAVE_SPGPU) - #define PASS_RS 0 #define IMIN(a,b) ((a)<(b) ? (a) : (b)) @@ -102,7 +100,6 @@ int FallocDnsDevice(void** deviceMat, unsigned int rows, unsigned int columns, unsigned int elementType, unsigned int firstIndex) { int i; -#ifdef HAVE_SPGPU DnsDeviceParams p; p = getDnsDeviceParams(rows, columns, elementType, firstIndex); @@ -111,9 +108,6 @@ int FallocDnsDevice(void** deviceMat, unsigned int rows, fprintf(stderr,"From routine : %s : %d \n","FallocDnsDevice",i); } return(i); -#else - return SPGPU_UNSUPPORTED; -#endif } @@ -124,7 +118,6 @@ int spmvDnsDeviceFloat(char transa, int m, int n, int k, float *alpha, struct MultiVectDevice *x = (struct MultiVectDevice *) deviceX; struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; int status; -#ifdef HAVE_SPGPU cublasHandle_t handle=psb_cudaGetCublasHandle(); cublasOperation_t trans=((transa == 'N')? CUBLAS_OP_N:((transa=='T')? CUBLAS_OP_T:CUBLAS_OP_C)); @@ -143,9 +136,6 @@ int spmvDnsDeviceFloat(char transa, int m, int n, int k, float *alpha, return SPGPU_SUCCESS; else return SPGPU_UNSUPPORTED; -#else - return SPGPU_UNSUPPORTED; -#endif } int spmvDnsDeviceDouble(char transa, int m, int n, int k, double *alpha, @@ -155,7 +145,6 @@ int spmvDnsDeviceDouble(char transa, int m, int n, int k, double *alpha, struct MultiVectDevice *x = (struct MultiVectDevice *) deviceX; struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; int status; -#ifdef HAVE_SPGPU cublasHandle_t handle=psb_cudaGetCublasHandle(); cublasOperation_t trans=((transa == 'N')? CUBLAS_OP_N:((transa=='T')? CUBLAS_OP_T:CUBLAS_OP_C)); @@ -174,9 +163,6 @@ int spmvDnsDeviceDouble(char transa, int m, int n, int k, double *alpha, return SPGPU_SUCCESS; else return SPGPU_UNSUPPORTED; -#else - return SPGPU_UNSUPPORTED; -#endif } int spmvDnsDeviceFloatComplex(char transa, int m, int n, int k, float complex *alpha, @@ -186,7 +172,6 @@ int spmvDnsDeviceFloatComplex(char transa, int m, int n, int k, float complex *a struct MultiVectDevice *x = (struct MultiVectDevice *) deviceX; struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; int status; -#ifdef HAVE_SPGPU cublasHandle_t handle=psb_cudaGetCublasHandle(); cublasOperation_t trans=((transa == 'N')? CUBLAS_OP_N:((transa=='T')? CUBLAS_OP_T:CUBLAS_OP_C)); @@ -205,9 +190,6 @@ int spmvDnsDeviceFloatComplex(char transa, int m, int n, int k, float complex *a return SPGPU_SUCCESS; else return SPGPU_UNSUPPORTED; -#else - return SPGPU_UNSUPPORTED; -#endif } int spmvDnsDeviceDoubleComplex(char transa, int m, int n, int k, double complex *alpha, @@ -217,7 +199,6 @@ int spmvDnsDeviceDoubleComplex(char transa, int m, int n, int k, double complex struct MultiVectDevice *x = (struct MultiVectDevice *) deviceX; struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; int status; -#ifdef HAVE_SPGPU cublasHandle_t handle=psb_cudaGetCublasHandle(); cublasOperation_t trans=((transa == 'N')? CUBLAS_OP_N:((transa=='T')? CUBLAS_OP_T:CUBLAS_OP_C)); @@ -236,15 +217,11 @@ int spmvDnsDeviceDoubleComplex(char transa, int m, int n, int k, double complex return SPGPU_SUCCESS; else return SPGPU_UNSUPPORTED; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeDnsDeviceFloat(void* deviceMat, float* val, int lda, int nc) { int i; -#ifdef HAVE_SPGPU struct DnsDevice *devMat = (struct DnsDevice *) deviceMat; int pitch=devMat->pitch; i = cublasSetMatrix(lda,nc,sizeof(float), (void*) val,lda, (void *)devMat->cM, pitch); @@ -252,14 +229,10 @@ int writeDnsDeviceFloat(void* deviceMat, float* val, int lda, int nc) fprintf(stderr,"From routine : %s : %d \n","writeDnsDeviceFloat",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeDnsDeviceDouble(void* deviceMat, double* val, int lda, int nc) { int i; -#ifdef HAVE_SPGPU struct DnsDevice *devMat = (struct DnsDevice *) deviceMat; int pitch=devMat->pitch; i = cublasSetMatrix(lda,nc,sizeof(double), (void*) val,lda, (void *)devMat->cM, pitch); @@ -267,15 +240,11 @@ int writeDnsDeviceDouble(void* deviceMat, double* val, int lda, int nc) fprintf(stderr,"From routine : %s : %d \n","writeDnsDeviceDouble",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeDnsDeviceFloatComplex(void* deviceMat, float complex* val, int lda, int nc) { int i; -#ifdef HAVE_SPGPU struct DnsDevice *devMat = (struct DnsDevice *) deviceMat; int pitch=devMat->pitch; i = cublasSetMatrix(lda,nc,sizeof(cuFloatComplex), (void*) val,lda, (void *)devMat->cM, pitch); @@ -283,14 +252,10 @@ int writeDnsDeviceFloatComplex(void* deviceMat, float complex* val, int lda, int fprintf(stderr,"From routine : %s : %d \n","writeDnsDeviceFloatComplex",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeDnsDeviceDoubleComplex(void* deviceMat, double complex* val, int lda, int nc) { int i; -#ifdef HAVE_SPGPU struct DnsDevice *devMat = (struct DnsDevice *) deviceMat; int pitch=devMat->pitch; i = cublasSetMatrix(lda,nc,sizeof(cuDoubleComplex), (void*) val,lda, (void *)devMat->cM, pitch); @@ -298,15 +263,11 @@ int writeDnsDeviceDoubleComplex(void* deviceMat, double complex* val, int lda, i fprintf(stderr,"From routine : %s : %d \n","writeDnsDeviceDoubleComplex",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readDnsDeviceFloat(void* deviceMat, float* val, int lda, int nc) { int i; -#ifdef HAVE_SPGPU struct DnsDevice *devMat = (struct DnsDevice *) deviceMat; int pitch=devMat->pitch; i = cublasGetMatrix(lda,nc,sizeof(float), (void*) val,lda, (void *)devMat->cM, pitch); @@ -314,14 +275,10 @@ int readDnsDeviceFloat(void* deviceMat, float* val, int lda, int nc) fprintf(stderr,"From routine : %s : %d \n","readDnsDeviceFloat",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readDnsDeviceDouble(void* deviceMat, double* val, int lda, int nc) { int i; -#ifdef HAVE_SPGPU struct DnsDevice *devMat = (struct DnsDevice *) deviceMat; int pitch=devMat->pitch; i = cublasGetMatrix(lda,nc,sizeof(double), (void*) val,lda, (void *)devMat->cM, pitch); @@ -329,15 +286,11 @@ int readDnsDeviceDouble(void* deviceMat, double* val, int lda, int nc) fprintf(stderr,"From routine : %s : %d \n","readDnsDeviceDouble",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readDnsDeviceFloatComplex(void* deviceMat, float complex* val, int lda, int nc) { int i; -#ifdef HAVE_SPGPU struct DnsDevice *devMat = (struct DnsDevice *) deviceMat; int pitch=devMat->pitch; i = cublasGetMatrix(lda,nc,sizeof(cuFloatComplex), (void*) val,lda, (void *)devMat->cM, pitch); @@ -345,14 +298,10 @@ int readDnsDeviceFloatComplex(void* deviceMat, float complex* val, int lda, int fprintf(stderr,"From routine : %s : %d \n","readDnsDeviceFloatComplex",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readDnsDeviceDoubleComplex(void* deviceMat, double complex* val, int lda, int nc) { int i; -#ifdef HAVE_SPGPU struct DnsDevice *devMat = (struct DnsDevice *) deviceMat; int pitch=devMat->pitch; i = cublasGetMatrix(lda,nc,sizeof(cuDoubleComplex), (void*) val,lda, (void *)devMat->cM, pitch); @@ -360,24 +309,13 @@ int readDnsDeviceDoubleComplex(void* deviceMat, double complex* val, int lda, in fprintf(stderr,"From routine : %s : %d \n","readDnsDeviceDoubleComplex",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int getDnsDevicePitch(void* deviceMat) { int i; struct DnsDevice *devMat = (struct DnsDevice *) deviceMat; -#ifdef HAVE_SPGPU i = devMat->pitch; return(i); -#else - return SPGPU_UNSUPPORTED; -#endif } - - -#endif - diff --git a/cuda/dnsdev.h b/cuda/dnsdev.h index 7c8b06c9..1c335bf9 100644 --- a/cuda/dnsdev.h +++ b/cuda/dnsdev.h @@ -33,7 +33,6 @@ #ifndef _DNSDEV_H_ #define _DNSDEV_H_ -#if defined(HAVE_SPGPU) #include "cintrf.h" #include "cuComplex.h" #include "cublas_v2.h" @@ -115,8 +114,4 @@ int getDnsDevicePitch(void* deviceMat); //int spmvDnsDeviceFloat(void *deviceMat, float* alpha, void* deviceX, float* beta, void* deviceY); //int spmvDnsDeviceDouble(void *deviceMat, double* alpha, void* deviceX, double* beta, void* deviceY); -#else -#define CINTRF_UNSUPPORTED -1 -#endif - #endif diff --git a/cuda/dnsdev_mod.F90 b/cuda/dnsdev_mod.F90 index 8b96b918..fd257e0e 100644 --- a/cuda/dnsdev_mod.F90 +++ b/cuda/dnsdev_mod.F90 @@ -44,8 +44,6 @@ module dnsdev_mod integer(c_int) :: firstIndex end type dnsdev_parms -#ifdef HAVE_SPGPU - interface function FgetDnsDeviceParams(rows, columns, elementType, firstIndex) & & result(res) bind(c,name='getDnsDeviceParams') @@ -269,7 +267,4 @@ module dnsdev_mod end interface -#endif - - end module dnsdev_mod diff --git a/cuda/dvectordev.c b/cuda/dvectordev.c index eae82c1e..39aa5b2a 100644 --- a/cuda/dvectordev.c +++ b/cuda/dvectordev.c @@ -32,7 +32,6 @@ #include #include -#if defined(HAVE_SPGPU) //#include "utils.h" //#include "common.h" #include "dvectordev.h" @@ -300,6 +299,3 @@ int absMultiVecDeviceDouble(int n, double alpha, void *deviceVecA) return(i); } - -#endif - diff --git a/cuda/dvectordev.h b/cuda/dvectordev.h index 960958c5..25905c60 100644 --- a/cuda/dvectordev.h +++ b/cuda/dvectordev.h @@ -31,7 +31,6 @@ #pragma once -#if defined(HAVE_SPGPU) //#include "utils.h" #include "vectordev.h" #include "cuda_runtime.h" @@ -74,5 +73,3 @@ int axybzMultiVecDeviceDouble(int n, double alpha, void *deviceVecA, int absMultiVecDeviceDouble(int n, double alpha, void *deviceVecA); int absMultiVecDeviceDouble2(int n, double alpha, void *deviceVecA, void *deviceVecB); - -#endif diff --git a/cuda/elldev.c b/cuda/elldev.c index eff89efa..3b79a863 100644 --- a/cuda/elldev.c +++ b/cuda/elldev.c @@ -31,8 +31,6 @@ #include #include "elldev.h" -#if defined(HAVE_SPGPU) - #define PASS_RS 0 EllDeviceParams getEllDeviceParams(unsigned int rows, unsigned int maxRowSize, @@ -140,7 +138,6 @@ int FallocEllDevice(void** deviceMat,unsigned int rows, unsigned int maxRowSize, unsigned int columns, unsigned int elementType, unsigned int firstIndex) { int i; -#ifdef HAVE_SPGPU EllDeviceParams p; p = getEllDeviceParams(rows, maxRowSize, nnzeros, columns, elementType, firstIndex); @@ -149,9 +146,6 @@ int FallocEllDevice(void** deviceMat,unsigned int rows, unsigned int maxRowSize, fprintf(stderr,"From routine : %s : %d \n","FallocEllDevice",i); } return(i); -#else - return SPGPU_UNSUPPORTED; -#endif } void sspmdmm_gpu(float *z,int s, int vPitch, float *y, float alpha, float* cM, int* rP, int* rS, @@ -182,7 +176,6 @@ int spmvEllDeviceFloat(void *deviceMat, float alpha, void* deviceX, struct MultiVectDevice *x = (struct MultiVectDevice *) deviceX; struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; -#ifdef HAVE_SPGPU #ifdef VERBOSE __assert(x->count_ == x->count_, "ERROR: x and y don't share the same number of vectors"); __assert(x->size_ >= devMat->columns, "ERROR: x vector's size is not >= to matrix size (columns)"); @@ -196,9 +189,6 @@ int spmvEllDeviceFloat(void *deviceMat, float alpha, void* deviceX, devMat->avgRowSize, devMat->maxRowSize, devMat->rows, devMat->pitch, (float *)x->v_, beta, devMat->baseIndex); return(i); -#else - return SPGPU_UNSUPPORTED; -#endif } @@ -234,7 +224,6 @@ int spmvEllDeviceDouble(void *deviceMat, double alpha, void* deviceX, struct MultiVectDevice *x = (struct MultiVectDevice *) deviceX; struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; -#ifdef HAVE_SPGPU /*spgpuDellspmv (handle, (double*) y->v_, (double*)y->v_, alpha, (double*) devMat->cM, devMat->rP, devMat->cMPitch, devMat->rPPitch, devMat->rS, devMat->rows, (double*)x->v_, beta, devMat->baseIndex);*/ /* fprintf(stderr,"From spmvEllDouble: mat %d %d %d %d y %d %d \n", */ /* devMat->avgRowSize, devMat->maxRowSize, devMat->rows, */ @@ -246,9 +235,6 @@ int spmvEllDeviceDouble(void *deviceMat, double alpha, void* deviceX, (double *)x->v_, beta, devMat->baseIndex); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } void @@ -281,7 +267,6 @@ int spmvEllDeviceFloatComplex(void *deviceMat, float complex alpha, void* device struct MultiVectDevice *x = (struct MultiVectDevice *) deviceX; struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; -#ifdef HAVE_SPGPU cuFloatComplex a = make_cuFloatComplex(crealf(alpha),cimagf(alpha)); cuFloatComplex b = make_cuFloatComplex(crealf(beta),cimagf(beta)); cspmdmm_gpu ((cuFloatComplex *)y->v_, y->count_, y->pitch_, (cuFloatComplex *)y->v_, a, (cuFloatComplex *)devMat->cM, @@ -289,9 +274,6 @@ int spmvEllDeviceFloatComplex(void *deviceMat, float complex alpha, void* device (cuFloatComplex *)x->v_, b, devMat->baseIndex); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } void @@ -323,7 +305,6 @@ int spmvEllDeviceDoubleComplex(void *deviceMat, double complex alpha, void* devi struct MultiVectDevice *x = (struct MultiVectDevice *) deviceX; struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; -#ifdef HAVE_SPGPU cuDoubleComplex a = make_cuDoubleComplex(creal(alpha),cimag(alpha)); cuDoubleComplex b = make_cuDoubleComplex(creal(beta),cimag(beta)); zspmdmm_gpu ((cuDoubleComplex *)y->v_, y->count_, y->pitch_, (cuDoubleComplex *)y->v_, a, (cuDoubleComplex *)devMat->cM, @@ -331,14 +312,10 @@ int spmvEllDeviceDoubleComplex(void *deviceMat, double complex alpha, void* devi devMat->pitch, (cuDoubleComplex *)x->v_, b, devMat->baseIndex); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeEllDeviceFloat(void* deviceMat, float* val, int* ja, int ldj, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; // Ex updateFromHost function i = writeRemoteBuffer((void*) val, (void *)devMat->cM, devMat->allocsize*sizeof(float)); @@ -350,14 +327,10 @@ int writeEllDeviceFloat(void* deviceMat, float* val, int* ja, int ldj, int* irn, fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceFloat",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeEllDeviceDouble(void* deviceMat, double* val, int* ja, int ldj, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; // Ex updateFromHost function i = writeRemoteBuffer((void*) val, (void *)devMat->cM, devMat->allocsize*sizeof(double)); @@ -370,14 +343,10 @@ int writeEllDeviceDouble(void* deviceMat, double* val, int* ja, int ldj, int* ir fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceDouble",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeEllDeviceFloatComplex(void* deviceMat, float complex* val, int* ja, int ldj, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; // Ex updateFromHost function i = writeRemoteBuffer((void*) val, (void *)devMat->cM, devMat->allocsize*sizeof(cuFloatComplex)); @@ -390,14 +359,10 @@ int writeEllDeviceFloatComplex(void* deviceMat, float complex* val, int* ja, int fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeEllDeviceDoubleComplex(void* deviceMat, double complex* val, int* ja, int ldj, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; // Ex updateFromHost function i = writeRemoteBuffer((void*) val, (void *)devMat->cM, devMat->allocsize*sizeof(cuDoubleComplex)); @@ -410,14 +375,10 @@ int writeEllDeviceDoubleComplex(void* deviceMat, double complex* val, int* ja, i fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readEllDeviceFloat(void* deviceMat, float* val, int* ja, int ldj, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; i = readRemoteBuffer((void *) val, (void *)devMat->cM, devMat->allocsize*sizeof(float)); i = readRemoteBuffer((void *) ja, (void *)devMat->rP, devMat->allocsize*sizeof(int)); @@ -428,14 +389,10 @@ int readEllDeviceFloat(void* deviceMat, float* val, int* ja, int ldj, int* irn, fprintf(stderr,"From routine : %s : %d \n","readEllDeviceFloat",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readEllDeviceDouble(void* deviceMat, double* val, int* ja, int ldj, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; i = readRemoteBuffer((void *) val, (void *)devMat->cM, devMat->allocsize*sizeof(double)); i = readRemoteBuffer((void *) ja, (void *)devMat->rP, devMat->allocsize*sizeof(int)); @@ -445,14 +402,10 @@ int readEllDeviceDouble(void* deviceMat, double* val, int* ja, int ldj, int* irn fprintf(stderr,"From routine : %s : %d \n","readEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readEllDeviceFloatComplex(void* deviceMat, float complex* val, int* ja, int ldj, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; i = readRemoteBuffer((void *) val, (void *)devMat->cM, devMat->allocsize*sizeof(cuFloatComplex)); i = readRemoteBuffer((void *) ja, (void *)devMat->rP, devMat->allocsize*sizeof(int)); @@ -462,14 +415,10 @@ int readEllDeviceFloatComplex(void* deviceMat, float complex* val, int* ja, int fprintf(stderr,"From routine : %s : %d \n","readEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readEllDeviceDoubleComplex(void* deviceMat, double complex* val, int* ja, int ldj, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; i = readRemoteBuffer((void *) val, (void *)devMat->cM, devMat->allocsize*sizeof(cuDoubleComplex)); i = readRemoteBuffer((void *) ja, (void *)devMat->rP, devMat->allocsize*sizeof(int)); @@ -479,32 +428,21 @@ int readEllDeviceDoubleComplex(void* deviceMat, double complex* val, int* ja, in fprintf(stderr,"From routine : %s : %d \n","readEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int getEllDevicePitch(void* deviceMat) { int i; struct EllDevice *devMat = (struct EllDevice *) deviceMat; -#ifdef HAVE_SPGPU i = devMat->pitch; //old //i = getPitchEllDevice(deviceMat); return(i); -#else - return SPGPU_UNSUPPORTED; -#endif } int getEllDeviceMaxRowSize(void* deviceMat) { int i; struct EllDevice *devMat = (struct EllDevice *) deviceMat; -#ifdef HAVE_SPGPU i = devMat->maxRowSize; return(i); -#else - return SPGPU_UNSUPPORTED; -#endif } @@ -515,7 +453,6 @@ int getEllDeviceMaxRowSize(void* deviceMat) int psiCopyCooToElgFloat(int nr, int nc, int nza, int hacksz, int ldv, int nzm, int *irn, int *idisp, int *ja, float *val, void *deviceMat) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; float *devVal; int *devIdisp, *devJa; @@ -548,9 +485,6 @@ int psiCopyCooToElgFloat(int nr, int nc, int nza, int hacksz, int ldv, int nzm, fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceFloat",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } @@ -558,7 +492,6 @@ int psiCopyCooToElgFloat(int nr, int nc, int nza, int hacksz, int ldv, int nzm, int psiCopyCooToElgDouble(int nr, int nc, int nza, int hacksz, int ldv, int nzm, int *irn, int *idisp, int *ja, double *val, void *deviceMat) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; double *devVal; int *devIdisp, *devJa; @@ -591,16 +524,12 @@ int psiCopyCooToElgDouble(int nr, int nc, int nza, int hacksz, int ldv, int nzm, fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceDouble",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int psiCopyCooToElgFloatComplex(int nr, int nc, int nza, int hacksz, int ldv, int nzm, int *irn, int *idisp, int *ja, float complex *val, void *deviceMat) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; float complex *devVal; int *devIdisp, *devJa; @@ -633,9 +562,6 @@ int psiCopyCooToElgFloatComplex(int nr, int nc, int nza, int hacksz, int ldv, in fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceFloatComplex",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } @@ -643,7 +569,6 @@ int psiCopyCooToElgFloatComplex(int nr, int nc, int nza, int hacksz, int ldv, in int psiCopyCooToElgDoubleComplex(int nr, int nc, int nza, int hacksz, int ldv, int nzm, int *irn, int *idisp, int *ja, double complex *val, void *deviceMat) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; double complex *devVal; int *devIdisp, *devJa; @@ -676,15 +601,11 @@ int psiCopyCooToElgDoubleComplex(int nr, int nc, int nza, int hacksz, int ldv, i fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceDoubleComplex",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int dev_csputEllDeviceFloat(void* deviceMat, int nnz, void *ia, void *ja, void *val) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; struct MultiVectDevice *devVal = (struct MultiVectDevice *) val; struct MultiVectDevice *devIa = (struct MultiVectDevice *) ia; @@ -699,13 +620,11 @@ int dev_csputEllDeviceFloat(void* deviceMat, int nnz, void *ia, void *ja, void * devMat->rP,devMat->pitch, devMat->pitch, devMat->rS, nnz, devIa->v_, devJa->v_, (float *) devVal->v_, 1); -#endif return SPGPU_SUCCESS; } int dev_csputEllDeviceDouble(void* deviceMat, int nnz, void *ia, void *ja, void *val) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; struct MultiVectDevice *devVal = (struct MultiVectDevice *) val; struct MultiVectDevice *devIa = (struct MultiVectDevice *) ia; @@ -720,7 +639,6 @@ int dev_csputEllDeviceDouble(void* deviceMat, int nnz, void *ia, void *ja, void devMat->rP,devMat->pitch, devMat->pitch, devMat->rS, nnz, devIa->v_, devJa->v_, (double *) devVal->v_, 1); -#endif return SPGPU_SUCCESS; } @@ -728,7 +646,6 @@ int dev_csputEllDeviceDouble(void* deviceMat, int nnz, void *ia, void *ja, void int dev_csputEllDeviceFloatComplex(void* deviceMat, int nnz, void *ia, void *ja, void *val) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; struct MultiVectDevice *devVal = (struct MultiVectDevice *) val; struct MultiVectDevice *devIa = (struct MultiVectDevice *) ia; @@ -743,14 +660,12 @@ int dev_csputEllDeviceFloatComplex(void* deviceMat, int nnz, devMat->rP,devMat->pitch, devMat->pitch, devMat->rS, nnz, devIa->v_, devJa->v_, (cuFloatComplex *) devVal->v_, 1); -#endif return SPGPU_SUCCESS; } int dev_csputEllDeviceDoubleComplex(void* deviceMat, int nnz, void *ia, void *ja, void *val) { int i; -#ifdef HAVE_SPGPU struct EllDevice *devMat = (struct EllDevice *) deviceMat; struct MultiVectDevice *devVal = (struct MultiVectDevice *) val; struct MultiVectDevice *devIa = (struct MultiVectDevice *) ia; @@ -765,9 +680,7 @@ int dev_csputEllDeviceDoubleComplex(void* deviceMat, int nnz, devMat->rP,devMat->pitch, devMat->pitch, devMat->rS, nnz, devIa->v_, devJa->v_, (cuDoubleComplex *) devVal->v_, 1); -#endif return SPGPU_SUCCESS; } -#endif diff --git a/cuda/elldev.h b/cuda/elldev.h index 6a0814e2..c1001439 100644 --- a/cuda/elldev.h +++ b/cuda/elldev.h @@ -33,12 +33,10 @@ #ifndef _ELLDEV_H_ #define _ELLDEV_H_ -#if defined(HAVE_SPGPU) #include "cintrf.h" #include "cuComplex.h" #include "ell.h" - struct EllDevice { // Compressed matrix @@ -176,8 +174,4 @@ int getEllDevicePitch(void* deviceMat); //int spmvEllDeviceFloat(void *deviceMat, float* alpha, void* deviceX, float* beta, void* deviceY); //int spmvEllDeviceDouble(void *deviceMat, double* alpha, void* deviceX, double* beta, void* deviceY); -#else -#define CINTRF_UNSUPPORTED -1 -#endif - #endif diff --git a/cuda/elldev_mod.F90 b/cuda/elldev_mod.F90 index 49656d19..40cf8e49 100644 --- a/cuda/elldev_mod.F90 +++ b/cuda/elldev_mod.F90 @@ -44,8 +44,6 @@ module elldev_mod integer(c_int) :: firstIndex end type elldev_parms -#ifdef HAVE_SPGPU - interface function FgetEllDeviceParams(rows, maxRowSize, nnzeros, columns, elementType, firstIndex) & & result(res) bind(c,name='getEllDeviceParams') @@ -320,7 +318,4 @@ module elldev_mod end function spmvEllDeviceDoubleComplex end interface -#endif - - end module elldev_mod diff --git a/cuda/fcusparse.c b/cuda/fcusparse.c index 5f0c12d9..c1b661ab 100644 --- a/cuda/fcusparse.c +++ b/cuda/fcusparse.c @@ -33,7 +33,6 @@ #include #include -#ifdef HAVE_SPGPU #include #include "cintrf.h" #include "fcusparse.h" @@ -72,6 +71,3 @@ cusparseHandle_t *getHandle() return(cusparse_handle); } - - -#endif diff --git a/cuda/fcusparse.h b/cuda/fcusparse.h index 2bab2aca..7d2972f8 100644 --- a/cuda/fcusparse.h +++ b/cuda/fcusparse.h @@ -33,7 +33,6 @@ #ifndef FCUSPARSE_ #define FCUSPARSE_ -#ifdef HAVE_SPGPU #include #if CUDA_SHORT_VERSION <= 10 #include @@ -67,4 +66,3 @@ cusparseHandle_t *getHandle(); } #endif -#endif diff --git a/cuda/hdiagdev.c b/cuda/hdiagdev.c index dd5a23cd..6302eed1 100644 --- a/cuda/hdiagdev.c +++ b/cuda/hdiagdev.c @@ -34,10 +34,7 @@ #include #include #include -#if defined(HAVE_SPGPU) #define DEBUG 0 - - void freeHdiagDevice(void* remoteMatrix) { struct HdiagDevice *devMat = (struct HdiagDevice *) remoteMatrix; @@ -138,7 +135,6 @@ int FallocHdiagDevice(void** deviceMat, unsigned int rows, unsigned int cols, unsigned int allocationHeight, unsigned int hackSize, unsigned int hackCount, unsigned int elementType) { int i=0; -#ifdef HAVE_SPGPU HdiagDeviceParams p; p = getHdiagDeviceParams(rows, cols, allocationHeight, hackSize, hackCount,elementType); @@ -152,17 +148,12 @@ int FallocHdiagDevice(void** deviceMat, unsigned int rows, unsigned int cols, fprintf(stderr,"From routine : %s : %d \n","FallocEllDevice",i); } return(i); -#else - return SPGPU_UNSUPPORTED; -#endif - } int writeHdiagDeviceDouble(void* deviceMat, double* val, int* hdiaOffsets, int *hackOffsets) { int i=0,fo,fa,j,k,p; char buf_a[255], buf_o[255],tmp[255]; -#ifdef HAVE_SPGPU struct HdiagDevice *devMat = (struct HdiagDevice *) deviceMat; i=SPGPU_SUCCESS; @@ -216,9 +207,6 @@ int writeHdiagDeviceDouble(void* deviceMat, double* val, int* hdiaOffsets, int * return SPGPU_SUCCESS; else return SPGPU_UNSUPPORTED; -#else - return SPGPU_UNSUPPORTED; -#endif } @@ -227,15 +215,12 @@ long long int sizeofHdiagDeviceDouble(void* deviceMat) { int i=0,fo,fa; int *hoff=NULL,*hackoff=NULL; long long int memsize=0; -#ifdef HAVE_SPGPU struct HdiagDevice *devMat = (struct HdiagDevice *) deviceMat; memsize += (devMat->hackCount+1)*sizeof(int); memsize += devMat->allocationHeight*sizeof(int); memsize += devMat->allocationHeight*devMat->hackSize*sizeof(double); - -#endif return(memsize); } @@ -243,7 +228,6 @@ long long int sizeofHdiagDeviceDouble(void* deviceMat) int readHdiagDeviceDouble(void* deviceMat, double* a, int* off) { int i; -#ifdef HAVE_SPGPU struct HdiagDevice *devMat = (struct HdiagDevice *) deviceMat; /* i = readRemoteBuffer((void *) a, (void *)devMat->cM,devMat->rows*devMat->diags*sizeof(double)); */ /* i = readRemoteBuffer((void *) off, (void *)devMat->off, devMat->diags*sizeof(int)); */ @@ -253,9 +237,6 @@ int readHdiagDeviceDouble(void* deviceMat, double* a, int* off) fprintf(stderr,"From routine : %s : %d \n","readEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int spmvHdiagDeviceDouble(void *deviceMat, double alpha, void* deviceX, @@ -266,7 +247,6 @@ int spmvHdiagDeviceDouble(void *deviceMat, double alpha, void* deviceX, struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; spgpuHandle_t handle=psb_cudaGetHandle(); -#ifdef HAVE_SPGPU #ifdef VERBOSE /*__assert(x->count_ == x->count_, "ERROR: x and y don't share the same number of vectors");*/ /*__assert(x->size_ >= devMat->columns, "ERROR: x vector's size is not >= to matrix size (columns)");*/ @@ -285,15 +265,11 @@ int spmvHdiagDeviceDouble(void *deviceMat, double alpha, void* deviceX, //cudaSync(); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeHdiagDeviceFloat(void* deviceMat, float* val, int* hdiaOffsets, int *hackOffsets) { int i=0,fo,fa,j,k,p; char buf_a[255], buf_o[255],tmp[255]; -#ifdef HAVE_SPGPU struct HdiagDevice *devMat = (struct HdiagDevice *) deviceMat; i=SPGPU_SUCCESS; @@ -347,9 +323,6 @@ int writeHdiagDeviceFloat(void* deviceMat, float* val, int* hdiaOffsets, int *ha return SPGPU_SUCCESS; else return SPGPU_UNSUPPORTED; -#else - return SPGPU_UNSUPPORTED; -#endif } @@ -358,7 +331,6 @@ long long int sizeofHdiagDeviceFloat(void* deviceMat) { int i=0,fo,fa; int *hoff=NULL,*hackoff=NULL; long long int memsize=0; -#ifdef HAVE_SPGPU struct HdiagDevice *devMat = (struct HdiagDevice *) deviceMat; @@ -366,7 +338,6 @@ long long int sizeofHdiagDeviceFloat(void* deviceMat) memsize += devMat->allocationHeight*sizeof(int); memsize += devMat->allocationHeight*devMat->hackSize*sizeof(float); -#endif return(memsize); } @@ -374,7 +345,6 @@ long long int sizeofHdiagDeviceFloat(void* deviceMat) int readHdiagDeviceFloat(void* deviceMat, float* a, int* off) { int i; -#ifdef HAVE_SPGPU struct HdiagDevice *devMat = (struct HdiagDevice *) deviceMat; /* i = readRemoteBuffer((void *) a, (void *)devMat->cM,devMat->rows*devMat->diags*sizeof(float)); */ /* i = readRemoteBuffer((void *) off, (void *)devMat->off, devMat->diags*sizeof(int)); */ @@ -384,9 +354,6 @@ int readHdiagDeviceFloat(void* deviceMat, float* a, int* off) fprintf(stderr,"From routine : %s : %d \n","readEllDeviceFloat",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int spmvHdiagDeviceFloat(void *deviceMat, float alpha, void* deviceX, @@ -397,7 +364,6 @@ int spmvHdiagDeviceFloat(void *deviceMat, float alpha, void* deviceX, struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; spgpuHandle_t handle=psb_cudaGetHandle(); -#ifdef HAVE_SPGPU #ifdef VERBOSE /*__assert(x->count_ == x->count_, "ERROR: x and y don't share the same number of vectors");*/ /*__assert(x->size_ >= devMat->columns, "ERROR: x vector's size is not >= to matrix size (columns)");*/ @@ -416,10 +382,5 @@ int spmvHdiagDeviceFloat(void *deviceMat, float alpha, void* deviceX, //cudaSync(); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } - -#endif diff --git a/cuda/hdiagdev.h b/cuda/hdiagdev.h index 4bce5066..5cd9f803 100644 --- a/cuda/hdiagdev.h +++ b/cuda/hdiagdev.h @@ -32,7 +32,6 @@ #ifndef _HDIAGDEV_H_ #define _HDIAGDEV_H_ -#ifdef HAVE_SPGPU #include "cintrf.h" #include "hdia.h" @@ -104,8 +103,4 @@ int spmvHdiagDeviceDouble(void *deviceMat, double alpha, void* deviceX, double beta, void* deviceY); -#else -#define CINTRF_UNSUPPORTED -1 -#endif - #endif diff --git a/cuda/hdiagdev_mod.F90 b/cuda/hdiagdev_mod.F90 index ad0f7cc5..9a3530e7 100644 --- a/cuda/hdiagdev_mod.F90 +++ b/cuda/hdiagdev_mod.F90 @@ -43,8 +43,6 @@ module hdiagdev_mod integer(c_int) :: allocationHeight end type hdiagdev_parms -#ifdef HAVE_SPGPU - ! interface computeHdiaHacksCount ! function computeHdiaHacksCountDouble(allocationHeight,hackOffsets,hackSize, & ! & diaValues,diaValuesPitch,diags,rows)& @@ -197,7 +195,5 @@ module hdiagdev_mod !!$ complex(c_double_complex),value :: alpha, beta !!$ end function spmvHdiagDeviceDoubleComplex end interface spmvHdiagDevice - -#endif end module hdiagdev_mod diff --git a/cuda/hlldev.c b/cuda/hlldev.c index 42f396dd..9da6a48c 100644 --- a/cuda/hlldev.c +++ b/cuda/hlldev.c @@ -30,7 +30,6 @@ #include "hlldev.h" -#if defined(HAVE_SPGPU) //new HllDeviceParams bldHllDeviceParams(unsigned int hksize, unsigned int rows, unsigned int nzeros, unsigned int allocsize, unsigned int elementType, unsigned int firstIndex) @@ -147,7 +146,6 @@ int FallocHllDevice(void** deviceMat,unsigned int hksize, unsigned int rows, un unsigned int allocsize, unsigned int elementType, unsigned int firstIndex) { int i; -#ifdef HAVE_SPGPU HllDeviceParams p; p = bldHllDeviceParams(hksize, rows, nzeros, allocsize, elementType, firstIndex); @@ -156,9 +154,6 @@ int FallocHllDevice(void** deviceMat,unsigned int hksize, unsigned int rows, un fprintf(stderr,"From routine : %s : %d \n","FallocEllDevice",i); } return(i); -#else - return SPGPU_UNSUPPORTED; -#endif } @@ -170,7 +165,6 @@ int spmvHllDeviceFloat(void *deviceMat, float alpha, void* deviceX, struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; spgpuHandle_t handle=psb_cudaGetHandle(); -#ifdef HAVE_SPGPU #ifdef VERBOSE /*__assert(x->count_ == x->count_, "ERROR: x and y don't share the same number of vectors");*/ /*__assert(x->size_ >= devMat->columns, "ERROR: x vector's size is not >= to matrix size (columns)");*/ @@ -185,9 +179,6 @@ int spmvHllDeviceFloat(void *deviceMat, float alpha, void* deviceX, devMat->avgNzr, devMat->rows, (float *)x->v_, beta, devMat->baseIndex); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } //new @@ -199,7 +190,6 @@ int spmvHllDeviceDouble(void *deviceMat, double alpha, void* deviceX, struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; spgpuHandle_t handle=psb_cudaGetHandle(); -#ifdef HAVE_SPGPU #ifdef VERBOSE /*__assert(x->count_ == x->count_, "ERROR: x and y don't share the same number of vectors");*/ /*__assert(x->size_ >= devMat->columns, "ERROR: x vector's size is not >= to matrix size (columns)");*/ @@ -214,9 +204,6 @@ int spmvHllDeviceDouble(void *deviceMat, double alpha, void* deviceX, devMat->avgNzr, devMat->rows, (double *)x->v_, beta, devMat->baseIndex); //cudaSync(); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int spmvHllDeviceFloatComplex(void *deviceMat, float complex alpha, void* deviceX, @@ -227,7 +214,6 @@ int spmvHllDeviceFloatComplex(void *deviceMat, float complex alpha, void* device struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; spgpuHandle_t handle=psb_cudaGetHandle(); -#ifdef HAVE_SPGPU cuFloatComplex a = make_cuFloatComplex(crealf(alpha),cimagf(alpha)); cuFloatComplex b = make_cuFloatComplex(crealf(beta),cimagf(beta)); #ifdef VERBOSE @@ -244,9 +230,6 @@ int spmvHllDeviceFloatComplex(void *deviceMat, float complex alpha, void* device devMat->avgNzr, devMat->rows, (cuFloatComplex *)x->v_, b, devMat->baseIndex); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int spmvHllDeviceDoubleComplex(void *deviceMat, double complex alpha, void* deviceX, @@ -257,7 +240,6 @@ int spmvHllDeviceDoubleComplex(void *deviceMat, double complex alpha, void* devi struct MultiVectDevice *y = (struct MultiVectDevice *) deviceY; spgpuHandle_t handle=psb_cudaGetHandle(); -#ifdef HAVE_SPGPU cuDoubleComplex a = make_cuDoubleComplex(creal(alpha),cimag(alpha)); cuDoubleComplex b = make_cuDoubleComplex(creal(beta),cimag(beta)); #ifdef VERBOSE @@ -271,14 +253,10 @@ int spmvHllDeviceDoubleComplex(void *deviceMat, double complex alpha, void* devi devMat->avgNzr,devMat->rows, (cuDoubleComplex *)x->v_, b, devMat->baseIndex); return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeHllDeviceFloat(void* deviceMat, float* val, int* ja, int *hkoffs, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU HllDevice *devMat = (HllDevice *) deviceMat; // Ex updateFromHost function i = writeRemoteBuffer((void*) val, (void *)devMat->cM, devMat->allocsize*sizeof(float)); @@ -291,14 +269,10 @@ int writeHllDeviceFloat(void* deviceMat, float* val, int* ja, int *hkoffs, int* fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceFloat",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeHllDeviceDouble(void* deviceMat, double* val, int* ja, int *hkoffs, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU HllDevice *devMat = (HllDevice *) deviceMat; // Ex updateFromHost function i = writeRemoteBuffer((void*) val, (void *)devMat->cM, devMat->allocsize*sizeof(double)); @@ -311,14 +285,10 @@ int writeHllDeviceDouble(void* deviceMat, double* val, int* ja, int *hkoffs, int fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeHllDeviceFloatComplex(void* deviceMat, float complex* val, int* ja, int *hkoffs, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU HllDevice *devMat = (HllDevice *) deviceMat; // Ex updateFromHost function i = writeRemoteBuffer((void*) val, (void *)devMat->cM, devMat->allocsize*sizeof(cuFloatComplex)); @@ -331,14 +301,10 @@ int writeHllDeviceFloatComplex(void* deviceMat, float complex* val, int* ja, int fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int writeHllDeviceDoubleComplex(void* deviceMat, double complex* val, int* ja, int *hkoffs, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU HllDevice *devMat = (HllDevice *) deviceMat; // Ex updateFromHost function i = writeRemoteBuffer((void*) val, (void *)devMat->cM, devMat->allocsize*sizeof(cuDoubleComplex)); @@ -351,14 +317,10 @@ int writeHllDeviceDoubleComplex(void* deviceMat, double complex* val, int* ja, i fprintf(stderr,"From routine : %s : %d \n","writeEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readHllDeviceFloat(void* deviceMat, float* val, int* ja, int *hkoffs, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU HllDevice *devMat = (HllDevice *) deviceMat; i = readRemoteBuffer((void *) val, (void *)devMat->cM, devMat->allocsize*sizeof(float)); i = readRemoteBuffer((void *) ja, (void *)devMat->rP, devMat->allocsize*sizeof(int)); @@ -370,14 +332,10 @@ int readHllDeviceFloat(void* deviceMat, float* val, int* ja, int *hkoffs, int* i fprintf(stderr,"From routine : %s : %d \n","readEllDeviceFloat",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readHllDeviceDouble(void* deviceMat, double* val, int* ja, int *hkoffs, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU HllDevice *devMat = (HllDevice *) deviceMat; i = readRemoteBuffer((void *) val, (void *)devMat->cM, devMat->allocsize*sizeof(double)); i = readRemoteBuffer((void *) ja, (void *)devMat->rP, devMat->allocsize*sizeof(int)); @@ -388,14 +346,10 @@ int readHllDeviceDouble(void* deviceMat, double* val, int* ja, int *hkoffs, int* fprintf(stderr,"From routine : %s : %d \n","readEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readHllDeviceFloatComplex(void* deviceMat, float complex* val, int* ja, int *hkoffs, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU HllDevice *devMat = (HllDevice *) deviceMat; i = readRemoteBuffer((void *) val, (void *)devMat->cM, devMat->allocsize*sizeof(cuFloatComplex)); i = readRemoteBuffer((void *) ja, (void *)devMat->rP, devMat->allocsize*sizeof(int)); @@ -406,14 +360,10 @@ int readHllDeviceFloatComplex(void* deviceMat, float complex* val, int* ja, int fprintf(stderr,"From routine : %s : %d \n","readEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int readHllDeviceDoubleComplex(void* deviceMat, double complex* val, int* ja, int *hkoffs, int* irn, int *idiag) { int i; -#ifdef HAVE_SPGPU HllDevice *devMat = (HllDevice *) deviceMat; i = readRemoteBuffer((void *) val, (void *)devMat->cM, devMat->allocsize*sizeof(cuDoubleComplex)); i = readRemoteBuffer((void *) ja, (void *)devMat->rP, devMat->allocsize*sizeof(int)); @@ -424,9 +374,6 @@ int readHllDeviceDoubleComplex(void* deviceMat, double complex* val, int* ja, in fprintf(stderr,"From routine : %s : %d \n","readEllDeviceDouble",i); }*/ return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } // New copy routines. @@ -435,7 +382,6 @@ int psiCopyCooToHlgFloat(int nr, int nc, int nza, int hacksz, int noffs, int isz int *irn, int *hoffs, int *idisp, int *ja, float *val, void *deviceMat) { int i,j; -#ifdef HAVE_SPGPU spgpuHandle_t handle; HllDevice *devMat = (HllDevice *) deviceMat; float *devVal; @@ -469,16 +415,12 @@ int psiCopyCooToHlgFloat(int nr, int nc, int nza, int hacksz, int noffs, int isz fprintf(stderr,"From routine : %s : %d \n","writeHllDeviceFloat",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int psiCopyCooToHlgDouble(int nr, int nc, int nza, int hacksz, int noffs, int isz, int *irn, int *hoffs, int *idisp, int *ja, double *val, void *deviceMat) { int i,j; -#ifdef HAVE_SPGPU spgpuHandle_t handle; HllDevice *devMat = (HllDevice *) deviceMat; double *devVal; @@ -517,16 +459,12 @@ int psiCopyCooToHlgDouble(int nr, int nc, int nza, int hacksz, int noffs, int is fprintf(stderr,"From routine : %s : %d \n","writeHllDeviceDouble",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int psiCopyCooToHlgFloatComplex(int nr, int nc, int nza, int hacksz, int noffs, int isz, int *irn, int *hoffs, int *idisp, int *ja, float complex *val, void *deviceMat) { int i,j; -#ifdef HAVE_SPGPU spgpuHandle_t handle; HllDevice *devMat = (HllDevice *) deviceMat; float complex *devVal; @@ -560,16 +498,12 @@ int psiCopyCooToHlgFloatComplex(int nr, int nc, int nza, int hacksz, int noffs, fprintf(stderr,"From routine : %s : %d \n","writeHllDeviceFloatComplex",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } int psiCopyCooToHlgDoubleComplex(int nr, int nc, int nza, int hacksz, int noffs, int isz, int *irn, int *hoffs, int *idisp, int *ja, double complex *val, void *deviceMat) { int i,j; -#ifdef HAVE_SPGPU spgpuHandle_t handle; HllDevice *devMat = (HllDevice *) deviceMat; double complex *devVal; @@ -603,13 +537,4 @@ int psiCopyCooToHlgDoubleComplex(int nr, int nc, int nza, int hacksz, int noffs, fprintf(stderr,"From routine : %s : %d \n","writeHllDeviceDoubleComplex",i); } return SPGPU_SUCCESS; -#else - return SPGPU_UNSUPPORTED; -#endif } - - - - - -#endif diff --git a/cuda/hlldev.h b/cuda/hlldev.h index 478ad86e..e4f8259e 100644 --- a/cuda/hlldev.h +++ b/cuda/hlldev.h @@ -32,7 +32,6 @@ #ifndef _HLLDEV_H_ #define _HLLDEV_H_ -#ifdef HAVE_SPGPU #include "cintrf.h" #include "hell.h" @@ -154,8 +153,4 @@ int psi_cuda_z_CopyCooToHlg(spgpuHandle_t handle,int nr, int nc, int nza, int *idiag, int *rP, double complex *cM); -#else -#define CINTRF_UNSUPPORTED -1 -#endif - #endif diff --git a/cuda/hlldev_mod.F90 b/cuda/hlldev_mod.F90 index 4eaa5ce0..90b8e13c 100644 --- a/cuda/hlldev_mod.F90 +++ b/cuda/hlldev_mod.F90 @@ -43,8 +43,6 @@ module hlldev_mod integer(c_int) :: firstIndex end type hlldev_parms -#ifdef HAVE_SPGPU - interface function bldHllDeviceParams(hksize, rows, nzeros, allocsize, elementType, firstIndex) & & result(res) bind(c,name='bldHllDeviceParams') @@ -267,7 +265,4 @@ module hlldev_mod end interface -#endif - - end module hlldev_mod diff --git a/cuda/impl/psb_c_cuda_cp_csrg_from_coo.F90 b/cuda/impl/psb_c_cuda_cp_csrg_from_coo.F90 index af3301ff..aa6a3ba3 100644 --- a/cuda/impl/psb_c_cuda_cp_csrg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_cp_csrg_from_coo.F90 @@ -32,12 +32,8 @@ subroutine psb_c_cuda_cp_csrg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_cp_csrg_from_coo -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none class(psb_c_cuda_csrg_sparse_mat), intent(inout) :: a @@ -48,10 +44,8 @@ subroutine psb_c_cuda_cp_csrg_from_coo(a,b,info) call a%psb_c_csr_sparse_mat%cp_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_c_cuda_cp_csrg_from_fmt.F90 b/cuda/impl/psb_c_cuda_cp_csrg_from_fmt.F90 index 47845e52..65b12a11 100644 --- a/cuda/impl/psb_c_cuda_cp_csrg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_cp_csrg_from_fmt.F90 @@ -32,12 +32,8 @@ subroutine psb_c_cuda_cp_csrg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_cp_csrg_from_fmt -#else - use psb_c_cuda_csrg_mat_mod -#endif !use iso_c_binding implicit none @@ -53,9 +49,7 @@ subroutine psb_c_cuda_cp_csrg_from_fmt(a,b,info) class default call a%psb_c_csr_sparse_mat%cp_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_c_cuda_cp_csrg_from_fmt diff --git a/cuda/impl/psb_c_cuda_cp_diag_from_coo.F90 b/cuda/impl/psb_c_cuda_cp_diag_from_coo.F90 index 5b1eb817..e70a044e 100644 --- a/cuda/impl/psb_c_cuda_cp_diag_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_cp_diag_from_coo.F90 @@ -33,13 +33,9 @@ subroutine psb_c_cuda_cp_diag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_c_cuda_diag_mat_mod, psb_protect_name => psb_c_cuda_cp_diag_from_coo -#else - use psb_c_cuda_diag_mat_mod -#endif implicit none class(psb_c_cuda_diag_sparse_mat), intent(inout) :: a @@ -50,10 +46,8 @@ subroutine psb_c_cuda_cp_diag_from_coo(a,b,info) info = psb_success_ call a%psb_c_dia_sparse_mat%cp_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_c_cuda_cp_elg_from_coo.F90 b/cuda/impl/psb_c_cuda_cp_elg_from_coo.F90 index fedffa22..c6105e88 100644 --- a/cuda/impl/psb_c_cuda_cp_elg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_cp_elg_from_coo.F90 @@ -28,20 +28,14 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_c_cuda_cp_elg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_cp_elg_from_coo use psi_ext_util_mod use psb_cuda_env_mod -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a @@ -57,16 +51,11 @@ subroutine psb_c_cuda_cp_elg_from_coo(a,b,info) integer(psb_ipk_), allocatable :: idisp(:) info = psb_success_ -#ifdef HAVE_SPGPU hacksize = max(1,psb_cuda_WarpSize()) -#else - hacksize = 1 -#endif if (b%is_dev()) call b%sync() if (b%is_by_rows()) then -#ifdef HAVE_SPGPU call psi_c_count_ell_from_coo(a,b,idisp,ldv,nzm,info,hacksize=hacksize) @@ -82,15 +71,8 @@ subroutine psb_c_cuda_cp_elg_from_coo(a,b,info) if (info == 0) info = psi_CopyCooToElg(nr,nc,nza, hacksize,ldv,nzm, & & a%irn,idisp,b%ja,b%val, a%deviceMat) call a%set_dev() -#else - - call psi_c_convert_ell_from_coo(a,b,info,hacksize=hacksize) - call a%set_host() -#endif - else call b%cp_to_coo(tmp,info) -#ifdef HAVE_SPGPU call psi_c_count_ell_from_coo(a,tmp,idisp,ldv,nzm,info,hacksize=hacksize) @@ -107,11 +89,6 @@ subroutine psb_c_cuda_cp_elg_from_coo(a,b,info) & a%irn,idisp,tmp%ja,tmp%val, a%deviceMat) call a%set_dev() -#else - - call psi_c_convert_ell_from_coo(a,tmp,info,hacksize=hacksize) - call a%set_host() -#endif end if if (info /= psb_success_) goto 9999 diff --git a/cuda/impl/psb_c_cuda_cp_elg_from_fmt.F90 b/cuda/impl/psb_c_cuda_cp_elg_from_fmt.F90 index 4c44d29a..f7e5351e 100644 --- a/cuda/impl/psb_c_cuda_cp_elg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_cp_elg_from_fmt.F90 @@ -33,13 +33,9 @@ subroutine psb_c_cuda_cp_elg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_cp_elg_from_fmt -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a @@ -51,9 +47,7 @@ subroutine psb_c_cuda_cp_elg_from_fmt(a,b,info) Integer(Psb_ipk_) :: nza, nr, i,j,irw, idl,err_act, nc, ld, nzm, m integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = psb_success_ if (b%is_dev()) call b%sync() @@ -67,13 +61,9 @@ subroutine psb_c_cuda_cp_elg_from_fmt(a,b,info) m = b%get_nrows() nc = b%get_ncols() nza = b%get_nzeros() -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) ld = gpu_parms%pitch nzm = gpu_parms%maxRowSize -#else - ld = m -#endif a%psb_c_base_sparse_mat = b%psb_c_base_sparse_mat if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -88,9 +78,7 @@ subroutine psb_c_cuda_cp_elg_from_fmt(a,b,info) a%val(1:m,1:nzm) = b%val(1:m,1:nzm) end if a%nzt = nza -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif class default diff --git a/cuda/impl/psb_c_cuda_cp_hdiag_from_coo.F90 b/cuda/impl/psb_c_cuda_cp_hdiag_from_coo.F90 index 436eabaa..9be741c9 100644 --- a/cuda/impl/psb_c_cuda_cp_hdiag_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_cp_hdiag_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_c_cuda_cp_hdiag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_c_cuda_hdiag_mat_mod, psb_protect_name => psb_c_cuda_cp_hdiag_from_coo use psb_cuda_env_mod -#else - use psb_c_cuda_hdiag_mat_mod -#endif implicit none class(psb_c_cuda_hdiag_sparse_mat), intent(inout) :: a @@ -53,16 +47,12 @@ subroutine psb_c_cuda_cp_hdiag_from_coo(a,b,info) info = psb_success_ -#ifdef HAVE_SPGPU a%hacksize = psb_cuda_WarpSize() -#endif call a%psb_c_hdia_sparse_mat%cp_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_c_cuda_cp_hlg_from_coo.F90 b/cuda/impl/psb_c_cuda_cp_hlg_from_coo.F90 index d30fccbf..8b0d9f2a 100644 --- a/cuda/impl/psb_c_cuda_cp_hlg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_cp_hlg_from_coo.F90 @@ -33,14 +33,10 @@ subroutine psb_c_cuda_cp_hlg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_cuda_env_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_cp_hlg_from_coo -#else - use psb_c_cuda_hlg_mat_mod -#endif implicit none class(psb_c_cuda_hlg_sparse_mat), intent(inout) :: a @@ -61,11 +57,7 @@ subroutine psb_c_cuda_cp_hlg_from_coo(a,b,info) info = psb_success_ debug_unit = psb_get_debug_unit() debug_level = psb_get_debug_level() -#ifdef HAVE_SPGPU hksz = max(1,psb_cuda_WarpSize()) -#else - hksz = psi_get_hksz() -#endif if (b%is_by_rows()) then diff --git a/cuda/impl/psb_c_cuda_cp_hlg_from_fmt.F90 b/cuda/impl/psb_c_cuda_cp_hlg_from_fmt.F90 index 259364cd..96a5c5e8 100644 --- a/cuda/impl/psb_c_cuda_cp_hlg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_cp_hlg_from_fmt.F90 @@ -33,13 +33,9 @@ subroutine psb_c_cuda_cp_hlg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_cp_hlg_from_fmt -#else - use psb_c_cuda_hlg_mat_mod -#endif implicit none class(psb_c_cuda_hlg_sparse_mat), intent(inout) :: a @@ -53,9 +49,7 @@ subroutine psb_c_cuda_cp_hlg_from_fmt(a,b,info) call a%cp_from_coo(b,info) class default call a%psb_c_hll_sparse_mat%cp_from_fmt(b,info) -#ifdef HAVE_SPGPU if (info == 0) call a%to_gpu(info) -#endif end select if (info /= 0) goto 9999 diff --git a/cuda/impl/psb_c_cuda_cp_hybg_from_coo.F90 b/cuda/impl/psb_c_cuda_cp_hybg_from_coo.F90 index 7ebb5240..d29da0b7 100644 --- a/cuda/impl/psb_c_cuda_cp_hybg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_cp_hybg_from_coo.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_cp_hybg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_cp_hybg_from_coo -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none class(psb_c_cuda_hybg_sparse_mat), intent(inout) :: a @@ -49,10 +45,8 @@ subroutine psb_c_cuda_cp_hybg_from_coo(a,b,info) call a%psb_c_csr_sparse_mat%cp_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_c_cuda_cp_hybg_from_fmt.F90 b/cuda/impl/psb_c_cuda_cp_hybg_from_fmt.F90 index 033ba966..9ed53040 100644 --- a/cuda/impl/psb_c_cuda_cp_hybg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_cp_hybg_from_fmt.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_cp_hybg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_cp_hybg_from_fmt -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none class(psb_c_cuda_hybg_sparse_mat), intent(inout) :: a @@ -53,9 +49,7 @@ subroutine psb_c_cuda_cp_hybg_from_fmt(a,b,info) class default call a%psb_c_csr_sparse_mat%cp_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_c_cuda_cp_hybg_from_fmt diff --git a/cuda/impl/psb_c_cuda_csrg_allocate_mnnz.F90 b/cuda/impl/psb_c_cuda_csrg_allocate_mnnz.F90 index d9736d23..f1e002f3 100644 --- a/cuda/impl/psb_c_cuda_csrg_allocate_mnnz.F90 +++ b/cuda/impl/psb_c_cuda_csrg_allocate_mnnz.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_csrg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_allocate_mnnz -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_c_cuda_csrg_sparse_mat), intent(inout) :: a @@ -52,11 +48,9 @@ subroutine psb_c_cuda_csrg_allocate_mnnz(m,n,a,nz) call a%psb_c_csr_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU info = initFcusparse() if (info == 0) call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_csrg_csmm.F90 b/cuda/impl/psb_c_cuda_csrg_csmm.F90 index 8f2f55b9..b3012952 100644 --- a/cuda/impl/psb_c_cuda_csrg_csmm.F90 +++ b/cuda/impl/psb_c_cuda_csrg_csmm.F90 @@ -33,14 +33,10 @@ subroutine psb_c_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_csmm -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none class(psb_c_cuda_csrg_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:,:) @@ -94,7 +90,6 @@ subroutine psb_c_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -119,9 +114,6 @@ subroutine psb_c_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_csrg_csmv.F90 b/cuda/impl/psb_c_cuda_csrg_csmv.F90 index ba681401..ae90cb7e 100644 --- a/cuda/impl/psb_c_cuda_csrg_csmv.F90 +++ b/cuda/impl/psb_c_cuda_csrg_csmv.F90 @@ -33,14 +33,10 @@ subroutine psb_c_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_csmv -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none class(psb_c_cuda_csrg_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -96,7 +92,6 @@ subroutine psb_c_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -124,9 +119,6 @@ subroutine psb_c_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_csrg_from_gpu.F90 b/cuda/impl/psb_c_cuda_csrg_from_gpu.F90 index b1bed7e5..503bc57e 100644 --- a/cuda/impl/psb_c_cuda_csrg_from_gpu.F90 +++ b/cuda/impl/psb_c_cuda_csrg_from_gpu.F90 @@ -33,13 +33,9 @@ subroutine psb_c_cuda_csrg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_from_gpu -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none class(psb_c_cuda_csrg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +44,6 @@ subroutine psb_c_cuda_csrg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (.not.(c_associated(a%deviceMat%mat))) then call a%free() return @@ -68,6 +63,5 @@ subroutine psb_c_cuda_csrg_from_gpu(a,info) #endif call a%set_sync() -#endif end subroutine psb_c_cuda_csrg_from_gpu diff --git a/cuda/impl/psb_c_cuda_csrg_inner_vect_sv.F90 b/cuda/impl/psb_c_cuda_csrg_inner_vect_sv.F90 index 32dec5ef..7e5bb614 100644 --- a/cuda/impl/psb_c_cuda_csrg_inner_vect_sv.F90 +++ b/cuda/impl/psb_c_cuda_csrg_inner_vect_sv.F90 @@ -32,13 +32,9 @@ subroutine psb_c_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_inner_vect_sv -#else - use psb_c_cuda_csrg_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_csrg_sparse_mat), intent(in) :: a @@ -75,7 +71,6 @@ subroutine psb_c_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra.or.(beta/=dzero)) then call x%sync() call y%sync() @@ -112,12 +107,6 @@ subroutine psb_c_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call x%sync() - call y%sync() - call a%psb_c_csr_sparse_mat%inner_spsm(alpha,x,beta,y,info,trans) - call y%set_host() -#endif if (info /= psb_success_) then info = psb_err_from_subroutine_ call psb_errpush(info,name, a_err='csrg_vect_sv') diff --git a/cuda/impl/psb_c_cuda_csrg_reallocate_nz.F90 b/cuda/impl/psb_c_cuda_csrg_reallocate_nz.F90 index 22f9f118..a757f477 100644 --- a/cuda/impl/psb_c_cuda_csrg_reallocate_nz.F90 +++ b/cuda/impl/psb_c_cuda_csrg_reallocate_nz.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_csrg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_reallocate_nz -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_c_cuda_csrg_sparse_mat), intent(inout) :: a @@ -55,10 +51,8 @@ subroutine psb_c_cuda_csrg_reallocate_nz(nz,a) ! call a%psb_c_csr_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_csrg_scal.F90 b/cuda/impl/psb_c_cuda_csrg_scal.F90 index 556a0ec5..13716339 100644 --- a/cuda/impl/psb_c_cuda_csrg_scal.F90 +++ b/cuda/impl/psb_c_cuda_csrg_scal.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_csrg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_scal -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none class(psb_c_cuda_csrg_sparse_mat), intent(inout) :: a complex(psb_spk_), intent(in) :: d(:) @@ -58,10 +54,8 @@ subroutine psb_c_cuda_csrg_scal(d,a,info,side) call a%psb_c_csr_sparse_mat%scal(d,info,side=side) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_csrg_scals.F90 b/cuda/impl/psb_c_cuda_csrg_scals.F90 index a67e91cd..5334be3d 100644 --- a/cuda/impl/psb_c_cuda_csrg_scals.F90 +++ b/cuda/impl/psb_c_cuda_csrg_scals.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_csrg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_scals -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none class(psb_c_cuda_csrg_sparse_mat), intent(inout) :: a complex(psb_spk_), intent(in) :: d @@ -56,10 +52,8 @@ subroutine psb_c_cuda_csrg_scals(d,a,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_csrg_to_gpu.F90 b/cuda/impl/psb_c_cuda_csrg_to_gpu.F90 index ea710cbc..aebb07e4 100644 --- a/cuda/impl/psb_c_cuda_csrg_to_gpu.F90 +++ b/cuda/impl/psb_c_cuda_csrg_to_gpu.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_csrg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_to_gpu -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none class(psb_c_cuda_csrg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -51,7 +47,6 @@ subroutine psb_c_cuda_csrg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -320,6 +315,5 @@ subroutine psb_c_cuda_csrg_to_gpu(a,info,nzrm) if (info /= 0) then write(0,*) 'Error in CSRG_TO_GPU ',info end if -#endif end subroutine psb_c_cuda_csrg_to_gpu diff --git a/cuda/impl/psb_c_cuda_csrg_vect_mv.F90 b/cuda/impl/psb_c_cuda_csrg_vect_mv.F90 index cb556d20..c58e7ec0 100644 --- a/cuda/impl/psb_c_cuda_csrg_vect_mv.F90 +++ b/cuda/impl/psb_c_cuda_csrg_vect_mv.F90 @@ -33,14 +33,10 @@ subroutine psb_c_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_csrg_vect_mv -#else - use psb_c_cuda_csrg_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_csrg_sparse_mat), intent(in) :: a @@ -72,7 +68,6 @@ subroutine psb_c_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= czero) then @@ -112,9 +107,6 @@ subroutine psb_c_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_diag_csmv.F90 b/cuda/impl/psb_c_cuda_diag_csmv.F90 index 00ab742d..c0940903 100644 --- a/cuda/impl/psb_c_cuda_diag_csmv.F90 +++ b/cuda/impl/psb_c_cuda_diag_csmv.F90 @@ -33,13 +33,9 @@ subroutine psb_c_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_c_cuda_diag_mat_mod, psb_protect_name => psb_c_cuda_diag_csmv -#else - use psb_c_cuda_diag_mat_mod -#endif implicit none class(psb_c_cuda_diag_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +90,6 @@ subroutine psb_c_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_c_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +116,6 @@ subroutine psb_c_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -132,5 +124,4 @@ subroutine psb_c_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) return - end subroutine psb_c_cuda_diag_csmv diff --git a/cuda/impl/psb_c_cuda_diag_to_gpu.F90 b/cuda/impl/psb_c_cuda_diag_to_gpu.F90 index 4f2c21d9..88bbd8b5 100644 --- a/cuda/impl/psb_c_cuda_diag_to_gpu.F90 +++ b/cuda/impl/psb_c_cuda_diag_to_gpu.F90 @@ -33,13 +33,9 @@ subroutine psb_c_cuda_diag_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_c_cuda_diag_mat_mod, psb_protect_name => psb_c_cuda_diag_to_gpu -#else - use psb_c_cuda_diag_mat_mod -#endif use iso_c_binding implicit none class(psb_c_cuda_diag_sparse_mat), intent(inout) :: a @@ -47,13 +43,10 @@ subroutine psb_c_cuda_diag_to_gpu(a,info,nzrm) integer(psb_ipk_), intent(in), optional :: nzrm integer(psb_ipk_) :: m, nzm, n, c,pitch,maxrowsize,d -#ifdef HAVE_SPGPU type(diagdev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%data)).or.(.not.allocated(a%offset))) return n = size(a%data,1) @@ -69,6 +62,5 @@ subroutine psb_c_cuda_diag_to_gpu(a,info,nzrm) if (info == 0) info = & & writeDiagDevice(a%deviceMat,a%data,a%offset,n) ! if (info /= 0) goto 9999 -#endif end subroutine psb_c_cuda_diag_to_gpu diff --git a/cuda/impl/psb_c_cuda_diag_vect_mv.F90 b/cuda/impl/psb_c_cuda_diag_vect_mv.F90 index 02bb9587..fba22bc5 100644 --- a/cuda/impl/psb_c_cuda_diag_vect_mv.F90 +++ b/cuda/impl/psb_c_cuda_diag_vect_mv.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_c_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_c_cuda_diag_mat_mod, psb_protect_name => psb_c_cuda_diag_vect_mv -#else - use psb_c_cuda_diag_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_diag_sparse_mat), intent(in) :: a @@ -71,7 +65,6 @@ subroutine psb_c_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= szero) then @@ -112,9 +105,6 @@ subroutine psb_c_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_c_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_dnsg_mat_impl.F90 b/cuda/impl/psb_c_cuda_dnsg_mat_impl.F90 index bb2ec97b..7aaa37f1 100644 --- a/cuda/impl/psb_c_cuda_dnsg_mat_impl.F90 +++ b/cuda/impl/psb_c_cuda_dnsg_mat_impl.F90 @@ -32,13 +32,9 @@ subroutine psb_c_cuda_dnsg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod use psb_c_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_c_vectordev_mod use psb_c_cuda_dnsg_mat_mod, psb_protect_name => psb_c_cuda_dnsg_vect_mv -#else - use psb_c_cuda_dnsg_mat_mod -#endif implicit none class(psb_c_cuda_dnsg_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta @@ -123,13 +119,9 @@ end subroutine psb_c_cuda_dnsg_vect_mv subroutine psb_c_cuda_dnsg_mold(a,b,info) use psb_base_mod use psb_c_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_c_vectordev_mod use psb_c_cuda_dnsg_mat_mod, psb_protect_name => psb_c_cuda_dnsg_mold -#else - use psb_c_cuda_dnsg_mat_mod -#endif implicit none class(psb_c_cuda_dnsg_sparse_mat), intent(in) :: a class(psb_c_base_sparse_mat), intent(inout), allocatable :: b @@ -190,17 +182,12 @@ end subroutine psb_c_cuda_dnsg_mold !!$ end subroutine psb_c_cuda_dnsg_allocate_mnnz !!$ end interface - subroutine psb_c_cuda_dnsg_to_gpu(a,info) use psb_base_mod use psb_c_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_c_vectordev_mod use psb_c_cuda_dnsg_mat_mod, psb_protect_name => psb_c_cuda_dnsg_to_gpu -#else - use psb_c_cuda_dnsg_mat_mod -#endif class(psb_c_cuda_dnsg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info Integer(Psb_ipk_) :: err_act, pitch, lda @@ -209,15 +196,12 @@ subroutine psb_c_cuda_dnsg_to_gpu(a,info) call psb_erractionsave(err_act) info = psb_success_ -#ifdef HAVE_SPGPU if (debug) write(0,*) 'DNS_TO_GPU',size(a%val,1),size(a%val,2) info = FallocDnsDevice(a%deviceMat,a%get_nrows(),a%get_ncols(),& & spgpu_type_complex_float,1) if (info == 0) info = writeDnsDevice(a%deviceMat,a%val,size(a%val,1),size(a%val,2)) if (debug) write(0,*) 'DNS_TO_GPU: From writeDnsDEvice',info - -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return @@ -233,13 +217,9 @@ end subroutine psb_c_cuda_dnsg_to_gpu subroutine psb_c_cuda_cp_dnsg_from_coo(a,b,info) use psb_base_mod use psb_c_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_c_vectordev_mod use psb_c_cuda_dnsg_mat_mod, psb_protect_name => psb_c_cuda_cp_dnsg_from_coo -#else - use psb_c_cuda_dnsg_mat_mod -#endif implicit none class(psb_c_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -272,13 +252,9 @@ end subroutine psb_c_cuda_cp_dnsg_from_coo subroutine psb_c_cuda_cp_dnsg_from_fmt(a,b,info) use psb_base_mod use psb_c_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_c_vectordev_mod use psb_c_cuda_dnsg_mat_mod, psb_protect_name => psb_c_cuda_cp_dnsg_from_fmt -#else - use psb_c_cuda_dnsg_mat_mod -#endif implicit none class(psb_c_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -348,13 +324,9 @@ end subroutine psb_c_cuda_cp_dnsg_from_fmt subroutine psb_c_cuda_mv_dnsg_from_coo(a,b,info) use psb_base_mod use psb_c_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_c_vectordev_mod use psb_c_cuda_dnsg_mat_mod, psb_protect_name => psb_c_cuda_mv_dnsg_from_coo -#else - use psb_c_cuda_dnsg_mat_mod -#endif implicit none class(psb_c_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -383,18 +355,13 @@ subroutine psb_c_cuda_mv_dnsg_from_coo(a,b,info) return end subroutine psb_c_cuda_mv_dnsg_from_coo - - + subroutine psb_c_cuda_mv_dnsg_from_fmt(a,b,info) use psb_base_mod use psb_c_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_c_vectordev_mod use psb_c_cuda_dnsg_mat_mod, psb_protect_name => psb_c_cuda_mv_dnsg_from_fmt -#else - use psb_c_cuda_dnsg_mat_mod -#endif implicit none class(psb_c_cuda_dnsg_sparse_mat), intent(inout) :: a class(psb_c_base_sparse_mat), intent(inout) :: b diff --git a/cuda/impl/psb_c_cuda_elg_allocate_mnnz.F90 b/cuda/impl/psb_c_cuda_elg_allocate_mnnz.F90 index 01ca7189..7f50d547 100644 --- a/cuda/impl/psb_c_cuda_elg_allocate_mnnz.F90 +++ b/cuda/impl/psb_c_cuda_elg_allocate_mnnz.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_c_cuda_elg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_allocate_mnnz -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a @@ -47,9 +41,7 @@ subroutine psb_c_cuda_elg_allocate_mnnz(m,n,a,nz) Integer(Psb_ipk_) :: err_act, info, nz_,ld character(len=20) :: name='allocate_mnz' logical, parameter :: debug=.false. -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif call psb_erractionsave(err_act) info = psb_success_ @@ -74,13 +66,9 @@ subroutine psb_c_cuda_elg_allocate_mnnz(m,n,a,nz) goto 9999 endif -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nz_,nz_*m,n,spgpu_type_complex_float,1) ld = gpu_parms%pitch nz_ = gpu_parms%maxRowSize -#else - ld = m -#endif if (info == psb_success_) call psb_realloc(m,a%irn,info) if (info == psb_success_) call psb_realloc(m,a%idiag,info) @@ -98,10 +86,8 @@ subroutine psb_c_cuda_elg_allocate_mnnz(m,n,a,nz) call a%set_dupl(psb_dupl_def_) end if -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz_) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_elg_asb.f90 b/cuda/impl/psb_c_cuda_elg_asb.f90 index 24af1cc9..16d70736 100644 --- a/cuda/impl/psb_c_cuda_elg_asb.f90 +++ b/cuda/impl/psb_c_cuda_elg_asb.f90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_asb(a) use psb_base_mod diff --git a/cuda/impl/psb_c_cuda_elg_csmm.F90 b/cuda/impl/psb_c_cuda_elg_csmm.F90 index a5f0e3d5..f7ae9892 100644 --- a/cuda/impl/psb_c_cuda_elg_csmm.F90 +++ b/cuda/impl/psb_c_cuda_elg_csmm.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_csmm -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:,:) @@ -92,8 +87,6 @@ subroutine psb_c_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) goto 9999 end if - -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() call a%psb_c_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) @@ -119,9 +112,6 @@ subroutine psb_c_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_elg_csmv.F90 b/cuda/impl/psb_c_cuda_elg_csmv.F90 index 00f39e8c..a23d4a60 100644 --- a/cuda/impl/psb_c_cuda_elg_csmv.F90 +++ b/cuda/impl/psb_c_cuda_elg_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_csmv -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_c_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() call a%psb_c_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) @@ -122,9 +116,6 @@ subroutine psb_c_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_elg_csput.F90 b/cuda/impl/psb_c_cuda_elg_csput.F90 index cc6fc024..3da928f0 100644 --- a/cuda/impl/psb_c_cuda_elg_csput.F90 +++ b/cuda/impl/psb_c_cuda_elg_csput.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_base_mod use iso_c_binding -#ifdef HAVE_SPGPU use elldev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_csput_a -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a @@ -128,13 +123,9 @@ subroutine psb_c_cuda_elg_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_base_mod use iso_c_binding -#ifdef HAVE_SPGPU use elldev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_csput_v use psb_c_cuda_vect_mod -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_c_cuda_elg_from_gpu.F90 b/cuda/impl/psb_c_cuda_elg_from_gpu.F90 index 593b52be..34c6e4a6 100644 --- a/cuda/impl/psb_c_cuda_elg_from_gpu.F90 +++ b/cuda/impl/psb_c_cuda_elg_from_gpu.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - + subroutine psb_c_cuda_elg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_from_gpu -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +43,6 @@ subroutine psb_c_cuda_elg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (.not.(c_associated(a%deviceMat))) then call a%free() return @@ -69,6 +63,5 @@ subroutine psb_c_cuda_elg_from_gpu(a,info) if (info == 0) info = & & readEllDevice(a%deviceMat,a%val,a%ja,pitch,a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_c_cuda_elg_from_gpu diff --git a/cuda/impl/psb_c_cuda_elg_inner_vect_sv.F90 b/cuda/impl/psb_c_cuda_elg_inner_vect_sv.F90 index 43843dc6..148d72d2 100644 --- a/cuda/impl/psb_c_cuda_elg_inner_vect_sv.F90 +++ b/cuda/impl/psb_c_cuda_elg_inner_vect_sv.F90 @@ -27,19 +27,14 @@ ! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. -! - +! subroutine psb_c_cuda_elg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_inner_vect_sv -#else - use psb_c_cuda_elg_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_elg_sparse_mat), intent(in) :: a diff --git a/cuda/impl/psb_c_cuda_elg_mold.F90 b/cuda/impl/psb_c_cuda_elg_mold.F90 index b428055c..bb94bf07 100644 --- a/cuda/impl/psb_c_cuda_elg_mold.F90 +++ b/cuda/impl/psb_c_cuda_elg_mold.F90 @@ -28,8 +28,6 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_c_cuda_elg_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_c_cuda_elg_reallocate_nz.F90 b/cuda/impl/psb_c_cuda_elg_reallocate_nz.F90 index b97530e1..6a1f8763 100644 --- a/cuda/impl/psb_c_cuda_elg_reallocate_nz.F90 +++ b/cuda/impl/psb_c_cuda_elg_reallocate_nz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_reallocate_nz -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a @@ -64,10 +59,8 @@ subroutine psb_c_cuda_elg_reallocate_nz(nz,a) goto 9999 end if -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nzrm) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_elg_scal.F90 b/cuda/impl/psb_c_cuda_elg_scal.F90 index b169451b..65f84768 100644 --- a/cuda/impl/psb_c_cuda_elg_scal.F90 +++ b/cuda/impl/psb_c_cuda_elg_scal.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_scal -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a complex(psb_spk_), intent(in) :: d(:) @@ -63,10 +58,8 @@ subroutine psb_c_cuda_elg_scal(d,a,info,side) call a%psb_c_ell_sparse_mat%scal(d,info,side) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_elg_scals.F90 b/cuda/impl/psb_c_cuda_elg_scals.F90 index d20ee568..966f2e91 100644 --- a/cuda/impl/psb_c_cuda_elg_scals.F90 +++ b/cuda/impl/psb_c_cuda_elg_scals.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_scals -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a complex(psb_spk_), intent(in) :: d @@ -59,10 +54,8 @@ subroutine psb_c_cuda_elg_scals(d,a,info) a%val(:,:) = a%val(:,:) * d -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_c_cuda_elg_to_gpu.F90 b/cuda/impl/psb_c_cuda_elg_to_gpu.F90 index 5ea61a41..495207c7 100644 --- a/cuda/impl/psb_c_cuda_elg_to_gpu.F90 +++ b/cuda/impl/psb_c_cuda_elg_to_gpu.F90 @@ -29,30 +29,22 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_to_gpu -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(in), optional :: nzrm integer(psb_ipk_) :: m, nzm, n, pitch,maxrowsize, nzt -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -88,6 +80,5 @@ subroutine psb_c_cuda_elg_to_gpu(a,info,nzrm) if (info == 0) info = & & writeEllDevice(a%deviceMat,a%val,a%ja,size(a%ja,1),a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_c_cuda_elg_to_gpu diff --git a/cuda/impl/psb_c_cuda_elg_trim.f90 b/cuda/impl/psb_c_cuda_elg_trim.f90 index 483e189d..78dbe193 100644 --- a/cuda/impl/psb_c_cuda_elg_trim.f90 +++ b/cuda/impl/psb_c_cuda_elg_trim.f90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_trim(a) use psb_base_mod diff --git a/cuda/impl/psb_c_cuda_elg_vect_mv.F90 b/cuda/impl/psb_c_cuda_elg_vect_mv.F90 index b89ba5a2..9da6a34a 100644 --- a/cuda/impl/psb_c_cuda_elg_vect_mv.F90 +++ b/cuda/impl/psb_c_cuda_elg_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_elg_vect_mv -#else - use psb_c_cuda_elg_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_elg_sparse_mat), intent(in) :: a @@ -71,7 +66,6 @@ subroutine psb_c_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() if (.not.x%is_host()) call x%sync() @@ -116,10 +110,6 @@ subroutine psb_c_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - if (a%is_dev()) call a%sync() - call a%psb_c_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hdiag_csmv.F90 b/cuda/impl/psb_c_cuda_hdiag_csmv.F90 index 4ea2c269..36928062 100644 --- a/cuda/impl/psb_c_cuda_hdiag_csmv.F90 +++ b/cuda/impl/psb_c_cuda_hdiag_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_c_cuda_hdiag_mat_mod, psb_protect_name => psb_c_cuda_hdiag_csmv -#else - use psb_c_cuda_hdiag_mat_mod -#endif implicit none class(psb_c_cuda_hdiag_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_c_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_c_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_c_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -132,5 +123,4 @@ subroutine psb_c_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) return - end subroutine psb_c_cuda_hdiag_csmv diff --git a/cuda/impl/psb_c_cuda_hdiag_mold.F90 b/cuda/impl/psb_c_cuda_hdiag_mold.F90 index 67e0b92e..27402cfc 100644 --- a/cuda/impl/psb_c_cuda_hdiag_mold.F90 +++ b/cuda/impl/psb_c_cuda_hdiag_mold.F90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hdiag_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_c_cuda_hdiag_to_gpu.F90 b/cuda/impl/psb_c_cuda_hdiag_to_gpu.F90 index 63ab178a..8d1b61a1 100644 --- a/cuda/impl/psb_c_cuda_hdiag_to_gpu.F90 +++ b/cuda/impl/psb_c_cuda_hdiag_to_gpu.F90 @@ -29,29 +29,21 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hdiag_to_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_c_cuda_hdiag_mat_mod, psb_protect_name => psb_c_cuda_hdiag_to_gpu -#else - use psb_c_cuda_hdiag_mat_mod -#endif use iso_c_binding implicit none class(psb_c_cuda_hdiag_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: nr, nc, hacksize, hackcount, allocheight -#ifdef HAVE_SPGPU type(hdiagdev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU nr = a%get_nrows() nc = a%get_ncols() hacksize = a%hackSize @@ -81,6 +73,4 @@ subroutine psb_c_cuda_hdiag_to_gpu(a,info) if (info == 0) info = & & writeHdiagDevice(a%deviceMat,a%val,a%diaOffsets,a%hackOffsets) -#endif - end subroutine psb_c_cuda_hdiag_to_gpu diff --git a/cuda/impl/psb_c_cuda_hdiag_vect_mv.F90 b/cuda/impl/psb_c_cuda_hdiag_vect_mv.F90 index fb80611f..0c7ce856 100644 --- a/cuda/impl/psb_c_cuda_hdiag_vect_mv.F90 +++ b/cuda/impl/psb_c_cuda_hdiag_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_c_cuda_hdiag_mat_mod, psb_protect_name => psb_c_cuda_hdiag_vect_mv -#else - use psb_c_cuda_hdiag_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_hdiag_sparse_mat), intent(in) :: a @@ -71,7 +66,6 @@ subroutine psb_c_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= dzero) then @@ -112,9 +106,6 @@ subroutine psb_c_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_c_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hlg_allocate_mnnz.F90 b/cuda/impl/psb_c_cuda_hlg_allocate_mnnz.F90 index 277b974f..1b41f132 100644 --- a/cuda/impl/psb_c_cuda_hlg_allocate_mnnz.F90 +++ b/cuda/impl/psb_c_cuda_hlg_allocate_mnnz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_allocate_mnnz -#else - use psb_c_cuda_hlg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_c_cuda_hlg_sparse_mat), intent(inout) :: a @@ -47,19 +42,15 @@ subroutine psb_c_cuda_hlg_allocate_mnnz(m,n,a,nz) Integer(psb_ipk_) :: err_act, info, nz_,ld character(len=20) :: name='allocate_mnz' logical, parameter :: debug=.false. -#ifdef HAVE_SPGPU type(hlldev_parms) :: gpu_parms -#endif call psb_erractionsave(err_act) info = psb_success_ call a%psb_c_hll_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz_) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hlg_csmm.F90 b/cuda/impl/psb_c_cuda_hlg_csmm.F90 index f351ffd0..88aa53a8 100644 --- a/cuda/impl/psb_c_cuda_hlg_csmm.F90 +++ b/cuda/impl/psb_c_cuda_hlg_csmm.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_csmm -#else - use psb_c_cuda_hlg_mat_mod -#endif implicit none class(psb_c_cuda_hlg_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:,:) @@ -93,7 +88,6 @@ subroutine psb_c_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_c_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -118,9 +112,6 @@ subroutine psb_c_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -128,5 +119,4 @@ subroutine psb_c_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) return - end subroutine psb_c_cuda_hlg_csmm diff --git a/cuda/impl/psb_c_cuda_hlg_csmv.F90 b/cuda/impl/psb_c_cuda_hlg_csmv.F90 index d39e5f51..18db6ad1 100644 --- a/cuda/impl/psb_c_cuda_hlg_csmv.F90 +++ b/cuda/impl/psb_c_cuda_hlg_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_csmv -#else - use psb_c_cuda_hlg_mat_mod -#endif implicit none class(psb_c_cuda_hlg_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_c_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_c_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_c_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hlg_from_gpu.F90 b/cuda/impl/psb_c_cuda_hlg_from_gpu.F90 index f823153d..d06d5488 100644 --- a/cuda/impl/psb_c_cuda_hlg_from_gpu.F90 +++ b/cuda/impl/psb_c_cuda_hlg_from_gpu.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_from_gpu -#else - use psb_c_cuda_hlg_mat_mod -#endif implicit none class(psb_c_cuda_hlg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +43,6 @@ subroutine psb_c_cuda_hlg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (a%is_sync()) return if (a%is_host()) return if (.not.(c_associated(a%deviceMat))) then @@ -71,6 +65,5 @@ subroutine psb_c_cuda_hlg_from_gpu(a,info) if (info == 0) info = & & readHllDevice(a%deviceMat,a%val,a%ja,a%hkoffs,a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_c_cuda_hlg_from_gpu diff --git a/cuda/impl/psb_c_cuda_hlg_inner_vect_sv.F90 b/cuda/impl/psb_c_cuda_hlg_inner_vect_sv.F90 index 6202885c..87d7c662 100644 --- a/cuda/impl/psb_c_cuda_hlg_inner_vect_sv.F90 +++ b/cuda/impl/psb_c_cuda_hlg_inner_vect_sv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_inner_vect_sv -#else - use psb_c_cuda_hlg_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_hlg_sparse_mat), intent(in) :: a @@ -69,11 +64,9 @@ subroutine psb_c_cuda_hlg_inner_vect_sv(alpha,a,x,beta,y,info,trans) goto 9999 end if - call psb_erractionrestore(err_act) return - 9999 call psb_error_handler(err_act) return diff --git a/cuda/impl/psb_c_cuda_hlg_mold.F90 b/cuda/impl/psb_c_cuda_hlg_mold.F90 index 85453422..a702e211 100644 --- a/cuda/impl/psb_c_cuda_hlg_mold.F90 +++ b/cuda/impl/psb_c_cuda_hlg_mold.F90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_c_cuda_hlg_reallocate_nz.F90 b/cuda/impl/psb_c_cuda_hlg_reallocate_nz.F90 index 848b659d..2ec5fa2c 100644 --- a/cuda/impl/psb_c_cuda_hlg_reallocate_nz.F90 +++ b/cuda/impl/psb_c_cuda_hlg_reallocate_nz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_reallocate_nz -#else - use psb_c_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none integer(psb_ipk_), intent(in) :: nz @@ -52,10 +47,8 @@ subroutine psb_c_cuda_hlg_reallocate_nz(nz,a) call a%psb_c_hll_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hlg_scal.F90 b/cuda/impl/psb_c_cuda_hlg_scal.F90 index d768048f..770d1734 100644 --- a/cuda/impl/psb_c_cuda_hlg_scal.F90 +++ b/cuda/impl/psb_c_cuda_hlg_scal.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_scal -#else - use psb_c_cuda_hlg_mat_mod -#endif implicit none class(psb_c_cuda_hlg_sparse_mat), intent(inout) :: a complex(psb_spk_), intent(in) :: d(:) @@ -60,10 +55,8 @@ subroutine psb_c_cuda_hlg_scal(d,a,info,side) call a%psb_c_hll_sparse_mat%scal(d,info,side) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hlg_scals.F90 b/cuda/impl/psb_c_cuda_hlg_scals.F90 index 7574bf94..ef6bc1e3 100644 --- a/cuda/impl/psb_c_cuda_hlg_scals.F90 +++ b/cuda/impl/psb_c_cuda_hlg_scals.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_scals -#else - use psb_c_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none class(psb_c_cuda_hlg_sparse_mat), intent(inout) :: a @@ -59,10 +54,8 @@ subroutine psb_c_cuda_hlg_scals(d,a,info) call a%psb_c_hll_sparse_mat%scal(d,info) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hlg_to_gpu.F90 b/cuda/impl/psb_c_cuda_hlg_to_gpu.F90 index d7fc8fb2..d7d179e7 100644 --- a/cuda/impl/psb_c_cuda_hlg_to_gpu.F90 +++ b/cuda/impl/psb_c_cuda_hlg_to_gpu.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_to_gpu -#else - use psb_c_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none class(psb_c_cuda_hlg_sparse_mat), intent(inout) :: a @@ -50,7 +45,6 @@ subroutine psb_c_cuda_hlg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return n = a%get_nrows() @@ -63,6 +57,5 @@ subroutine psb_c_cuda_hlg_to_gpu(a,info,nzrm) if (info == 0) info = & & writehllDevice(a%deviceMat,a%val,a%ja,a%hkoffs,a%irn,a%idiag) ! if (info /= 0) goto 9999 -#endif end subroutine psb_c_cuda_hlg_to_gpu diff --git a/cuda/impl/psb_c_cuda_hlg_vect_mv.F90 b/cuda/impl/psb_c_cuda_hlg_vect_mv.F90 index 2d7a679e..3789ef17 100644 --- a/cuda/impl/psb_c_cuda_hlg_vect_mv.F90 +++ b/cuda/impl/psb_c_cuda_hlg_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_hlg_vect_mv -#else - use psb_c_cuda_hlg_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_hlg_sparse_mat), intent(in) :: a @@ -69,9 +64,7 @@ subroutine psb_c_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) goto 9999 endif - tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= czero) then @@ -115,9 +108,6 @@ subroutine psb_c_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_c_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hybg_allocate_mnnz.F90 b/cuda/impl/psb_c_cuda_hybg_allocate_mnnz.F90 index eced26e0..bc9f3889 100644 --- a/cuda/impl/psb_c_cuda_hybg_allocate_mnnz.F90 +++ b/cuda/impl/psb_c_cuda_hybg_allocate_mnnz.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_hybg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_hybg_allocate_mnnz -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_c_cuda_hybg_sparse_mat), intent(inout) :: a @@ -52,11 +48,9 @@ subroutine psb_c_cuda_hybg_allocate_mnnz(m,n,a,nz) call a%psb_c_csr_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU info = initFcusparse() call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hybg_csmm.F90 b/cuda/impl/psb_c_cuda_hybg_csmm.F90 index cc459f66..227b7d5c 100644 --- a/cuda/impl/psb_c_cuda_hybg_csmm.F90 +++ b/cuda/impl/psb_c_cuda_hybg_csmm.F90 @@ -33,14 +33,10 @@ subroutine psb_c_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_hybg_csmm -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none class(psb_c_cuda_hybg_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:,:) @@ -92,8 +88,6 @@ subroutine psb_c_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) goto 9999 end if - -#ifdef HAVE_SPGPU if (tra) then call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_c_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hybg_csmv.F90 b/cuda/impl/psb_c_cuda_hybg_csmv.F90 index ab07d756..e1084022 100644 --- a/cuda/impl/psb_c_cuda_hybg_csmv.F90 +++ b/cuda/impl/psb_c_cuda_hybg_csmv.F90 @@ -33,14 +33,10 @@ subroutine psb_c_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_hybg_csmv -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none class(psb_c_cuda_hybg_sparse_mat), intent(in) :: a complex(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -95,7 +91,6 @@ subroutine psb_c_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -123,9 +118,6 @@ subroutine psb_c_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hybg_inner_vect_sv.F90 b/cuda/impl/psb_c_cuda_hybg_inner_vect_sv.F90 index fcaf49ff..e19aafeb 100644 --- a/cuda/impl/psb_c_cuda_hybg_inner_vect_sv.F90 +++ b/cuda/impl/psb_c_cuda_hybg_inner_vect_sv.F90 @@ -33,13 +33,9 @@ subroutine psb_c_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_hybg_inner_vect_sv -#else - use psb_c_cuda_hybg_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_hybg_sparse_mat), intent(in) :: a @@ -76,7 +72,6 @@ subroutine psb_c_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra.or.(beta/=czero)) then call x%sync() call y%sync() @@ -113,12 +108,6 @@ subroutine psb_c_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call x%sync() - call y%sync() - call a%psb_c_csr_sparse_mat%inner_spsm(alpha,x,beta,y,info,trans) - call y%set_host() -#endif if (info /= psb_success_) then info = psb_err_from_subroutine_ call psb_errpush(info,name, a_err='hybg_vect_sv') diff --git a/cuda/impl/psb_c_cuda_hybg_reallocate_nz.F90 b/cuda/impl/psb_c_cuda_hybg_reallocate_nz.F90 index 979eaad8..15f33077 100644 --- a/cuda/impl/psb_c_cuda_hybg_reallocate_nz.F90 +++ b/cuda/impl/psb_c_cuda_hybg_reallocate_nz.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_hybg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_hybg_reallocate_nz -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_c_cuda_hybg_sparse_mat), intent(inout) :: a @@ -55,10 +51,8 @@ subroutine psb_c_cuda_hybg_reallocate_nz(nz,a) ! call a%psb_c_csr_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hybg_scal.F90 b/cuda/impl/psb_c_cuda_hybg_scal.F90 index ac4d788e..ff1c1515 100644 --- a/cuda/impl/psb_c_cuda_hybg_scal.F90 +++ b/cuda/impl/psb_c_cuda_hybg_scal.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_hybg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_hybg_scal -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none class(psb_c_cuda_hybg_sparse_mat), intent(inout) :: a complex(psb_spk_), intent(in) :: d(:) @@ -60,10 +56,8 @@ subroutine psb_c_cuda_hybg_scal(d,a,info,side) call a%psb_c_csr_sparse_mat%scal(d,info,side=side) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hybg_scals.F90 b/cuda/impl/psb_c_cuda_hybg_scals.F90 index 7def71d2..1b2ddf32 100644 --- a/cuda/impl/psb_c_cuda_hybg_scals.F90 +++ b/cuda/impl/psb_c_cuda_hybg_scals.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_hybg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_hybg_scals -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none class(psb_c_cuda_hybg_sparse_mat), intent(inout) :: a complex(psb_spk_), intent(in) :: d @@ -60,10 +56,8 @@ subroutine psb_c_cuda_hybg_scals(d,a,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_hybg_to_gpu.F90 b/cuda/impl/psb_c_cuda_hybg_to_gpu.F90 index 1a77586e..15a65abc 100644 --- a/cuda/impl/psb_c_cuda_hybg_to_gpu.F90 +++ b/cuda/impl/psb_c_cuda_hybg_to_gpu.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_hybg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_hybg_to_gpu -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none class(psb_c_cuda_hybg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -51,7 +47,6 @@ subroutine psb_c_cuda_hybg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -148,7 +143,6 @@ subroutine psb_c_cuda_hybg_to_gpu(a,info,nzrm) if (info /= 0) then write(0,*) 'Error in HYBG_TO_GPU ',info end if -#endif end subroutine psb_c_cuda_hybg_to_gpu #endif diff --git a/cuda/impl/psb_c_cuda_hybg_vect_mv.F90 b/cuda/impl/psb_c_cuda_hybg_vect_mv.F90 index da20ca41..58ce0386 100644 --- a/cuda/impl/psb_c_cuda_hybg_vect_mv.F90 +++ b/cuda/impl/psb_c_cuda_hybg_vect_mv.F90 @@ -33,14 +33,10 @@ subroutine psb_c_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_hybg_vect_mv -#else - use psb_c_cuda_hybg_mat_mod -#endif use psb_c_cuda_vect_mod implicit none class(psb_c_cuda_hybg_sparse_mat), intent(in) :: a @@ -71,8 +67,6 @@ subroutine psb_c_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') - -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= czero) then @@ -112,9 +106,6 @@ subroutine psb_c_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call a%psb_c_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_c_cuda_mv_csrg_from_coo.F90 b/cuda/impl/psb_c_cuda_mv_csrg_from_coo.F90 index f80a8f87..f0a74c09 100644 --- a/cuda/impl/psb_c_cuda_mv_csrg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_mv_csrg_from_coo.F90 @@ -29,16 +29,11 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_mv_csrg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_mv_csrg_from_coo -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none class(psb_c_cuda_csrg_sparse_mat), intent(inout) :: a @@ -51,9 +46,7 @@ subroutine psb_c_cuda_mv_csrg_from_coo(a,b,info) call a%psb_c_csr_sparse_mat%mv_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif if (info /= 0) goto 9999 return diff --git a/cuda/impl/psb_c_cuda_mv_csrg_from_fmt.F90 b/cuda/impl/psb_c_cuda_mv_csrg_from_fmt.F90 index 1f23a6c2..eb3698b0 100644 --- a/cuda/impl/psb_c_cuda_mv_csrg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_mv_csrg_from_fmt.F90 @@ -29,16 +29,11 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_mv_csrg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_csrg_mat_mod, psb_protect_name => psb_c_cuda_mv_csrg_from_fmt -#else - use psb_c_cuda_csrg_mat_mod -#endif implicit none class(psb_c_cuda_csrg_sparse_mat), intent(inout) :: a @@ -55,9 +50,7 @@ subroutine psb_c_cuda_mv_csrg_from_fmt(a,b,info) class default call a%psb_c_csr_sparse_mat%mv_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_c_cuda_mv_csrg_from_fmt diff --git a/cuda/impl/psb_c_cuda_mv_diag_from_coo.F90 b/cuda/impl/psb_c_cuda_mv_diag_from_coo.F90 index e20e0b0a..c1ee2ba9 100644 --- a/cuda/impl/psb_c_cuda_mv_diag_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_mv_diag_from_coo.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_mv_diag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_c_cuda_diag_mat_mod, psb_protect_name => psb_c_cuda_mv_diag_from_coo -#else - use psb_c_cuda_diag_mat_mod -#endif implicit none diff --git a/cuda/impl/psb_c_cuda_mv_elg_from_coo.F90 b/cuda/impl/psb_c_cuda_mv_elg_from_coo.F90 index 741058cd..f9555729 100644 --- a/cuda/impl/psb_c_cuda_mv_elg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_mv_elg_from_coo.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_c_cuda_mv_elg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_mv_elg_from_coo -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a @@ -57,5 +52,4 @@ subroutine psb_c_cuda_mv_elg_from_coo(a,b,info) return - end subroutine psb_c_cuda_mv_elg_from_coo diff --git a/cuda/impl/psb_c_cuda_mv_elg_from_fmt.F90 b/cuda/impl/psb_c_cuda_mv_elg_from_fmt.F90 index b375bc63..59615e25 100644 --- a/cuda/impl/psb_c_cuda_mv_elg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_mv_elg_from_fmt.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - + subroutine psb_c_cuda_mv_elg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_c_cuda_elg_mat_mod, psb_protect_name => psb_c_cuda_mv_elg_from_fmt -#else - use psb_c_cuda_elg_mat_mod -#endif implicit none class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a @@ -49,9 +44,7 @@ subroutine psb_c_cuda_mv_elg_from_fmt(a,b,info) !locals type(psb_c_coo_sparse_mat) :: tmp Integer(Psb_ipk_) :: nza, nr, i,j,irw, idl,err_act, nc, ld, nzm, m -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = psb_success_ @@ -65,13 +58,9 @@ subroutine psb_c_cuda_mv_elg_from_fmt(a,b,info) m = b%get_nrows() nc = b%get_ncols() nza = b%get_nzeros() -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) ld = gpu_parms%pitch nzm = gpu_parms%maxRowSize -#else - ld = m -#endif a%psb_c_base_sparse_mat = b%psb_c_base_sparse_mat call move_alloc(b%irn, a%irn) call move_alloc(b%idiag, a%idiag) @@ -87,9 +76,7 @@ subroutine psb_c_cuda_mv_elg_from_fmt(a,b,info) end if a%nzt = nza call b%free() -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif class default call b%mv_to_coo(tmp,info) diff --git a/cuda/impl/psb_c_cuda_mv_hdiag_from_coo.F90 b/cuda/impl/psb_c_cuda_mv_hdiag_from_coo.F90 index 8826081f..21ee731d 100644 --- a/cuda/impl/psb_c_cuda_mv_hdiag_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_mv_hdiag_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_c_cuda_mv_hdiag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_c_cuda_hdiag_mat_mod, psb_protect_name => psb_c_cuda_mv_hdiag_from_coo use psb_cuda_env_mod -#else - use psb_c_cuda_hdiag_mat_mod -#endif implicit none @@ -54,16 +48,12 @@ subroutine psb_c_cuda_mv_hdiag_from_coo(a,b,info) info = psb_success_ -#ifdef HAVE_SPGPU a%hacksize = psb_cuda_WarpSize() -#endif call a%psb_c_hdia_sparse_mat%mv_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_c_cuda_mv_hlg_from_coo.F90 b/cuda/impl/psb_c_cuda_mv_hlg_from_coo.F90 index 416bbaed..50c20fad 100644 --- a/cuda/impl/psb_c_cuda_mv_hlg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_mv_hlg_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_c_cuda_mv_hlg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_cuda_env_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_mv_hlg_from_coo -#else - use psb_c_cuda_hlg_mat_mod -#endif implicit none class(psb_c_cuda_hlg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_c_cuda_mv_hlg_from_fmt.F90 b/cuda/impl/psb_c_cuda_mv_hlg_from_fmt.F90 index aafe692d..3fba905a 100644 --- a/cuda/impl/psb_c_cuda_mv_hlg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_mv_hlg_from_fmt.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_c_cuda_mv_hlg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_c_cuda_hlg_mat_mod, psb_protect_name => psb_c_cuda_mv_hlg_from_fmt -#else - use psb_c_cuda_hlg_mat_mod -#endif implicit none class(psb_c_cuda_hlg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_c_cuda_mv_hybg_from_coo.F90 b/cuda/impl/psb_c_cuda_mv_hybg_from_coo.F90 index eb5ba685..f7cdae40 100644 --- a/cuda/impl/psb_c_cuda_mv_hybg_from_coo.F90 +++ b/cuda/impl/psb_c_cuda_mv_hybg_from_coo.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_mv_hybg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_mv_hybg_from_coo -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none class(psb_c_cuda_hybg_sparse_mat), intent(inout) :: a @@ -50,10 +46,8 @@ subroutine psb_c_cuda_mv_hybg_from_coo(a,b,info) call a%psb_c_csr_sparse_mat%mv_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_c_cuda_mv_hybg_from_fmt.F90 b/cuda/impl/psb_c_cuda_mv_hybg_from_fmt.F90 index d74e89bd..9be9f0b4 100644 --- a/cuda/impl/psb_c_cuda_mv_hybg_from_fmt.F90 +++ b/cuda/impl/psb_c_cuda_mv_hybg_from_fmt.F90 @@ -33,12 +33,8 @@ subroutine psb_c_cuda_mv_hybg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_c_cuda_hybg_mat_mod, psb_protect_name => psb_c_cuda_mv_hybg_from_fmt -#else - use psb_c_cuda_hybg_mat_mod -#endif implicit none class(psb_c_cuda_hybg_sparse_mat), intent(inout) :: a @@ -54,9 +50,7 @@ subroutine psb_c_cuda_mv_hybg_from_fmt(a,b,info) class default call a%psb_c_csr_sparse_mat%mv_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_c_cuda_mv_hybg_from_fmt #endif diff --git a/cuda/impl/psb_d_cuda_cp_csrg_from_coo.F90 b/cuda/impl/psb_d_cuda_cp_csrg_from_coo.F90 index e3383af1..ab3a7256 100644 --- a/cuda/impl/psb_d_cuda_cp_csrg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_cp_csrg_from_coo.F90 @@ -32,12 +32,8 @@ subroutine psb_d_cuda_cp_csrg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_cp_csrg_from_coo -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none class(psb_d_cuda_csrg_sparse_mat), intent(inout) :: a @@ -48,10 +44,8 @@ subroutine psb_d_cuda_cp_csrg_from_coo(a,b,info) call a%psb_d_csr_sparse_mat%cp_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_d_cuda_cp_csrg_from_fmt.F90 b/cuda/impl/psb_d_cuda_cp_csrg_from_fmt.F90 index 28b46c76..d030538e 100644 --- a/cuda/impl/psb_d_cuda_cp_csrg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_cp_csrg_from_fmt.F90 @@ -32,12 +32,8 @@ subroutine psb_d_cuda_cp_csrg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_cp_csrg_from_fmt -#else - use psb_d_cuda_csrg_mat_mod -#endif !use iso_c_binding implicit none @@ -53,9 +49,7 @@ subroutine psb_d_cuda_cp_csrg_from_fmt(a,b,info) class default call a%psb_d_csr_sparse_mat%cp_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_d_cuda_cp_csrg_from_fmt diff --git a/cuda/impl/psb_d_cuda_cp_diag_from_coo.F90 b/cuda/impl/psb_d_cuda_cp_diag_from_coo.F90 index d21bb469..dc0401d5 100644 --- a/cuda/impl/psb_d_cuda_cp_diag_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_cp_diag_from_coo.F90 @@ -33,13 +33,9 @@ subroutine psb_d_cuda_cp_diag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_d_cuda_diag_mat_mod, psb_protect_name => psb_d_cuda_cp_diag_from_coo -#else - use psb_d_cuda_diag_mat_mod -#endif implicit none class(psb_d_cuda_diag_sparse_mat), intent(inout) :: a @@ -50,10 +46,8 @@ subroutine psb_d_cuda_cp_diag_from_coo(a,b,info) info = psb_success_ call a%psb_d_dia_sparse_mat%cp_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_d_cuda_cp_elg_from_coo.F90 b/cuda/impl/psb_d_cuda_cp_elg_from_coo.F90 index a4d58297..890bdc39 100644 --- a/cuda/impl/psb_d_cuda_cp_elg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_cp_elg_from_coo.F90 @@ -28,20 +28,14 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_d_cuda_cp_elg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_cp_elg_from_coo use psi_ext_util_mod use psb_cuda_env_mod -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a @@ -57,16 +51,11 @@ subroutine psb_d_cuda_cp_elg_from_coo(a,b,info) integer(psb_ipk_), allocatable :: idisp(:) info = psb_success_ -#ifdef HAVE_SPGPU hacksize = max(1,psb_cuda_WarpSize()) -#else - hacksize = 1 -#endif if (b%is_dev()) call b%sync() if (b%is_by_rows()) then -#ifdef HAVE_SPGPU call psi_d_count_ell_from_coo(a,b,idisp,ldv,nzm,info,hacksize=hacksize) @@ -82,15 +71,8 @@ subroutine psb_d_cuda_cp_elg_from_coo(a,b,info) if (info == 0) info = psi_CopyCooToElg(nr,nc,nza, hacksize,ldv,nzm, & & a%irn,idisp,b%ja,b%val, a%deviceMat) call a%set_dev() -#else - - call psi_d_convert_ell_from_coo(a,b,info,hacksize=hacksize) - call a%set_host() -#endif - else call b%cp_to_coo(tmp,info) -#ifdef HAVE_SPGPU call psi_d_count_ell_from_coo(a,tmp,idisp,ldv,nzm,info,hacksize=hacksize) @@ -107,11 +89,6 @@ subroutine psb_d_cuda_cp_elg_from_coo(a,b,info) & a%irn,idisp,tmp%ja,tmp%val, a%deviceMat) call a%set_dev() -#else - - call psi_d_convert_ell_from_coo(a,tmp,info,hacksize=hacksize) - call a%set_host() -#endif end if if (info /= psb_success_) goto 9999 diff --git a/cuda/impl/psb_d_cuda_cp_elg_from_fmt.F90 b/cuda/impl/psb_d_cuda_cp_elg_from_fmt.F90 index 31786c1b..7beea7f1 100644 --- a/cuda/impl/psb_d_cuda_cp_elg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_cp_elg_from_fmt.F90 @@ -33,13 +33,9 @@ subroutine psb_d_cuda_cp_elg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_cp_elg_from_fmt -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a @@ -51,9 +47,7 @@ subroutine psb_d_cuda_cp_elg_from_fmt(a,b,info) Integer(Psb_ipk_) :: nza, nr, i,j,irw, idl,err_act, nc, ld, nzm, m integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = psb_success_ if (b%is_dev()) call b%sync() @@ -67,13 +61,9 @@ subroutine psb_d_cuda_cp_elg_from_fmt(a,b,info) m = b%get_nrows() nc = b%get_ncols() nza = b%get_nzeros() -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) ld = gpu_parms%pitch nzm = gpu_parms%maxRowSize -#else - ld = m -#endif a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -88,9 +78,7 @@ subroutine psb_d_cuda_cp_elg_from_fmt(a,b,info) a%val(1:m,1:nzm) = b%val(1:m,1:nzm) end if a%nzt = nza -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif class default diff --git a/cuda/impl/psb_d_cuda_cp_hdiag_from_coo.F90 b/cuda/impl/psb_d_cuda_cp_hdiag_from_coo.F90 index efcf9d66..82ef4876 100644 --- a/cuda/impl/psb_d_cuda_cp_hdiag_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_cp_hdiag_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_d_cuda_cp_hdiag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_d_cuda_hdiag_mat_mod, psb_protect_name => psb_d_cuda_cp_hdiag_from_coo use psb_cuda_env_mod -#else - use psb_d_cuda_hdiag_mat_mod -#endif implicit none class(psb_d_cuda_hdiag_sparse_mat), intent(inout) :: a @@ -53,16 +47,12 @@ subroutine psb_d_cuda_cp_hdiag_from_coo(a,b,info) info = psb_success_ -#ifdef HAVE_SPGPU a%hacksize = psb_cuda_WarpSize() -#endif call a%psb_d_hdia_sparse_mat%cp_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_d_cuda_cp_hlg_from_coo.F90 b/cuda/impl/psb_d_cuda_cp_hlg_from_coo.F90 index 2fc898b2..34b999a9 100644 --- a/cuda/impl/psb_d_cuda_cp_hlg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_cp_hlg_from_coo.F90 @@ -33,14 +33,10 @@ subroutine psb_d_cuda_cp_hlg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_cuda_env_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_cp_hlg_from_coo -#else - use psb_d_cuda_hlg_mat_mod -#endif implicit none class(psb_d_cuda_hlg_sparse_mat), intent(inout) :: a @@ -61,11 +57,7 @@ subroutine psb_d_cuda_cp_hlg_from_coo(a,b,info) info = psb_success_ debug_unit = psb_get_debug_unit() debug_level = psb_get_debug_level() -#ifdef HAVE_SPGPU hksz = max(1,psb_cuda_WarpSize()) -#else - hksz = psi_get_hksz() -#endif if (b%is_by_rows()) then diff --git a/cuda/impl/psb_d_cuda_cp_hlg_from_fmt.F90 b/cuda/impl/psb_d_cuda_cp_hlg_from_fmt.F90 index 0796630c..ecb15157 100644 --- a/cuda/impl/psb_d_cuda_cp_hlg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_cp_hlg_from_fmt.F90 @@ -33,13 +33,9 @@ subroutine psb_d_cuda_cp_hlg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_cp_hlg_from_fmt -#else - use psb_d_cuda_hlg_mat_mod -#endif implicit none class(psb_d_cuda_hlg_sparse_mat), intent(inout) :: a @@ -53,9 +49,7 @@ subroutine psb_d_cuda_cp_hlg_from_fmt(a,b,info) call a%cp_from_coo(b,info) class default call a%psb_d_hll_sparse_mat%cp_from_fmt(b,info) -#ifdef HAVE_SPGPU if (info == 0) call a%to_gpu(info) -#endif end select if (info /= 0) goto 9999 diff --git a/cuda/impl/psb_d_cuda_cp_hybg_from_coo.F90 b/cuda/impl/psb_d_cuda_cp_hybg_from_coo.F90 index f1f62a89..b236a91d 100644 --- a/cuda/impl/psb_d_cuda_cp_hybg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_cp_hybg_from_coo.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_cp_hybg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_cp_hybg_from_coo -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none class(psb_d_cuda_hybg_sparse_mat), intent(inout) :: a @@ -49,10 +45,8 @@ subroutine psb_d_cuda_cp_hybg_from_coo(a,b,info) call a%psb_d_csr_sparse_mat%cp_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_d_cuda_cp_hybg_from_fmt.F90 b/cuda/impl/psb_d_cuda_cp_hybg_from_fmt.F90 index 37c9cc42..87d25252 100644 --- a/cuda/impl/psb_d_cuda_cp_hybg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_cp_hybg_from_fmt.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_cp_hybg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_cp_hybg_from_fmt -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none class(psb_d_cuda_hybg_sparse_mat), intent(inout) :: a @@ -53,9 +49,7 @@ subroutine psb_d_cuda_cp_hybg_from_fmt(a,b,info) class default call a%psb_d_csr_sparse_mat%cp_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_d_cuda_cp_hybg_from_fmt diff --git a/cuda/impl/psb_d_cuda_csrg_allocate_mnnz.F90 b/cuda/impl/psb_d_cuda_csrg_allocate_mnnz.F90 index 3858672c..056f2deb 100644 --- a/cuda/impl/psb_d_cuda_csrg_allocate_mnnz.F90 +++ b/cuda/impl/psb_d_cuda_csrg_allocate_mnnz.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_csrg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_allocate_mnnz -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_d_cuda_csrg_sparse_mat), intent(inout) :: a @@ -52,11 +48,9 @@ subroutine psb_d_cuda_csrg_allocate_mnnz(m,n,a,nz) call a%psb_d_csr_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU info = initFcusparse() if (info == 0) call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_csrg_csmm.F90 b/cuda/impl/psb_d_cuda_csrg_csmm.F90 index 58251d9a..ddac1373 100644 --- a/cuda/impl/psb_d_cuda_csrg_csmm.F90 +++ b/cuda/impl/psb_d_cuda_csrg_csmm.F90 @@ -33,14 +33,10 @@ subroutine psb_d_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_csmm -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none class(psb_d_cuda_csrg_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:,:) @@ -94,7 +90,6 @@ subroutine psb_d_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -119,9 +114,6 @@ subroutine psb_d_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_csrg_csmv.F90 b/cuda/impl/psb_d_cuda_csrg_csmv.F90 index 269760f0..c1c889f8 100644 --- a/cuda/impl/psb_d_cuda_csrg_csmv.F90 +++ b/cuda/impl/psb_d_cuda_csrg_csmv.F90 @@ -33,14 +33,10 @@ subroutine psb_d_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_csmv -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none class(psb_d_cuda_csrg_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -96,7 +92,6 @@ subroutine psb_d_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -124,9 +119,6 @@ subroutine psb_d_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_csrg_from_gpu.F90 b/cuda/impl/psb_d_cuda_csrg_from_gpu.F90 index c451a99f..9d1c2285 100644 --- a/cuda/impl/psb_d_cuda_csrg_from_gpu.F90 +++ b/cuda/impl/psb_d_cuda_csrg_from_gpu.F90 @@ -33,13 +33,9 @@ subroutine psb_d_cuda_csrg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_from_gpu -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none class(psb_d_cuda_csrg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +44,6 @@ subroutine psb_d_cuda_csrg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (.not.(c_associated(a%deviceMat%mat))) then call a%free() return @@ -68,6 +63,5 @@ subroutine psb_d_cuda_csrg_from_gpu(a,info) #endif call a%set_sync() -#endif end subroutine psb_d_cuda_csrg_from_gpu diff --git a/cuda/impl/psb_d_cuda_csrg_inner_vect_sv.F90 b/cuda/impl/psb_d_cuda_csrg_inner_vect_sv.F90 index 60ee541f..9a45ee17 100644 --- a/cuda/impl/psb_d_cuda_csrg_inner_vect_sv.F90 +++ b/cuda/impl/psb_d_cuda_csrg_inner_vect_sv.F90 @@ -32,13 +32,9 @@ subroutine psb_d_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_inner_vect_sv -#else - use psb_d_cuda_csrg_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_csrg_sparse_mat), intent(in) :: a @@ -75,7 +71,6 @@ subroutine psb_d_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra.or.(beta/=dzero)) then call x%sync() call y%sync() @@ -112,12 +107,6 @@ subroutine psb_d_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call x%sync() - call y%sync() - call a%psb_d_csr_sparse_mat%inner_spsm(alpha,x,beta,y,info,trans) - call y%set_host() -#endif if (info /= psb_success_) then info = psb_err_from_subroutine_ call psb_errpush(info,name, a_err='csrg_vect_sv') diff --git a/cuda/impl/psb_d_cuda_csrg_reallocate_nz.F90 b/cuda/impl/psb_d_cuda_csrg_reallocate_nz.F90 index dbf34958..c27cb943 100644 --- a/cuda/impl/psb_d_cuda_csrg_reallocate_nz.F90 +++ b/cuda/impl/psb_d_cuda_csrg_reallocate_nz.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_csrg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_reallocate_nz -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_d_cuda_csrg_sparse_mat), intent(inout) :: a @@ -55,10 +51,8 @@ subroutine psb_d_cuda_csrg_reallocate_nz(nz,a) ! call a%psb_d_csr_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_csrg_scal.F90 b/cuda/impl/psb_d_cuda_csrg_scal.F90 index 73e1b9f3..860e9396 100644 --- a/cuda/impl/psb_d_cuda_csrg_scal.F90 +++ b/cuda/impl/psb_d_cuda_csrg_scal.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_csrg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_scal -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none class(psb_d_cuda_csrg_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d(:) @@ -58,10 +54,8 @@ subroutine psb_d_cuda_csrg_scal(d,a,info,side) call a%psb_d_csr_sparse_mat%scal(d,info,side=side) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_csrg_scals.F90 b/cuda/impl/psb_d_cuda_csrg_scals.F90 index cf8d6270..87ef588d 100644 --- a/cuda/impl/psb_d_cuda_csrg_scals.F90 +++ b/cuda/impl/psb_d_cuda_csrg_scals.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_csrg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_scals -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none class(psb_d_cuda_csrg_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d @@ -56,10 +52,8 @@ subroutine psb_d_cuda_csrg_scals(d,a,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_csrg_to_gpu.F90 b/cuda/impl/psb_d_cuda_csrg_to_gpu.F90 index a0e72cb4..d1949421 100644 --- a/cuda/impl/psb_d_cuda_csrg_to_gpu.F90 +++ b/cuda/impl/psb_d_cuda_csrg_to_gpu.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_csrg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_to_gpu -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none class(psb_d_cuda_csrg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -51,7 +47,6 @@ subroutine psb_d_cuda_csrg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -320,6 +315,5 @@ subroutine psb_d_cuda_csrg_to_gpu(a,info,nzrm) if (info /= 0) then write(0,*) 'Error in CSRG_TO_GPU ',info end if -#endif end subroutine psb_d_cuda_csrg_to_gpu diff --git a/cuda/impl/psb_d_cuda_csrg_vect_mv.F90 b/cuda/impl/psb_d_cuda_csrg_vect_mv.F90 index b828d878..03fefbdd 100644 --- a/cuda/impl/psb_d_cuda_csrg_vect_mv.F90 +++ b/cuda/impl/psb_d_cuda_csrg_vect_mv.F90 @@ -33,14 +33,10 @@ subroutine psb_d_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_csrg_vect_mv -#else - use psb_d_cuda_csrg_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_csrg_sparse_mat), intent(in) :: a @@ -72,7 +68,6 @@ subroutine psb_d_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= dzero) then @@ -112,9 +107,6 @@ subroutine psb_d_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_diag_csmv.F90 b/cuda/impl/psb_d_cuda_diag_csmv.F90 index 8b49769e..0317a369 100644 --- a/cuda/impl/psb_d_cuda_diag_csmv.F90 +++ b/cuda/impl/psb_d_cuda_diag_csmv.F90 @@ -33,13 +33,9 @@ subroutine psb_d_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_d_cuda_diag_mat_mod, psb_protect_name => psb_d_cuda_diag_csmv -#else - use psb_d_cuda_diag_mat_mod -#endif implicit none class(psb_d_cuda_diag_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +90,6 @@ subroutine psb_d_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_d_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +116,6 @@ subroutine psb_d_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -132,5 +124,4 @@ subroutine psb_d_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) return - end subroutine psb_d_cuda_diag_csmv diff --git a/cuda/impl/psb_d_cuda_diag_to_gpu.F90 b/cuda/impl/psb_d_cuda_diag_to_gpu.F90 index 4903de8a..9b648962 100644 --- a/cuda/impl/psb_d_cuda_diag_to_gpu.F90 +++ b/cuda/impl/psb_d_cuda_diag_to_gpu.F90 @@ -33,13 +33,9 @@ subroutine psb_d_cuda_diag_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_d_cuda_diag_mat_mod, psb_protect_name => psb_d_cuda_diag_to_gpu -#else - use psb_d_cuda_diag_mat_mod -#endif use iso_c_binding implicit none class(psb_d_cuda_diag_sparse_mat), intent(inout) :: a @@ -47,13 +43,10 @@ subroutine psb_d_cuda_diag_to_gpu(a,info,nzrm) integer(psb_ipk_), intent(in), optional :: nzrm integer(psb_ipk_) :: m, nzm, n, c,pitch,maxrowsize,d -#ifdef HAVE_SPGPU type(diagdev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%data)).or.(.not.allocated(a%offset))) return n = size(a%data,1) @@ -69,6 +62,5 @@ subroutine psb_d_cuda_diag_to_gpu(a,info,nzrm) if (info == 0) info = & & writeDiagDevice(a%deviceMat,a%data,a%offset,n) ! if (info /= 0) goto 9999 -#endif end subroutine psb_d_cuda_diag_to_gpu diff --git a/cuda/impl/psb_d_cuda_diag_vect_mv.F90 b/cuda/impl/psb_d_cuda_diag_vect_mv.F90 index 0f23d363..3bc2372d 100644 --- a/cuda/impl/psb_d_cuda_diag_vect_mv.F90 +++ b/cuda/impl/psb_d_cuda_diag_vect_mv.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_d_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_d_cuda_diag_mat_mod, psb_protect_name => psb_d_cuda_diag_vect_mv -#else - use psb_d_cuda_diag_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_diag_sparse_mat), intent(in) :: a @@ -71,7 +65,6 @@ subroutine psb_d_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= szero) then @@ -112,9 +105,6 @@ subroutine psb_d_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_d_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_dnsg_mat_impl.F90 b/cuda/impl/psb_d_cuda_dnsg_mat_impl.F90 index 8d922d82..e90e816a 100644 --- a/cuda/impl/psb_d_cuda_dnsg_mat_impl.F90 +++ b/cuda/impl/psb_d_cuda_dnsg_mat_impl.F90 @@ -32,13 +32,9 @@ subroutine psb_d_cuda_dnsg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod use psb_d_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_d_vectordev_mod use psb_d_cuda_dnsg_mat_mod, psb_protect_name => psb_d_cuda_dnsg_vect_mv -#else - use psb_d_cuda_dnsg_mat_mod -#endif implicit none class(psb_d_cuda_dnsg_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta @@ -123,13 +119,9 @@ end subroutine psb_d_cuda_dnsg_vect_mv subroutine psb_d_cuda_dnsg_mold(a,b,info) use psb_base_mod use psb_d_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_d_vectordev_mod use psb_d_cuda_dnsg_mat_mod, psb_protect_name => psb_d_cuda_dnsg_mold -#else - use psb_d_cuda_dnsg_mat_mod -#endif implicit none class(psb_d_cuda_dnsg_sparse_mat), intent(in) :: a class(psb_d_base_sparse_mat), intent(inout), allocatable :: b @@ -190,17 +182,12 @@ end subroutine psb_d_cuda_dnsg_mold !!$ end subroutine psb_d_cuda_dnsg_allocate_mnnz !!$ end interface - subroutine psb_d_cuda_dnsg_to_gpu(a,info) use psb_base_mod use psb_d_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_d_vectordev_mod use psb_d_cuda_dnsg_mat_mod, psb_protect_name => psb_d_cuda_dnsg_to_gpu -#else - use psb_d_cuda_dnsg_mat_mod -#endif class(psb_d_cuda_dnsg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info Integer(Psb_ipk_) :: err_act, pitch, lda @@ -209,15 +196,12 @@ subroutine psb_d_cuda_dnsg_to_gpu(a,info) call psb_erractionsave(err_act) info = psb_success_ -#ifdef HAVE_SPGPU if (debug) write(0,*) 'DNS_TO_GPU',size(a%val,1),size(a%val,2) info = FallocDnsDevice(a%deviceMat,a%get_nrows(),a%get_ncols(),& & spgpu_type_double,1) if (info == 0) info = writeDnsDevice(a%deviceMat,a%val,size(a%val,1),size(a%val,2)) if (debug) write(0,*) 'DNS_TO_GPU: From writeDnsDEvice',info - -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return @@ -233,13 +217,9 @@ end subroutine psb_d_cuda_dnsg_to_gpu subroutine psb_d_cuda_cp_dnsg_from_coo(a,b,info) use psb_base_mod use psb_d_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_d_vectordev_mod use psb_d_cuda_dnsg_mat_mod, psb_protect_name => psb_d_cuda_cp_dnsg_from_coo -#else - use psb_d_cuda_dnsg_mat_mod -#endif implicit none class(psb_d_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -272,13 +252,9 @@ end subroutine psb_d_cuda_cp_dnsg_from_coo subroutine psb_d_cuda_cp_dnsg_from_fmt(a,b,info) use psb_base_mod use psb_d_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_d_vectordev_mod use psb_d_cuda_dnsg_mat_mod, psb_protect_name => psb_d_cuda_cp_dnsg_from_fmt -#else - use psb_d_cuda_dnsg_mat_mod -#endif implicit none class(psb_d_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -348,13 +324,9 @@ end subroutine psb_d_cuda_cp_dnsg_from_fmt subroutine psb_d_cuda_mv_dnsg_from_coo(a,b,info) use psb_base_mod use psb_d_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_d_vectordev_mod use psb_d_cuda_dnsg_mat_mod, psb_protect_name => psb_d_cuda_mv_dnsg_from_coo -#else - use psb_d_cuda_dnsg_mat_mod -#endif implicit none class(psb_d_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -383,18 +355,13 @@ subroutine psb_d_cuda_mv_dnsg_from_coo(a,b,info) return end subroutine psb_d_cuda_mv_dnsg_from_coo - - + subroutine psb_d_cuda_mv_dnsg_from_fmt(a,b,info) use psb_base_mod use psb_d_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_d_vectordev_mod use psb_d_cuda_dnsg_mat_mod, psb_protect_name => psb_d_cuda_mv_dnsg_from_fmt -#else - use psb_d_cuda_dnsg_mat_mod -#endif implicit none class(psb_d_cuda_dnsg_sparse_mat), intent(inout) :: a class(psb_d_base_sparse_mat), intent(inout) :: b diff --git a/cuda/impl/psb_d_cuda_elg_allocate_mnnz.F90 b/cuda/impl/psb_d_cuda_elg_allocate_mnnz.F90 index b9308514..6db20c96 100644 --- a/cuda/impl/psb_d_cuda_elg_allocate_mnnz.F90 +++ b/cuda/impl/psb_d_cuda_elg_allocate_mnnz.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_d_cuda_elg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_allocate_mnnz -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a @@ -47,9 +41,7 @@ subroutine psb_d_cuda_elg_allocate_mnnz(m,n,a,nz) Integer(Psb_ipk_) :: err_act, info, nz_,ld character(len=20) :: name='allocate_mnz' logical, parameter :: debug=.false. -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif call psb_erractionsave(err_act) info = psb_success_ @@ -74,13 +66,9 @@ subroutine psb_d_cuda_elg_allocate_mnnz(m,n,a,nz) goto 9999 endif -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nz_,nz_*m,n,spgpu_type_double,1) ld = gpu_parms%pitch nz_ = gpu_parms%maxRowSize -#else - ld = m -#endif if (info == psb_success_) call psb_realloc(m,a%irn,info) if (info == psb_success_) call psb_realloc(m,a%idiag,info) @@ -98,10 +86,8 @@ subroutine psb_d_cuda_elg_allocate_mnnz(m,n,a,nz) call a%set_dupl(psb_dupl_def_) end if -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz_) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_elg_asb.f90 b/cuda/impl/psb_d_cuda_elg_asb.f90 index c158ccde..7d510ee2 100644 --- a/cuda/impl/psb_d_cuda_elg_asb.f90 +++ b/cuda/impl/psb_d_cuda_elg_asb.f90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_asb(a) use psb_base_mod diff --git a/cuda/impl/psb_d_cuda_elg_csmm.F90 b/cuda/impl/psb_d_cuda_elg_csmm.F90 index 2d9883fa..f77d72d8 100644 --- a/cuda/impl/psb_d_cuda_elg_csmm.F90 +++ b/cuda/impl/psb_d_cuda_elg_csmm.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_csmm -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:,:) @@ -92,8 +87,6 @@ subroutine psb_d_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) goto 9999 end if - -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() call a%psb_d_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) @@ -119,9 +112,6 @@ subroutine psb_d_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_elg_csmv.F90 b/cuda/impl/psb_d_cuda_elg_csmv.F90 index 6420e28d..351ad99d 100644 --- a/cuda/impl/psb_d_cuda_elg_csmv.F90 +++ b/cuda/impl/psb_d_cuda_elg_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_csmv -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_d_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() call a%psb_d_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) @@ -122,9 +116,6 @@ subroutine psb_d_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_elg_csput.F90 b/cuda/impl/psb_d_cuda_elg_csput.F90 index 19d26c43..0d16de1f 100644 --- a/cuda/impl/psb_d_cuda_elg_csput.F90 +++ b/cuda/impl/psb_d_cuda_elg_csput.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_base_mod use iso_c_binding -#ifdef HAVE_SPGPU use elldev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_csput_a -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a @@ -128,13 +123,9 @@ subroutine psb_d_cuda_elg_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_base_mod use iso_c_binding -#ifdef HAVE_SPGPU use elldev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_csput_v use psb_d_cuda_vect_mod -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_d_cuda_elg_from_gpu.F90 b/cuda/impl/psb_d_cuda_elg_from_gpu.F90 index b532a83c..720a6d73 100644 --- a/cuda/impl/psb_d_cuda_elg_from_gpu.F90 +++ b/cuda/impl/psb_d_cuda_elg_from_gpu.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - + subroutine psb_d_cuda_elg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_from_gpu -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +43,6 @@ subroutine psb_d_cuda_elg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (.not.(c_associated(a%deviceMat))) then call a%free() return @@ -69,6 +63,5 @@ subroutine psb_d_cuda_elg_from_gpu(a,info) if (info == 0) info = & & readEllDevice(a%deviceMat,a%val,a%ja,pitch,a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_d_cuda_elg_from_gpu diff --git a/cuda/impl/psb_d_cuda_elg_inner_vect_sv.F90 b/cuda/impl/psb_d_cuda_elg_inner_vect_sv.F90 index c262969f..5e5d72ef 100644 --- a/cuda/impl/psb_d_cuda_elg_inner_vect_sv.F90 +++ b/cuda/impl/psb_d_cuda_elg_inner_vect_sv.F90 @@ -27,19 +27,14 @@ ! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. -! - +! subroutine psb_d_cuda_elg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_inner_vect_sv -#else - use psb_d_cuda_elg_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_elg_sparse_mat), intent(in) :: a diff --git a/cuda/impl/psb_d_cuda_elg_mold.F90 b/cuda/impl/psb_d_cuda_elg_mold.F90 index f887f96f..107f19af 100644 --- a/cuda/impl/psb_d_cuda_elg_mold.F90 +++ b/cuda/impl/psb_d_cuda_elg_mold.F90 @@ -28,8 +28,6 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_d_cuda_elg_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_d_cuda_elg_reallocate_nz.F90 b/cuda/impl/psb_d_cuda_elg_reallocate_nz.F90 index 66c583e1..47464760 100644 --- a/cuda/impl/psb_d_cuda_elg_reallocate_nz.F90 +++ b/cuda/impl/psb_d_cuda_elg_reallocate_nz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_reallocate_nz -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a @@ -64,10 +59,8 @@ subroutine psb_d_cuda_elg_reallocate_nz(nz,a) goto 9999 end if -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nzrm) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_elg_scal.F90 b/cuda/impl/psb_d_cuda_elg_scal.F90 index 7aa21c93..420c710e 100644 --- a/cuda/impl/psb_d_cuda_elg_scal.F90 +++ b/cuda/impl/psb_d_cuda_elg_scal.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_scal -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d(:) @@ -63,10 +58,8 @@ subroutine psb_d_cuda_elg_scal(d,a,info,side) call a%psb_d_ell_sparse_mat%scal(d,info,side) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_elg_scals.F90 b/cuda/impl/psb_d_cuda_elg_scals.F90 index 1950b366..ff22002e 100644 --- a/cuda/impl/psb_d_cuda_elg_scals.F90 +++ b/cuda/impl/psb_d_cuda_elg_scals.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_scals -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d @@ -59,10 +54,8 @@ subroutine psb_d_cuda_elg_scals(d,a,info) a%val(:,:) = a%val(:,:) * d -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_d_cuda_elg_to_gpu.F90 b/cuda/impl/psb_d_cuda_elg_to_gpu.F90 index b589ec2d..9b88af69 100644 --- a/cuda/impl/psb_d_cuda_elg_to_gpu.F90 +++ b/cuda/impl/psb_d_cuda_elg_to_gpu.F90 @@ -29,30 +29,22 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_to_gpu -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(in), optional :: nzrm integer(psb_ipk_) :: m, nzm, n, pitch,maxrowsize, nzt -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -88,6 +80,5 @@ subroutine psb_d_cuda_elg_to_gpu(a,info,nzrm) if (info == 0) info = & & writeEllDevice(a%deviceMat,a%val,a%ja,size(a%ja,1),a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_d_cuda_elg_to_gpu diff --git a/cuda/impl/psb_d_cuda_elg_trim.f90 b/cuda/impl/psb_d_cuda_elg_trim.f90 index be573c8c..a371c673 100644 --- a/cuda/impl/psb_d_cuda_elg_trim.f90 +++ b/cuda/impl/psb_d_cuda_elg_trim.f90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_trim(a) use psb_base_mod diff --git a/cuda/impl/psb_d_cuda_elg_vect_mv.F90 b/cuda/impl/psb_d_cuda_elg_vect_mv.F90 index 1be57d22..f0b83c2b 100644 --- a/cuda/impl/psb_d_cuda_elg_vect_mv.F90 +++ b/cuda/impl/psb_d_cuda_elg_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_elg_vect_mv -#else - use psb_d_cuda_elg_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_elg_sparse_mat), intent(in) :: a @@ -71,7 +66,6 @@ subroutine psb_d_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() if (.not.x%is_host()) call x%sync() @@ -116,10 +110,6 @@ subroutine psb_d_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - if (a%is_dev()) call a%sync() - call a%psb_d_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hdiag_csmv.F90 b/cuda/impl/psb_d_cuda_hdiag_csmv.F90 index 4bcd6e7a..bf4dacc1 100644 --- a/cuda/impl/psb_d_cuda_hdiag_csmv.F90 +++ b/cuda/impl/psb_d_cuda_hdiag_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_d_cuda_hdiag_mat_mod, psb_protect_name => psb_d_cuda_hdiag_csmv -#else - use psb_d_cuda_hdiag_mat_mod -#endif implicit none class(psb_d_cuda_hdiag_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_d_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_d_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_d_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -132,5 +123,4 @@ subroutine psb_d_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) return - end subroutine psb_d_cuda_hdiag_csmv diff --git a/cuda/impl/psb_d_cuda_hdiag_mold.F90 b/cuda/impl/psb_d_cuda_hdiag_mold.F90 index c5028c07..b858b56d 100644 --- a/cuda/impl/psb_d_cuda_hdiag_mold.F90 +++ b/cuda/impl/psb_d_cuda_hdiag_mold.F90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hdiag_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_d_cuda_hdiag_to_gpu.F90 b/cuda/impl/psb_d_cuda_hdiag_to_gpu.F90 index ca79b9fa..73c4a47d 100644 --- a/cuda/impl/psb_d_cuda_hdiag_to_gpu.F90 +++ b/cuda/impl/psb_d_cuda_hdiag_to_gpu.F90 @@ -29,29 +29,21 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hdiag_to_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_d_cuda_hdiag_mat_mod, psb_protect_name => psb_d_cuda_hdiag_to_gpu -#else - use psb_d_cuda_hdiag_mat_mod -#endif use iso_c_binding implicit none class(psb_d_cuda_hdiag_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: nr, nc, hacksize, hackcount, allocheight -#ifdef HAVE_SPGPU type(hdiagdev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU nr = a%get_nrows() nc = a%get_ncols() hacksize = a%hackSize @@ -81,6 +73,4 @@ subroutine psb_d_cuda_hdiag_to_gpu(a,info) if (info == 0) info = & & writeHdiagDevice(a%deviceMat,a%val,a%diaOffsets,a%hackOffsets) -#endif - end subroutine psb_d_cuda_hdiag_to_gpu diff --git a/cuda/impl/psb_d_cuda_hdiag_vect_mv.F90 b/cuda/impl/psb_d_cuda_hdiag_vect_mv.F90 index 74233f90..c18c80ac 100644 --- a/cuda/impl/psb_d_cuda_hdiag_vect_mv.F90 +++ b/cuda/impl/psb_d_cuda_hdiag_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_d_cuda_hdiag_mat_mod, psb_protect_name => psb_d_cuda_hdiag_vect_mv -#else - use psb_d_cuda_hdiag_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_hdiag_sparse_mat), intent(in) :: a @@ -71,7 +66,6 @@ subroutine psb_d_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= dzero) then @@ -112,9 +106,6 @@ subroutine psb_d_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_d_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hlg_allocate_mnnz.F90 b/cuda/impl/psb_d_cuda_hlg_allocate_mnnz.F90 index 3382327f..68d9ab50 100644 --- a/cuda/impl/psb_d_cuda_hlg_allocate_mnnz.F90 +++ b/cuda/impl/psb_d_cuda_hlg_allocate_mnnz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_allocate_mnnz -#else - use psb_d_cuda_hlg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_d_cuda_hlg_sparse_mat), intent(inout) :: a @@ -47,19 +42,15 @@ subroutine psb_d_cuda_hlg_allocate_mnnz(m,n,a,nz) Integer(psb_ipk_) :: err_act, info, nz_,ld character(len=20) :: name='allocate_mnz' logical, parameter :: debug=.false. -#ifdef HAVE_SPGPU type(hlldev_parms) :: gpu_parms -#endif call psb_erractionsave(err_act) info = psb_success_ call a%psb_d_hll_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz_) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hlg_csmm.F90 b/cuda/impl/psb_d_cuda_hlg_csmm.F90 index a223aace..ee8424e6 100644 --- a/cuda/impl/psb_d_cuda_hlg_csmm.F90 +++ b/cuda/impl/psb_d_cuda_hlg_csmm.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_csmm -#else - use psb_d_cuda_hlg_mat_mod -#endif implicit none class(psb_d_cuda_hlg_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:,:) @@ -93,7 +88,6 @@ subroutine psb_d_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_d_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -118,9 +112,6 @@ subroutine psb_d_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -128,5 +119,4 @@ subroutine psb_d_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) return - end subroutine psb_d_cuda_hlg_csmm diff --git a/cuda/impl/psb_d_cuda_hlg_csmv.F90 b/cuda/impl/psb_d_cuda_hlg_csmv.F90 index 04779296..58892c1f 100644 --- a/cuda/impl/psb_d_cuda_hlg_csmv.F90 +++ b/cuda/impl/psb_d_cuda_hlg_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_csmv -#else - use psb_d_cuda_hlg_mat_mod -#endif implicit none class(psb_d_cuda_hlg_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_d_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_d_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_d_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hlg_from_gpu.F90 b/cuda/impl/psb_d_cuda_hlg_from_gpu.F90 index 7c1a2de8..752fd944 100644 --- a/cuda/impl/psb_d_cuda_hlg_from_gpu.F90 +++ b/cuda/impl/psb_d_cuda_hlg_from_gpu.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_from_gpu -#else - use psb_d_cuda_hlg_mat_mod -#endif implicit none class(psb_d_cuda_hlg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +43,6 @@ subroutine psb_d_cuda_hlg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (a%is_sync()) return if (a%is_host()) return if (.not.(c_associated(a%deviceMat))) then @@ -71,6 +65,5 @@ subroutine psb_d_cuda_hlg_from_gpu(a,info) if (info == 0) info = & & readHllDevice(a%deviceMat,a%val,a%ja,a%hkoffs,a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_d_cuda_hlg_from_gpu diff --git a/cuda/impl/psb_d_cuda_hlg_inner_vect_sv.F90 b/cuda/impl/psb_d_cuda_hlg_inner_vect_sv.F90 index c6bd68b5..f4a0424d 100644 --- a/cuda/impl/psb_d_cuda_hlg_inner_vect_sv.F90 +++ b/cuda/impl/psb_d_cuda_hlg_inner_vect_sv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_inner_vect_sv -#else - use psb_d_cuda_hlg_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_hlg_sparse_mat), intent(in) :: a @@ -69,11 +64,9 @@ subroutine psb_d_cuda_hlg_inner_vect_sv(alpha,a,x,beta,y,info,trans) goto 9999 end if - call psb_erractionrestore(err_act) return - 9999 call psb_error_handler(err_act) return diff --git a/cuda/impl/psb_d_cuda_hlg_mold.F90 b/cuda/impl/psb_d_cuda_hlg_mold.F90 index dddce134..e41d56f2 100644 --- a/cuda/impl/psb_d_cuda_hlg_mold.F90 +++ b/cuda/impl/psb_d_cuda_hlg_mold.F90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_d_cuda_hlg_reallocate_nz.F90 b/cuda/impl/psb_d_cuda_hlg_reallocate_nz.F90 index aa2954d6..e696d304 100644 --- a/cuda/impl/psb_d_cuda_hlg_reallocate_nz.F90 +++ b/cuda/impl/psb_d_cuda_hlg_reallocate_nz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_reallocate_nz -#else - use psb_d_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none integer(psb_ipk_), intent(in) :: nz @@ -52,10 +47,8 @@ subroutine psb_d_cuda_hlg_reallocate_nz(nz,a) call a%psb_d_hll_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hlg_scal.F90 b/cuda/impl/psb_d_cuda_hlg_scal.F90 index 3cbfada0..042e5805 100644 --- a/cuda/impl/psb_d_cuda_hlg_scal.F90 +++ b/cuda/impl/psb_d_cuda_hlg_scal.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_scal -#else - use psb_d_cuda_hlg_mat_mod -#endif implicit none class(psb_d_cuda_hlg_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d(:) @@ -60,10 +55,8 @@ subroutine psb_d_cuda_hlg_scal(d,a,info,side) call a%psb_d_hll_sparse_mat%scal(d,info,side) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hlg_scals.F90 b/cuda/impl/psb_d_cuda_hlg_scals.F90 index 1ddf764f..4c81faa9 100644 --- a/cuda/impl/psb_d_cuda_hlg_scals.F90 +++ b/cuda/impl/psb_d_cuda_hlg_scals.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_scals -#else - use psb_d_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none class(psb_d_cuda_hlg_sparse_mat), intent(inout) :: a @@ -59,10 +54,8 @@ subroutine psb_d_cuda_hlg_scals(d,a,info) call a%psb_d_hll_sparse_mat%scal(d,info) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hlg_to_gpu.F90 b/cuda/impl/psb_d_cuda_hlg_to_gpu.F90 index 82737315..566c94bd 100644 --- a/cuda/impl/psb_d_cuda_hlg_to_gpu.F90 +++ b/cuda/impl/psb_d_cuda_hlg_to_gpu.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_to_gpu -#else - use psb_d_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none class(psb_d_cuda_hlg_sparse_mat), intent(inout) :: a @@ -50,7 +45,6 @@ subroutine psb_d_cuda_hlg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return n = a%get_nrows() @@ -63,6 +57,5 @@ subroutine psb_d_cuda_hlg_to_gpu(a,info,nzrm) if (info == 0) info = & & writehllDevice(a%deviceMat,a%val,a%ja,a%hkoffs,a%irn,a%idiag) ! if (info /= 0) goto 9999 -#endif end subroutine psb_d_cuda_hlg_to_gpu diff --git a/cuda/impl/psb_d_cuda_hlg_vect_mv.F90 b/cuda/impl/psb_d_cuda_hlg_vect_mv.F90 index 9d0741c4..cccba74b 100644 --- a/cuda/impl/psb_d_cuda_hlg_vect_mv.F90 +++ b/cuda/impl/psb_d_cuda_hlg_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_hlg_vect_mv -#else - use psb_d_cuda_hlg_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_hlg_sparse_mat), intent(in) :: a @@ -69,9 +64,7 @@ subroutine psb_d_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) goto 9999 endif - tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= dzero) then @@ -115,9 +108,6 @@ subroutine psb_d_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_d_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hybg_allocate_mnnz.F90 b/cuda/impl/psb_d_cuda_hybg_allocate_mnnz.F90 index b0bff6c0..50bef667 100644 --- a/cuda/impl/psb_d_cuda_hybg_allocate_mnnz.F90 +++ b/cuda/impl/psb_d_cuda_hybg_allocate_mnnz.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_hybg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_hybg_allocate_mnnz -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_d_cuda_hybg_sparse_mat), intent(inout) :: a @@ -52,11 +48,9 @@ subroutine psb_d_cuda_hybg_allocate_mnnz(m,n,a,nz) call a%psb_d_csr_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU info = initFcusparse() call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hybg_csmm.F90 b/cuda/impl/psb_d_cuda_hybg_csmm.F90 index 3fcfd17f..d5b49829 100644 --- a/cuda/impl/psb_d_cuda_hybg_csmm.F90 +++ b/cuda/impl/psb_d_cuda_hybg_csmm.F90 @@ -33,14 +33,10 @@ subroutine psb_d_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_hybg_csmm -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none class(psb_d_cuda_hybg_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:,:) @@ -92,8 +88,6 @@ subroutine psb_d_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) goto 9999 end if - -#ifdef HAVE_SPGPU if (tra) then call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_d_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hybg_csmv.F90 b/cuda/impl/psb_d_cuda_hybg_csmv.F90 index 5e06f633..b29b889a 100644 --- a/cuda/impl/psb_d_cuda_hybg_csmv.F90 +++ b/cuda/impl/psb_d_cuda_hybg_csmv.F90 @@ -33,14 +33,10 @@ subroutine psb_d_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_hybg_csmv -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none class(psb_d_cuda_hybg_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -95,7 +91,6 @@ subroutine psb_d_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -123,9 +118,6 @@ subroutine psb_d_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hybg_inner_vect_sv.F90 b/cuda/impl/psb_d_cuda_hybg_inner_vect_sv.F90 index a30c1abe..6f5eba3b 100644 --- a/cuda/impl/psb_d_cuda_hybg_inner_vect_sv.F90 +++ b/cuda/impl/psb_d_cuda_hybg_inner_vect_sv.F90 @@ -33,13 +33,9 @@ subroutine psb_d_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_hybg_inner_vect_sv -#else - use psb_d_cuda_hybg_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_hybg_sparse_mat), intent(in) :: a @@ -76,7 +72,6 @@ subroutine psb_d_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra.or.(beta/=dzero)) then call x%sync() call y%sync() @@ -113,12 +108,6 @@ subroutine psb_d_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call x%sync() - call y%sync() - call a%psb_d_csr_sparse_mat%inner_spsm(alpha,x,beta,y,info,trans) - call y%set_host() -#endif if (info /= psb_success_) then info = psb_err_from_subroutine_ call psb_errpush(info,name, a_err='hybg_vect_sv') diff --git a/cuda/impl/psb_d_cuda_hybg_reallocate_nz.F90 b/cuda/impl/psb_d_cuda_hybg_reallocate_nz.F90 index cadce8d3..f44c3f10 100644 --- a/cuda/impl/psb_d_cuda_hybg_reallocate_nz.F90 +++ b/cuda/impl/psb_d_cuda_hybg_reallocate_nz.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_hybg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_hybg_reallocate_nz -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_d_cuda_hybg_sparse_mat), intent(inout) :: a @@ -55,10 +51,8 @@ subroutine psb_d_cuda_hybg_reallocate_nz(nz,a) ! call a%psb_d_csr_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hybg_scal.F90 b/cuda/impl/psb_d_cuda_hybg_scal.F90 index 126e25cb..5be8d801 100644 --- a/cuda/impl/psb_d_cuda_hybg_scal.F90 +++ b/cuda/impl/psb_d_cuda_hybg_scal.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_hybg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_hybg_scal -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none class(psb_d_cuda_hybg_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d(:) @@ -60,10 +56,8 @@ subroutine psb_d_cuda_hybg_scal(d,a,info,side) call a%psb_d_csr_sparse_mat%scal(d,info,side=side) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hybg_scals.F90 b/cuda/impl/psb_d_cuda_hybg_scals.F90 index 88b7e05c..59e21dd2 100644 --- a/cuda/impl/psb_d_cuda_hybg_scals.F90 +++ b/cuda/impl/psb_d_cuda_hybg_scals.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_hybg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_hybg_scals -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none class(psb_d_cuda_hybg_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d @@ -60,10 +56,8 @@ subroutine psb_d_cuda_hybg_scals(d,a,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_hybg_to_gpu.F90 b/cuda/impl/psb_d_cuda_hybg_to_gpu.F90 index d94a75c7..7b8e2e5f 100644 --- a/cuda/impl/psb_d_cuda_hybg_to_gpu.F90 +++ b/cuda/impl/psb_d_cuda_hybg_to_gpu.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_hybg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_hybg_to_gpu -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none class(psb_d_cuda_hybg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -51,7 +47,6 @@ subroutine psb_d_cuda_hybg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -148,7 +143,6 @@ subroutine psb_d_cuda_hybg_to_gpu(a,info,nzrm) if (info /= 0) then write(0,*) 'Error in HYBG_TO_GPU ',info end if -#endif end subroutine psb_d_cuda_hybg_to_gpu #endif diff --git a/cuda/impl/psb_d_cuda_hybg_vect_mv.F90 b/cuda/impl/psb_d_cuda_hybg_vect_mv.F90 index 9d0aedb7..f1119439 100644 --- a/cuda/impl/psb_d_cuda_hybg_vect_mv.F90 +++ b/cuda/impl/psb_d_cuda_hybg_vect_mv.F90 @@ -33,14 +33,10 @@ subroutine psb_d_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_hybg_vect_mv -#else - use psb_d_cuda_hybg_mat_mod -#endif use psb_d_cuda_vect_mod implicit none class(psb_d_cuda_hybg_sparse_mat), intent(in) :: a @@ -71,8 +67,6 @@ subroutine psb_d_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') - -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= dzero) then @@ -112,9 +106,6 @@ subroutine psb_d_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call a%psb_d_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_d_cuda_mv_csrg_from_coo.F90 b/cuda/impl/psb_d_cuda_mv_csrg_from_coo.F90 index 18e7c636..559bfb2c 100644 --- a/cuda/impl/psb_d_cuda_mv_csrg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_mv_csrg_from_coo.F90 @@ -29,16 +29,11 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_mv_csrg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_mv_csrg_from_coo -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none class(psb_d_cuda_csrg_sparse_mat), intent(inout) :: a @@ -51,9 +46,7 @@ subroutine psb_d_cuda_mv_csrg_from_coo(a,b,info) call a%psb_d_csr_sparse_mat%mv_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif if (info /= 0) goto 9999 return diff --git a/cuda/impl/psb_d_cuda_mv_csrg_from_fmt.F90 b/cuda/impl/psb_d_cuda_mv_csrg_from_fmt.F90 index 837c78c1..c2411e90 100644 --- a/cuda/impl/psb_d_cuda_mv_csrg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_mv_csrg_from_fmt.F90 @@ -29,16 +29,11 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_mv_csrg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_csrg_mat_mod, psb_protect_name => psb_d_cuda_mv_csrg_from_fmt -#else - use psb_d_cuda_csrg_mat_mod -#endif implicit none class(psb_d_cuda_csrg_sparse_mat), intent(inout) :: a @@ -55,9 +50,7 @@ subroutine psb_d_cuda_mv_csrg_from_fmt(a,b,info) class default call a%psb_d_csr_sparse_mat%mv_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_d_cuda_mv_csrg_from_fmt diff --git a/cuda/impl/psb_d_cuda_mv_diag_from_coo.F90 b/cuda/impl/psb_d_cuda_mv_diag_from_coo.F90 index 8d33c459..a6a39a1c 100644 --- a/cuda/impl/psb_d_cuda_mv_diag_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_mv_diag_from_coo.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_mv_diag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_d_cuda_diag_mat_mod, psb_protect_name => psb_d_cuda_mv_diag_from_coo -#else - use psb_d_cuda_diag_mat_mod -#endif implicit none diff --git a/cuda/impl/psb_d_cuda_mv_elg_from_coo.F90 b/cuda/impl/psb_d_cuda_mv_elg_from_coo.F90 index ad9e7f10..9886e90c 100644 --- a/cuda/impl/psb_d_cuda_mv_elg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_mv_elg_from_coo.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_d_cuda_mv_elg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_mv_elg_from_coo -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a @@ -57,5 +52,4 @@ subroutine psb_d_cuda_mv_elg_from_coo(a,b,info) return - end subroutine psb_d_cuda_mv_elg_from_coo diff --git a/cuda/impl/psb_d_cuda_mv_elg_from_fmt.F90 b/cuda/impl/psb_d_cuda_mv_elg_from_fmt.F90 index 9cdf790e..da2d47a1 100644 --- a/cuda/impl/psb_d_cuda_mv_elg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_mv_elg_from_fmt.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - + subroutine psb_d_cuda_mv_elg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_d_cuda_elg_mat_mod, psb_protect_name => psb_d_cuda_mv_elg_from_fmt -#else - use psb_d_cuda_elg_mat_mod -#endif implicit none class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a @@ -49,9 +44,7 @@ subroutine psb_d_cuda_mv_elg_from_fmt(a,b,info) !locals type(psb_d_coo_sparse_mat) :: tmp Integer(Psb_ipk_) :: nza, nr, i,j,irw, idl,err_act, nc, ld, nzm, m -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = psb_success_ @@ -65,13 +58,9 @@ subroutine psb_d_cuda_mv_elg_from_fmt(a,b,info) m = b%get_nrows() nc = b%get_ncols() nza = b%get_nzeros() -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) ld = gpu_parms%pitch nzm = gpu_parms%maxRowSize -#else - ld = m -#endif a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat call move_alloc(b%irn, a%irn) call move_alloc(b%idiag, a%idiag) @@ -87,9 +76,7 @@ subroutine psb_d_cuda_mv_elg_from_fmt(a,b,info) end if a%nzt = nza call b%free() -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif class default call b%mv_to_coo(tmp,info) diff --git a/cuda/impl/psb_d_cuda_mv_hdiag_from_coo.F90 b/cuda/impl/psb_d_cuda_mv_hdiag_from_coo.F90 index aff5e0c0..b3c4f650 100644 --- a/cuda/impl/psb_d_cuda_mv_hdiag_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_mv_hdiag_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_d_cuda_mv_hdiag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_d_cuda_hdiag_mat_mod, psb_protect_name => psb_d_cuda_mv_hdiag_from_coo use psb_cuda_env_mod -#else - use psb_d_cuda_hdiag_mat_mod -#endif implicit none @@ -54,16 +48,12 @@ subroutine psb_d_cuda_mv_hdiag_from_coo(a,b,info) info = psb_success_ -#ifdef HAVE_SPGPU a%hacksize = psb_cuda_WarpSize() -#endif call a%psb_d_hdia_sparse_mat%mv_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_d_cuda_mv_hlg_from_coo.F90 b/cuda/impl/psb_d_cuda_mv_hlg_from_coo.F90 index a2b358c4..95e86293 100644 --- a/cuda/impl/psb_d_cuda_mv_hlg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_mv_hlg_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_d_cuda_mv_hlg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_cuda_env_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_mv_hlg_from_coo -#else - use psb_d_cuda_hlg_mat_mod -#endif implicit none class(psb_d_cuda_hlg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_d_cuda_mv_hlg_from_fmt.F90 b/cuda/impl/psb_d_cuda_mv_hlg_from_fmt.F90 index 130d88c2..02578b19 100644 --- a/cuda/impl/psb_d_cuda_mv_hlg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_mv_hlg_from_fmt.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_d_cuda_mv_hlg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_d_cuda_hlg_mat_mod, psb_protect_name => psb_d_cuda_mv_hlg_from_fmt -#else - use psb_d_cuda_hlg_mat_mod -#endif implicit none class(psb_d_cuda_hlg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_d_cuda_mv_hybg_from_coo.F90 b/cuda/impl/psb_d_cuda_mv_hybg_from_coo.F90 index 8b0ad032..3113fb13 100644 --- a/cuda/impl/psb_d_cuda_mv_hybg_from_coo.F90 +++ b/cuda/impl/psb_d_cuda_mv_hybg_from_coo.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_mv_hybg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_mv_hybg_from_coo -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none class(psb_d_cuda_hybg_sparse_mat), intent(inout) :: a @@ -50,10 +46,8 @@ subroutine psb_d_cuda_mv_hybg_from_coo(a,b,info) call a%psb_d_csr_sparse_mat%mv_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_d_cuda_mv_hybg_from_fmt.F90 b/cuda/impl/psb_d_cuda_mv_hybg_from_fmt.F90 index 71badfc5..520792e9 100644 --- a/cuda/impl/psb_d_cuda_mv_hybg_from_fmt.F90 +++ b/cuda/impl/psb_d_cuda_mv_hybg_from_fmt.F90 @@ -33,12 +33,8 @@ subroutine psb_d_cuda_mv_hybg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_d_cuda_hybg_mat_mod, psb_protect_name => psb_d_cuda_mv_hybg_from_fmt -#else - use psb_d_cuda_hybg_mat_mod -#endif implicit none class(psb_d_cuda_hybg_sparse_mat), intent(inout) :: a @@ -54,9 +50,7 @@ subroutine psb_d_cuda_mv_hybg_from_fmt(a,b,info) class default call a%psb_d_csr_sparse_mat%mv_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_d_cuda_mv_hybg_from_fmt #endif diff --git a/cuda/impl/psb_s_cuda_cp_csrg_from_coo.F90 b/cuda/impl/psb_s_cuda_cp_csrg_from_coo.F90 index b7bebc95..0e3f9113 100644 --- a/cuda/impl/psb_s_cuda_cp_csrg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_cp_csrg_from_coo.F90 @@ -32,12 +32,8 @@ subroutine psb_s_cuda_cp_csrg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_cp_csrg_from_coo -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none class(psb_s_cuda_csrg_sparse_mat), intent(inout) :: a @@ -48,10 +44,8 @@ subroutine psb_s_cuda_cp_csrg_from_coo(a,b,info) call a%psb_s_csr_sparse_mat%cp_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_s_cuda_cp_csrg_from_fmt.F90 b/cuda/impl/psb_s_cuda_cp_csrg_from_fmt.F90 index 7ab9283d..29bbea6e 100644 --- a/cuda/impl/psb_s_cuda_cp_csrg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_cp_csrg_from_fmt.F90 @@ -32,12 +32,8 @@ subroutine psb_s_cuda_cp_csrg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_cp_csrg_from_fmt -#else - use psb_s_cuda_csrg_mat_mod -#endif !use iso_c_binding implicit none @@ -53,9 +49,7 @@ subroutine psb_s_cuda_cp_csrg_from_fmt(a,b,info) class default call a%psb_s_csr_sparse_mat%cp_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_s_cuda_cp_csrg_from_fmt diff --git a/cuda/impl/psb_s_cuda_cp_diag_from_coo.F90 b/cuda/impl/psb_s_cuda_cp_diag_from_coo.F90 index 9f038a09..07025d77 100644 --- a/cuda/impl/psb_s_cuda_cp_diag_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_cp_diag_from_coo.F90 @@ -33,13 +33,9 @@ subroutine psb_s_cuda_cp_diag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_s_cuda_diag_mat_mod, psb_protect_name => psb_s_cuda_cp_diag_from_coo -#else - use psb_s_cuda_diag_mat_mod -#endif implicit none class(psb_s_cuda_diag_sparse_mat), intent(inout) :: a @@ -50,10 +46,8 @@ subroutine psb_s_cuda_cp_diag_from_coo(a,b,info) info = psb_success_ call a%psb_s_dia_sparse_mat%cp_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_s_cuda_cp_elg_from_coo.F90 b/cuda/impl/psb_s_cuda_cp_elg_from_coo.F90 index f6e1ba42..66abf76a 100644 --- a/cuda/impl/psb_s_cuda_cp_elg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_cp_elg_from_coo.F90 @@ -28,20 +28,14 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_s_cuda_cp_elg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_cp_elg_from_coo use psi_ext_util_mod use psb_cuda_env_mod -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a @@ -57,16 +51,11 @@ subroutine psb_s_cuda_cp_elg_from_coo(a,b,info) integer(psb_ipk_), allocatable :: idisp(:) info = psb_success_ -#ifdef HAVE_SPGPU hacksize = max(1,psb_cuda_WarpSize()) -#else - hacksize = 1 -#endif if (b%is_dev()) call b%sync() if (b%is_by_rows()) then -#ifdef HAVE_SPGPU call psi_s_count_ell_from_coo(a,b,idisp,ldv,nzm,info,hacksize=hacksize) @@ -82,15 +71,8 @@ subroutine psb_s_cuda_cp_elg_from_coo(a,b,info) if (info == 0) info = psi_CopyCooToElg(nr,nc,nza, hacksize,ldv,nzm, & & a%irn,idisp,b%ja,b%val, a%deviceMat) call a%set_dev() -#else - - call psi_s_convert_ell_from_coo(a,b,info,hacksize=hacksize) - call a%set_host() -#endif - else call b%cp_to_coo(tmp,info) -#ifdef HAVE_SPGPU call psi_s_count_ell_from_coo(a,tmp,idisp,ldv,nzm,info,hacksize=hacksize) @@ -107,11 +89,6 @@ subroutine psb_s_cuda_cp_elg_from_coo(a,b,info) & a%irn,idisp,tmp%ja,tmp%val, a%deviceMat) call a%set_dev() -#else - - call psi_s_convert_ell_from_coo(a,tmp,info,hacksize=hacksize) - call a%set_host() -#endif end if if (info /= psb_success_) goto 9999 diff --git a/cuda/impl/psb_s_cuda_cp_elg_from_fmt.F90 b/cuda/impl/psb_s_cuda_cp_elg_from_fmt.F90 index 0c811426..77df12b3 100644 --- a/cuda/impl/psb_s_cuda_cp_elg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_cp_elg_from_fmt.F90 @@ -33,13 +33,9 @@ subroutine psb_s_cuda_cp_elg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_cp_elg_from_fmt -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a @@ -51,9 +47,7 @@ subroutine psb_s_cuda_cp_elg_from_fmt(a,b,info) Integer(Psb_ipk_) :: nza, nr, i,j,irw, idl,err_act, nc, ld, nzm, m integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = psb_success_ if (b%is_dev()) call b%sync() @@ -67,13 +61,9 @@ subroutine psb_s_cuda_cp_elg_from_fmt(a,b,info) m = b%get_nrows() nc = b%get_ncols() nza = b%get_nzeros() -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) ld = gpu_parms%pitch nzm = gpu_parms%maxRowSize -#else - ld = m -#endif a%psb_s_base_sparse_mat = b%psb_s_base_sparse_mat if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -88,9 +78,7 @@ subroutine psb_s_cuda_cp_elg_from_fmt(a,b,info) a%val(1:m,1:nzm) = b%val(1:m,1:nzm) end if a%nzt = nza -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif class default diff --git a/cuda/impl/psb_s_cuda_cp_hdiag_from_coo.F90 b/cuda/impl/psb_s_cuda_cp_hdiag_from_coo.F90 index 07b56fa6..75210478 100644 --- a/cuda/impl/psb_s_cuda_cp_hdiag_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_cp_hdiag_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_s_cuda_cp_hdiag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_s_cuda_hdiag_mat_mod, psb_protect_name => psb_s_cuda_cp_hdiag_from_coo use psb_cuda_env_mod -#else - use psb_s_cuda_hdiag_mat_mod -#endif implicit none class(psb_s_cuda_hdiag_sparse_mat), intent(inout) :: a @@ -53,16 +47,12 @@ subroutine psb_s_cuda_cp_hdiag_from_coo(a,b,info) info = psb_success_ -#ifdef HAVE_SPGPU a%hacksize = psb_cuda_WarpSize() -#endif call a%psb_s_hdia_sparse_mat%cp_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_s_cuda_cp_hlg_from_coo.F90 b/cuda/impl/psb_s_cuda_cp_hlg_from_coo.F90 index 055fa046..c254b15a 100644 --- a/cuda/impl/psb_s_cuda_cp_hlg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_cp_hlg_from_coo.F90 @@ -33,14 +33,10 @@ subroutine psb_s_cuda_cp_hlg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_cuda_env_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_cp_hlg_from_coo -#else - use psb_s_cuda_hlg_mat_mod -#endif implicit none class(psb_s_cuda_hlg_sparse_mat), intent(inout) :: a @@ -61,11 +57,7 @@ subroutine psb_s_cuda_cp_hlg_from_coo(a,b,info) info = psb_success_ debug_unit = psb_get_debug_unit() debug_level = psb_get_debug_level() -#ifdef HAVE_SPGPU hksz = max(1,psb_cuda_WarpSize()) -#else - hksz = psi_get_hksz() -#endif if (b%is_by_rows()) then diff --git a/cuda/impl/psb_s_cuda_cp_hlg_from_fmt.F90 b/cuda/impl/psb_s_cuda_cp_hlg_from_fmt.F90 index b49be761..f04b65e5 100644 --- a/cuda/impl/psb_s_cuda_cp_hlg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_cp_hlg_from_fmt.F90 @@ -33,13 +33,9 @@ subroutine psb_s_cuda_cp_hlg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_cp_hlg_from_fmt -#else - use psb_s_cuda_hlg_mat_mod -#endif implicit none class(psb_s_cuda_hlg_sparse_mat), intent(inout) :: a @@ -53,9 +49,7 @@ subroutine psb_s_cuda_cp_hlg_from_fmt(a,b,info) call a%cp_from_coo(b,info) class default call a%psb_s_hll_sparse_mat%cp_from_fmt(b,info) -#ifdef HAVE_SPGPU if (info == 0) call a%to_gpu(info) -#endif end select if (info /= 0) goto 9999 diff --git a/cuda/impl/psb_s_cuda_cp_hybg_from_coo.F90 b/cuda/impl/psb_s_cuda_cp_hybg_from_coo.F90 index ab135944..69aa615b 100644 --- a/cuda/impl/psb_s_cuda_cp_hybg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_cp_hybg_from_coo.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_cp_hybg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_cp_hybg_from_coo -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none class(psb_s_cuda_hybg_sparse_mat), intent(inout) :: a @@ -49,10 +45,8 @@ subroutine psb_s_cuda_cp_hybg_from_coo(a,b,info) call a%psb_s_csr_sparse_mat%cp_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_s_cuda_cp_hybg_from_fmt.F90 b/cuda/impl/psb_s_cuda_cp_hybg_from_fmt.F90 index 62a54759..95e00df1 100644 --- a/cuda/impl/psb_s_cuda_cp_hybg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_cp_hybg_from_fmt.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_cp_hybg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_cp_hybg_from_fmt -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none class(psb_s_cuda_hybg_sparse_mat), intent(inout) :: a @@ -53,9 +49,7 @@ subroutine psb_s_cuda_cp_hybg_from_fmt(a,b,info) class default call a%psb_s_csr_sparse_mat%cp_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_s_cuda_cp_hybg_from_fmt diff --git a/cuda/impl/psb_s_cuda_csrg_allocate_mnnz.F90 b/cuda/impl/psb_s_cuda_csrg_allocate_mnnz.F90 index 53ca8f12..7e6f0c86 100644 --- a/cuda/impl/psb_s_cuda_csrg_allocate_mnnz.F90 +++ b/cuda/impl/psb_s_cuda_csrg_allocate_mnnz.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_csrg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_allocate_mnnz -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_s_cuda_csrg_sparse_mat), intent(inout) :: a @@ -52,11 +48,9 @@ subroutine psb_s_cuda_csrg_allocate_mnnz(m,n,a,nz) call a%psb_s_csr_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU info = initFcusparse() if (info == 0) call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_csrg_csmm.F90 b/cuda/impl/psb_s_cuda_csrg_csmm.F90 index c8ff4a9e..453f5260 100644 --- a/cuda/impl/psb_s_cuda_csrg_csmm.F90 +++ b/cuda/impl/psb_s_cuda_csrg_csmm.F90 @@ -33,14 +33,10 @@ subroutine psb_s_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_csmm -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none class(psb_s_cuda_csrg_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:,:) @@ -94,7 +90,6 @@ subroutine psb_s_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -119,9 +114,6 @@ subroutine psb_s_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_csrg_csmv.F90 b/cuda/impl/psb_s_cuda_csrg_csmv.F90 index 72658c28..a387fd34 100644 --- a/cuda/impl/psb_s_cuda_csrg_csmv.F90 +++ b/cuda/impl/psb_s_cuda_csrg_csmv.F90 @@ -33,14 +33,10 @@ subroutine psb_s_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_csmv -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none class(psb_s_cuda_csrg_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -96,7 +92,6 @@ subroutine psb_s_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -124,9 +119,6 @@ subroutine psb_s_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_csrg_from_gpu.F90 b/cuda/impl/psb_s_cuda_csrg_from_gpu.F90 index 7811f746..adcb2536 100644 --- a/cuda/impl/psb_s_cuda_csrg_from_gpu.F90 +++ b/cuda/impl/psb_s_cuda_csrg_from_gpu.F90 @@ -33,13 +33,9 @@ subroutine psb_s_cuda_csrg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_from_gpu -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none class(psb_s_cuda_csrg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +44,6 @@ subroutine psb_s_cuda_csrg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (.not.(c_associated(a%deviceMat%mat))) then call a%free() return @@ -68,6 +63,5 @@ subroutine psb_s_cuda_csrg_from_gpu(a,info) #endif call a%set_sync() -#endif end subroutine psb_s_cuda_csrg_from_gpu diff --git a/cuda/impl/psb_s_cuda_csrg_inner_vect_sv.F90 b/cuda/impl/psb_s_cuda_csrg_inner_vect_sv.F90 index 7f9965d8..df11952c 100644 --- a/cuda/impl/psb_s_cuda_csrg_inner_vect_sv.F90 +++ b/cuda/impl/psb_s_cuda_csrg_inner_vect_sv.F90 @@ -32,13 +32,9 @@ subroutine psb_s_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_inner_vect_sv -#else - use psb_s_cuda_csrg_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_csrg_sparse_mat), intent(in) :: a @@ -75,7 +71,6 @@ subroutine psb_s_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra.or.(beta/=dzero)) then call x%sync() call y%sync() @@ -112,12 +107,6 @@ subroutine psb_s_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call x%sync() - call y%sync() - call a%psb_s_csr_sparse_mat%inner_spsm(alpha,x,beta,y,info,trans) - call y%set_host() -#endif if (info /= psb_success_) then info = psb_err_from_subroutine_ call psb_errpush(info,name, a_err='csrg_vect_sv') diff --git a/cuda/impl/psb_s_cuda_csrg_reallocate_nz.F90 b/cuda/impl/psb_s_cuda_csrg_reallocate_nz.F90 index fed3b0e7..dfd115e7 100644 --- a/cuda/impl/psb_s_cuda_csrg_reallocate_nz.F90 +++ b/cuda/impl/psb_s_cuda_csrg_reallocate_nz.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_csrg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_reallocate_nz -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_s_cuda_csrg_sparse_mat), intent(inout) :: a @@ -55,10 +51,8 @@ subroutine psb_s_cuda_csrg_reallocate_nz(nz,a) ! call a%psb_s_csr_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_csrg_scal.F90 b/cuda/impl/psb_s_cuda_csrg_scal.F90 index 826ab2dd..ea3406a1 100644 --- a/cuda/impl/psb_s_cuda_csrg_scal.F90 +++ b/cuda/impl/psb_s_cuda_csrg_scal.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_csrg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_scal -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none class(psb_s_cuda_csrg_sparse_mat), intent(inout) :: a real(psb_spk_), intent(in) :: d(:) @@ -58,10 +54,8 @@ subroutine psb_s_cuda_csrg_scal(d,a,info,side) call a%psb_s_csr_sparse_mat%scal(d,info,side=side) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_csrg_scals.F90 b/cuda/impl/psb_s_cuda_csrg_scals.F90 index 04f4c29a..307d5849 100644 --- a/cuda/impl/psb_s_cuda_csrg_scals.F90 +++ b/cuda/impl/psb_s_cuda_csrg_scals.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_csrg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_scals -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none class(psb_s_cuda_csrg_sparse_mat), intent(inout) :: a real(psb_spk_), intent(in) :: d @@ -56,10 +52,8 @@ subroutine psb_s_cuda_csrg_scals(d,a,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_csrg_to_gpu.F90 b/cuda/impl/psb_s_cuda_csrg_to_gpu.F90 index eadca5df..cf052e13 100644 --- a/cuda/impl/psb_s_cuda_csrg_to_gpu.F90 +++ b/cuda/impl/psb_s_cuda_csrg_to_gpu.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_csrg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_to_gpu -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none class(psb_s_cuda_csrg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -51,7 +47,6 @@ subroutine psb_s_cuda_csrg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -320,6 +315,5 @@ subroutine psb_s_cuda_csrg_to_gpu(a,info,nzrm) if (info /= 0) then write(0,*) 'Error in CSRG_TO_GPU ',info end if -#endif end subroutine psb_s_cuda_csrg_to_gpu diff --git a/cuda/impl/psb_s_cuda_csrg_vect_mv.F90 b/cuda/impl/psb_s_cuda_csrg_vect_mv.F90 index 38e2dfc0..52820436 100644 --- a/cuda/impl/psb_s_cuda_csrg_vect_mv.F90 +++ b/cuda/impl/psb_s_cuda_csrg_vect_mv.F90 @@ -33,14 +33,10 @@ subroutine psb_s_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_csrg_vect_mv -#else - use psb_s_cuda_csrg_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_csrg_sparse_mat), intent(in) :: a @@ -72,7 +68,6 @@ subroutine psb_s_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= szero) then @@ -112,9 +107,6 @@ subroutine psb_s_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_diag_csmv.F90 b/cuda/impl/psb_s_cuda_diag_csmv.F90 index 214cf6f8..016b82bc 100644 --- a/cuda/impl/psb_s_cuda_diag_csmv.F90 +++ b/cuda/impl/psb_s_cuda_diag_csmv.F90 @@ -33,13 +33,9 @@ subroutine psb_s_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_s_cuda_diag_mat_mod, psb_protect_name => psb_s_cuda_diag_csmv -#else - use psb_s_cuda_diag_mat_mod -#endif implicit none class(psb_s_cuda_diag_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +90,6 @@ subroutine psb_s_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_s_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +116,6 @@ subroutine psb_s_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -132,5 +124,4 @@ subroutine psb_s_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) return - end subroutine psb_s_cuda_diag_csmv diff --git a/cuda/impl/psb_s_cuda_diag_to_gpu.F90 b/cuda/impl/psb_s_cuda_diag_to_gpu.F90 index c1ee7401..c8578e75 100644 --- a/cuda/impl/psb_s_cuda_diag_to_gpu.F90 +++ b/cuda/impl/psb_s_cuda_diag_to_gpu.F90 @@ -33,13 +33,9 @@ subroutine psb_s_cuda_diag_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_s_cuda_diag_mat_mod, psb_protect_name => psb_s_cuda_diag_to_gpu -#else - use psb_s_cuda_diag_mat_mod -#endif use iso_c_binding implicit none class(psb_s_cuda_diag_sparse_mat), intent(inout) :: a @@ -47,13 +43,10 @@ subroutine psb_s_cuda_diag_to_gpu(a,info,nzrm) integer(psb_ipk_), intent(in), optional :: nzrm integer(psb_ipk_) :: m, nzm, n, c,pitch,maxrowsize,d -#ifdef HAVE_SPGPU type(diagdev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%data)).or.(.not.allocated(a%offset))) return n = size(a%data,1) @@ -69,6 +62,5 @@ subroutine psb_s_cuda_diag_to_gpu(a,info,nzrm) if (info == 0) info = & & writeDiagDevice(a%deviceMat,a%data,a%offset,n) ! if (info /= 0) goto 9999 -#endif end subroutine psb_s_cuda_diag_to_gpu diff --git a/cuda/impl/psb_s_cuda_diag_vect_mv.F90 b/cuda/impl/psb_s_cuda_diag_vect_mv.F90 index ab655b7c..d68e5193 100644 --- a/cuda/impl/psb_s_cuda_diag_vect_mv.F90 +++ b/cuda/impl/psb_s_cuda_diag_vect_mv.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_s_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_s_cuda_diag_mat_mod, psb_protect_name => psb_s_cuda_diag_vect_mv -#else - use psb_s_cuda_diag_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_diag_sparse_mat), intent(in) :: a @@ -71,7 +65,6 @@ subroutine psb_s_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= szero) then @@ -112,9 +105,6 @@ subroutine psb_s_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_s_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_dnsg_mat_impl.F90 b/cuda/impl/psb_s_cuda_dnsg_mat_impl.F90 index 861724aa..86fec6a7 100644 --- a/cuda/impl/psb_s_cuda_dnsg_mat_impl.F90 +++ b/cuda/impl/psb_s_cuda_dnsg_mat_impl.F90 @@ -32,13 +32,9 @@ subroutine psb_s_cuda_dnsg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod use psb_s_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_s_vectordev_mod use psb_s_cuda_dnsg_mat_mod, psb_protect_name => psb_s_cuda_dnsg_vect_mv -#else - use psb_s_cuda_dnsg_mat_mod -#endif implicit none class(psb_s_cuda_dnsg_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta @@ -123,13 +119,9 @@ end subroutine psb_s_cuda_dnsg_vect_mv subroutine psb_s_cuda_dnsg_mold(a,b,info) use psb_base_mod use psb_s_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_s_vectordev_mod use psb_s_cuda_dnsg_mat_mod, psb_protect_name => psb_s_cuda_dnsg_mold -#else - use psb_s_cuda_dnsg_mat_mod -#endif implicit none class(psb_s_cuda_dnsg_sparse_mat), intent(in) :: a class(psb_s_base_sparse_mat), intent(inout), allocatable :: b @@ -190,17 +182,12 @@ end subroutine psb_s_cuda_dnsg_mold !!$ end subroutine psb_s_cuda_dnsg_allocate_mnnz !!$ end interface - subroutine psb_s_cuda_dnsg_to_gpu(a,info) use psb_base_mod use psb_s_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_s_vectordev_mod use psb_s_cuda_dnsg_mat_mod, psb_protect_name => psb_s_cuda_dnsg_to_gpu -#else - use psb_s_cuda_dnsg_mat_mod -#endif class(psb_s_cuda_dnsg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info Integer(Psb_ipk_) :: err_act, pitch, lda @@ -209,15 +196,12 @@ subroutine psb_s_cuda_dnsg_to_gpu(a,info) call psb_erractionsave(err_act) info = psb_success_ -#ifdef HAVE_SPGPU if (debug) write(0,*) 'DNS_TO_GPU',size(a%val,1),size(a%val,2) info = FallocDnsDevice(a%deviceMat,a%get_nrows(),a%get_ncols(),& & spgpu_type_float,1) if (info == 0) info = writeDnsDevice(a%deviceMat,a%val,size(a%val,1),size(a%val,2)) if (debug) write(0,*) 'DNS_TO_GPU: From writeDnsDEvice',info - -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return @@ -233,13 +217,9 @@ end subroutine psb_s_cuda_dnsg_to_gpu subroutine psb_s_cuda_cp_dnsg_from_coo(a,b,info) use psb_base_mod use psb_s_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_s_vectordev_mod use psb_s_cuda_dnsg_mat_mod, psb_protect_name => psb_s_cuda_cp_dnsg_from_coo -#else - use psb_s_cuda_dnsg_mat_mod -#endif implicit none class(psb_s_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -272,13 +252,9 @@ end subroutine psb_s_cuda_cp_dnsg_from_coo subroutine psb_s_cuda_cp_dnsg_from_fmt(a,b,info) use psb_base_mod use psb_s_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_s_vectordev_mod use psb_s_cuda_dnsg_mat_mod, psb_protect_name => psb_s_cuda_cp_dnsg_from_fmt -#else - use psb_s_cuda_dnsg_mat_mod -#endif implicit none class(psb_s_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -348,13 +324,9 @@ end subroutine psb_s_cuda_cp_dnsg_from_fmt subroutine psb_s_cuda_mv_dnsg_from_coo(a,b,info) use psb_base_mod use psb_s_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_s_vectordev_mod use psb_s_cuda_dnsg_mat_mod, psb_protect_name => psb_s_cuda_mv_dnsg_from_coo -#else - use psb_s_cuda_dnsg_mat_mod -#endif implicit none class(psb_s_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -383,18 +355,13 @@ subroutine psb_s_cuda_mv_dnsg_from_coo(a,b,info) return end subroutine psb_s_cuda_mv_dnsg_from_coo - - + subroutine psb_s_cuda_mv_dnsg_from_fmt(a,b,info) use psb_base_mod use psb_s_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_s_vectordev_mod use psb_s_cuda_dnsg_mat_mod, psb_protect_name => psb_s_cuda_mv_dnsg_from_fmt -#else - use psb_s_cuda_dnsg_mat_mod -#endif implicit none class(psb_s_cuda_dnsg_sparse_mat), intent(inout) :: a class(psb_s_base_sparse_mat), intent(inout) :: b diff --git a/cuda/impl/psb_s_cuda_elg_allocate_mnnz.F90 b/cuda/impl/psb_s_cuda_elg_allocate_mnnz.F90 index 63c41644..b771ca1b 100644 --- a/cuda/impl/psb_s_cuda_elg_allocate_mnnz.F90 +++ b/cuda/impl/psb_s_cuda_elg_allocate_mnnz.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_s_cuda_elg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_allocate_mnnz -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a @@ -47,9 +41,7 @@ subroutine psb_s_cuda_elg_allocate_mnnz(m,n,a,nz) Integer(Psb_ipk_) :: err_act, info, nz_,ld character(len=20) :: name='allocate_mnz' logical, parameter :: debug=.false. -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif call psb_erractionsave(err_act) info = psb_success_ @@ -74,13 +66,9 @@ subroutine psb_s_cuda_elg_allocate_mnnz(m,n,a,nz) goto 9999 endif -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nz_,nz_*m,n,spgpu_type_float,1) ld = gpu_parms%pitch nz_ = gpu_parms%maxRowSize -#else - ld = m -#endif if (info == psb_success_) call psb_realloc(m,a%irn,info) if (info == psb_success_) call psb_realloc(m,a%idiag,info) @@ -98,10 +86,8 @@ subroutine psb_s_cuda_elg_allocate_mnnz(m,n,a,nz) call a%set_dupl(psb_dupl_def_) end if -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz_) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_elg_asb.f90 b/cuda/impl/psb_s_cuda_elg_asb.f90 index 0d53c26a..53a17a32 100644 --- a/cuda/impl/psb_s_cuda_elg_asb.f90 +++ b/cuda/impl/psb_s_cuda_elg_asb.f90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_asb(a) use psb_base_mod diff --git a/cuda/impl/psb_s_cuda_elg_csmm.F90 b/cuda/impl/psb_s_cuda_elg_csmm.F90 index e7f88a2e..ff7b7848 100644 --- a/cuda/impl/psb_s_cuda_elg_csmm.F90 +++ b/cuda/impl/psb_s_cuda_elg_csmm.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_csmm -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:,:) @@ -92,8 +87,6 @@ subroutine psb_s_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) goto 9999 end if - -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() call a%psb_s_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) @@ -119,9 +112,6 @@ subroutine psb_s_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_elg_csmv.F90 b/cuda/impl/psb_s_cuda_elg_csmv.F90 index 1844d338..caf106cb 100644 --- a/cuda/impl/psb_s_cuda_elg_csmv.F90 +++ b/cuda/impl/psb_s_cuda_elg_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_csmv -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_s_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() call a%psb_s_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) @@ -122,9 +116,6 @@ subroutine psb_s_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_elg_csput.F90 b/cuda/impl/psb_s_cuda_elg_csput.F90 index 036eabb2..d43294bf 100644 --- a/cuda/impl/psb_s_cuda_elg_csput.F90 +++ b/cuda/impl/psb_s_cuda_elg_csput.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_base_mod use iso_c_binding -#ifdef HAVE_SPGPU use elldev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_csput_a -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a @@ -128,13 +123,9 @@ subroutine psb_s_cuda_elg_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_base_mod use iso_c_binding -#ifdef HAVE_SPGPU use elldev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_csput_v use psb_s_cuda_vect_mod -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_s_cuda_elg_from_gpu.F90 b/cuda/impl/psb_s_cuda_elg_from_gpu.F90 index bdc55790..d995157e 100644 --- a/cuda/impl/psb_s_cuda_elg_from_gpu.F90 +++ b/cuda/impl/psb_s_cuda_elg_from_gpu.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - + subroutine psb_s_cuda_elg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_from_gpu -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +43,6 @@ subroutine psb_s_cuda_elg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (.not.(c_associated(a%deviceMat))) then call a%free() return @@ -69,6 +63,5 @@ subroutine psb_s_cuda_elg_from_gpu(a,info) if (info == 0) info = & & readEllDevice(a%deviceMat,a%val,a%ja,pitch,a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_s_cuda_elg_from_gpu diff --git a/cuda/impl/psb_s_cuda_elg_inner_vect_sv.F90 b/cuda/impl/psb_s_cuda_elg_inner_vect_sv.F90 index 79e546f5..537365a6 100644 --- a/cuda/impl/psb_s_cuda_elg_inner_vect_sv.F90 +++ b/cuda/impl/psb_s_cuda_elg_inner_vect_sv.F90 @@ -27,19 +27,14 @@ ! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. -! - +! subroutine psb_s_cuda_elg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_inner_vect_sv -#else - use psb_s_cuda_elg_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_elg_sparse_mat), intent(in) :: a diff --git a/cuda/impl/psb_s_cuda_elg_mold.F90 b/cuda/impl/psb_s_cuda_elg_mold.F90 index dc8730bb..7ff9c7ae 100644 --- a/cuda/impl/psb_s_cuda_elg_mold.F90 +++ b/cuda/impl/psb_s_cuda_elg_mold.F90 @@ -28,8 +28,6 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_s_cuda_elg_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_s_cuda_elg_reallocate_nz.F90 b/cuda/impl/psb_s_cuda_elg_reallocate_nz.F90 index 3f34fcec..5b99b9ad 100644 --- a/cuda/impl/psb_s_cuda_elg_reallocate_nz.F90 +++ b/cuda/impl/psb_s_cuda_elg_reallocate_nz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_reallocate_nz -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a @@ -64,10 +59,8 @@ subroutine psb_s_cuda_elg_reallocate_nz(nz,a) goto 9999 end if -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nzrm) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_elg_scal.F90 b/cuda/impl/psb_s_cuda_elg_scal.F90 index cd6e1a5b..dfa99cf1 100644 --- a/cuda/impl/psb_s_cuda_elg_scal.F90 +++ b/cuda/impl/psb_s_cuda_elg_scal.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_scal -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a real(psb_spk_), intent(in) :: d(:) @@ -63,10 +58,8 @@ subroutine psb_s_cuda_elg_scal(d,a,info,side) call a%psb_s_ell_sparse_mat%scal(d,info,side) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_elg_scals.F90 b/cuda/impl/psb_s_cuda_elg_scals.F90 index 4ee8a64d..f0aa2504 100644 --- a/cuda/impl/psb_s_cuda_elg_scals.F90 +++ b/cuda/impl/psb_s_cuda_elg_scals.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_scals -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a real(psb_spk_), intent(in) :: d @@ -59,10 +54,8 @@ subroutine psb_s_cuda_elg_scals(d,a,info) a%val(:,:) = a%val(:,:) * d -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_s_cuda_elg_to_gpu.F90 b/cuda/impl/psb_s_cuda_elg_to_gpu.F90 index 7d04d2b0..9c16ea8d 100644 --- a/cuda/impl/psb_s_cuda_elg_to_gpu.F90 +++ b/cuda/impl/psb_s_cuda_elg_to_gpu.F90 @@ -29,30 +29,22 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_to_gpu -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(in), optional :: nzrm integer(psb_ipk_) :: m, nzm, n, pitch,maxrowsize, nzt -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -88,6 +80,5 @@ subroutine psb_s_cuda_elg_to_gpu(a,info,nzrm) if (info == 0) info = & & writeEllDevice(a%deviceMat,a%val,a%ja,size(a%ja,1),a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_s_cuda_elg_to_gpu diff --git a/cuda/impl/psb_s_cuda_elg_trim.f90 b/cuda/impl/psb_s_cuda_elg_trim.f90 index 516aebc4..2d390343 100644 --- a/cuda/impl/psb_s_cuda_elg_trim.f90 +++ b/cuda/impl/psb_s_cuda_elg_trim.f90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_trim(a) use psb_base_mod diff --git a/cuda/impl/psb_s_cuda_elg_vect_mv.F90 b/cuda/impl/psb_s_cuda_elg_vect_mv.F90 index dad62418..6c898fda 100644 --- a/cuda/impl/psb_s_cuda_elg_vect_mv.F90 +++ b/cuda/impl/psb_s_cuda_elg_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_elg_vect_mv -#else - use psb_s_cuda_elg_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_elg_sparse_mat), intent(in) :: a @@ -71,7 +66,6 @@ subroutine psb_s_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() if (.not.x%is_host()) call x%sync() @@ -116,10 +110,6 @@ subroutine psb_s_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - if (a%is_dev()) call a%sync() - call a%psb_s_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hdiag_csmv.F90 b/cuda/impl/psb_s_cuda_hdiag_csmv.F90 index 8e7e4931..3f34c2e7 100644 --- a/cuda/impl/psb_s_cuda_hdiag_csmv.F90 +++ b/cuda/impl/psb_s_cuda_hdiag_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_s_cuda_hdiag_mat_mod, psb_protect_name => psb_s_cuda_hdiag_csmv -#else - use psb_s_cuda_hdiag_mat_mod -#endif implicit none class(psb_s_cuda_hdiag_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_s_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_s_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_s_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -132,5 +123,4 @@ subroutine psb_s_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) return - end subroutine psb_s_cuda_hdiag_csmv diff --git a/cuda/impl/psb_s_cuda_hdiag_mold.F90 b/cuda/impl/psb_s_cuda_hdiag_mold.F90 index e662b07b..c11283dd 100644 --- a/cuda/impl/psb_s_cuda_hdiag_mold.F90 +++ b/cuda/impl/psb_s_cuda_hdiag_mold.F90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hdiag_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_s_cuda_hdiag_to_gpu.F90 b/cuda/impl/psb_s_cuda_hdiag_to_gpu.F90 index 5fe493aa..bc3fa325 100644 --- a/cuda/impl/psb_s_cuda_hdiag_to_gpu.F90 +++ b/cuda/impl/psb_s_cuda_hdiag_to_gpu.F90 @@ -29,29 +29,21 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hdiag_to_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_s_cuda_hdiag_mat_mod, psb_protect_name => psb_s_cuda_hdiag_to_gpu -#else - use psb_s_cuda_hdiag_mat_mod -#endif use iso_c_binding implicit none class(psb_s_cuda_hdiag_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: nr, nc, hacksize, hackcount, allocheight -#ifdef HAVE_SPGPU type(hdiagdev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU nr = a%get_nrows() nc = a%get_ncols() hacksize = a%hackSize @@ -81,6 +73,4 @@ subroutine psb_s_cuda_hdiag_to_gpu(a,info) if (info == 0) info = & & writeHdiagDevice(a%deviceMat,a%val,a%diaOffsets,a%hackOffsets) -#endif - end subroutine psb_s_cuda_hdiag_to_gpu diff --git a/cuda/impl/psb_s_cuda_hdiag_vect_mv.F90 b/cuda/impl/psb_s_cuda_hdiag_vect_mv.F90 index 3496a637..03215047 100644 --- a/cuda/impl/psb_s_cuda_hdiag_vect_mv.F90 +++ b/cuda/impl/psb_s_cuda_hdiag_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_s_cuda_hdiag_mat_mod, psb_protect_name => psb_s_cuda_hdiag_vect_mv -#else - use psb_s_cuda_hdiag_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_hdiag_sparse_mat), intent(in) :: a @@ -71,7 +66,6 @@ subroutine psb_s_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= dzero) then @@ -112,9 +106,6 @@ subroutine psb_s_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_s_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hlg_allocate_mnnz.F90 b/cuda/impl/psb_s_cuda_hlg_allocate_mnnz.F90 index 3f2765c4..480f6677 100644 --- a/cuda/impl/psb_s_cuda_hlg_allocate_mnnz.F90 +++ b/cuda/impl/psb_s_cuda_hlg_allocate_mnnz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_allocate_mnnz -#else - use psb_s_cuda_hlg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_s_cuda_hlg_sparse_mat), intent(inout) :: a @@ -47,19 +42,15 @@ subroutine psb_s_cuda_hlg_allocate_mnnz(m,n,a,nz) Integer(psb_ipk_) :: err_act, info, nz_,ld character(len=20) :: name='allocate_mnz' logical, parameter :: debug=.false. -#ifdef HAVE_SPGPU type(hlldev_parms) :: gpu_parms -#endif call psb_erractionsave(err_act) info = psb_success_ call a%psb_s_hll_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz_) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hlg_csmm.F90 b/cuda/impl/psb_s_cuda_hlg_csmm.F90 index 2e274c22..0dc28c7f 100644 --- a/cuda/impl/psb_s_cuda_hlg_csmm.F90 +++ b/cuda/impl/psb_s_cuda_hlg_csmm.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_csmm -#else - use psb_s_cuda_hlg_mat_mod -#endif implicit none class(psb_s_cuda_hlg_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:,:) @@ -93,7 +88,6 @@ subroutine psb_s_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_s_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -118,9 +112,6 @@ subroutine psb_s_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -128,5 +119,4 @@ subroutine psb_s_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) return - end subroutine psb_s_cuda_hlg_csmm diff --git a/cuda/impl/psb_s_cuda_hlg_csmv.F90 b/cuda/impl/psb_s_cuda_hlg_csmv.F90 index 56ea8cdb..c029c908 100644 --- a/cuda/impl/psb_s_cuda_hlg_csmv.F90 +++ b/cuda/impl/psb_s_cuda_hlg_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_csmv -#else - use psb_s_cuda_hlg_mat_mod -#endif implicit none class(psb_s_cuda_hlg_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_s_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_s_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_s_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hlg_from_gpu.F90 b/cuda/impl/psb_s_cuda_hlg_from_gpu.F90 index 14ab19b7..8d9a315b 100644 --- a/cuda/impl/psb_s_cuda_hlg_from_gpu.F90 +++ b/cuda/impl/psb_s_cuda_hlg_from_gpu.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_from_gpu -#else - use psb_s_cuda_hlg_mat_mod -#endif implicit none class(psb_s_cuda_hlg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +43,6 @@ subroutine psb_s_cuda_hlg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (a%is_sync()) return if (a%is_host()) return if (.not.(c_associated(a%deviceMat))) then @@ -71,6 +65,5 @@ subroutine psb_s_cuda_hlg_from_gpu(a,info) if (info == 0) info = & & readHllDevice(a%deviceMat,a%val,a%ja,a%hkoffs,a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_s_cuda_hlg_from_gpu diff --git a/cuda/impl/psb_s_cuda_hlg_inner_vect_sv.F90 b/cuda/impl/psb_s_cuda_hlg_inner_vect_sv.F90 index a9f4f743..2985a1ab 100644 --- a/cuda/impl/psb_s_cuda_hlg_inner_vect_sv.F90 +++ b/cuda/impl/psb_s_cuda_hlg_inner_vect_sv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_inner_vect_sv -#else - use psb_s_cuda_hlg_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_hlg_sparse_mat), intent(in) :: a @@ -69,11 +64,9 @@ subroutine psb_s_cuda_hlg_inner_vect_sv(alpha,a,x,beta,y,info,trans) goto 9999 end if - call psb_erractionrestore(err_act) return - 9999 call psb_error_handler(err_act) return diff --git a/cuda/impl/psb_s_cuda_hlg_mold.F90 b/cuda/impl/psb_s_cuda_hlg_mold.F90 index 90e9cebf..89e329e7 100644 --- a/cuda/impl/psb_s_cuda_hlg_mold.F90 +++ b/cuda/impl/psb_s_cuda_hlg_mold.F90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_s_cuda_hlg_reallocate_nz.F90 b/cuda/impl/psb_s_cuda_hlg_reallocate_nz.F90 index d5b9333c..03742958 100644 --- a/cuda/impl/psb_s_cuda_hlg_reallocate_nz.F90 +++ b/cuda/impl/psb_s_cuda_hlg_reallocate_nz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_reallocate_nz -#else - use psb_s_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none integer(psb_ipk_), intent(in) :: nz @@ -52,10 +47,8 @@ subroutine psb_s_cuda_hlg_reallocate_nz(nz,a) call a%psb_s_hll_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hlg_scal.F90 b/cuda/impl/psb_s_cuda_hlg_scal.F90 index e803a63d..7074b8b6 100644 --- a/cuda/impl/psb_s_cuda_hlg_scal.F90 +++ b/cuda/impl/psb_s_cuda_hlg_scal.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_scal -#else - use psb_s_cuda_hlg_mat_mod -#endif implicit none class(psb_s_cuda_hlg_sparse_mat), intent(inout) :: a real(psb_spk_), intent(in) :: d(:) @@ -60,10 +55,8 @@ subroutine psb_s_cuda_hlg_scal(d,a,info,side) call a%psb_s_hll_sparse_mat%scal(d,info,side) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hlg_scals.F90 b/cuda/impl/psb_s_cuda_hlg_scals.F90 index eec592e1..2c9f5ae8 100644 --- a/cuda/impl/psb_s_cuda_hlg_scals.F90 +++ b/cuda/impl/psb_s_cuda_hlg_scals.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_scals -#else - use psb_s_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none class(psb_s_cuda_hlg_sparse_mat), intent(inout) :: a @@ -59,10 +54,8 @@ subroutine psb_s_cuda_hlg_scals(d,a,info) call a%psb_s_hll_sparse_mat%scal(d,info) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hlg_to_gpu.F90 b/cuda/impl/psb_s_cuda_hlg_to_gpu.F90 index 14a2a629..91cfd5ad 100644 --- a/cuda/impl/psb_s_cuda_hlg_to_gpu.F90 +++ b/cuda/impl/psb_s_cuda_hlg_to_gpu.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_to_gpu -#else - use psb_s_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none class(psb_s_cuda_hlg_sparse_mat), intent(inout) :: a @@ -50,7 +45,6 @@ subroutine psb_s_cuda_hlg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return n = a%get_nrows() @@ -63,6 +57,5 @@ subroutine psb_s_cuda_hlg_to_gpu(a,info,nzrm) if (info == 0) info = & & writehllDevice(a%deviceMat,a%val,a%ja,a%hkoffs,a%irn,a%idiag) ! if (info /= 0) goto 9999 -#endif end subroutine psb_s_cuda_hlg_to_gpu diff --git a/cuda/impl/psb_s_cuda_hlg_vect_mv.F90 b/cuda/impl/psb_s_cuda_hlg_vect_mv.F90 index 2b964f91..94696949 100644 --- a/cuda/impl/psb_s_cuda_hlg_vect_mv.F90 +++ b/cuda/impl/psb_s_cuda_hlg_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_hlg_vect_mv -#else - use psb_s_cuda_hlg_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_hlg_sparse_mat), intent(in) :: a @@ -69,9 +64,7 @@ subroutine psb_s_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) goto 9999 endif - tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= szero) then @@ -115,9 +108,6 @@ subroutine psb_s_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_s_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hybg_allocate_mnnz.F90 b/cuda/impl/psb_s_cuda_hybg_allocate_mnnz.F90 index 0cf1e2bc..d4649d4c 100644 --- a/cuda/impl/psb_s_cuda_hybg_allocate_mnnz.F90 +++ b/cuda/impl/psb_s_cuda_hybg_allocate_mnnz.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_hybg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_hybg_allocate_mnnz -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_s_cuda_hybg_sparse_mat), intent(inout) :: a @@ -52,11 +48,9 @@ subroutine psb_s_cuda_hybg_allocate_mnnz(m,n,a,nz) call a%psb_s_csr_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU info = initFcusparse() call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hybg_csmm.F90 b/cuda/impl/psb_s_cuda_hybg_csmm.F90 index f89df384..f321ce8b 100644 --- a/cuda/impl/psb_s_cuda_hybg_csmm.F90 +++ b/cuda/impl/psb_s_cuda_hybg_csmm.F90 @@ -33,14 +33,10 @@ subroutine psb_s_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_hybg_csmm -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none class(psb_s_cuda_hybg_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:,:) @@ -92,8 +88,6 @@ subroutine psb_s_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) goto 9999 end if - -#ifdef HAVE_SPGPU if (tra) then call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_s_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hybg_csmv.F90 b/cuda/impl/psb_s_cuda_hybg_csmv.F90 index 01642146..5f1a8c90 100644 --- a/cuda/impl/psb_s_cuda_hybg_csmv.F90 +++ b/cuda/impl/psb_s_cuda_hybg_csmv.F90 @@ -33,14 +33,10 @@ subroutine psb_s_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_hybg_csmv -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none class(psb_s_cuda_hybg_sparse_mat), intent(in) :: a real(psb_spk_), intent(in) :: alpha, beta, x(:) @@ -95,7 +91,6 @@ subroutine psb_s_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -123,9 +118,6 @@ subroutine psb_s_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hybg_inner_vect_sv.F90 b/cuda/impl/psb_s_cuda_hybg_inner_vect_sv.F90 index f0006f5c..722505ff 100644 --- a/cuda/impl/psb_s_cuda_hybg_inner_vect_sv.F90 +++ b/cuda/impl/psb_s_cuda_hybg_inner_vect_sv.F90 @@ -33,13 +33,9 @@ subroutine psb_s_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_hybg_inner_vect_sv -#else - use psb_s_cuda_hybg_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_hybg_sparse_mat), intent(in) :: a @@ -76,7 +72,6 @@ subroutine psb_s_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra.or.(beta/=szero)) then call x%sync() call y%sync() @@ -113,12 +108,6 @@ subroutine psb_s_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call x%sync() - call y%sync() - call a%psb_s_csr_sparse_mat%inner_spsm(alpha,x,beta,y,info,trans) - call y%set_host() -#endif if (info /= psb_success_) then info = psb_err_from_subroutine_ call psb_errpush(info,name, a_err='hybg_vect_sv') diff --git a/cuda/impl/psb_s_cuda_hybg_reallocate_nz.F90 b/cuda/impl/psb_s_cuda_hybg_reallocate_nz.F90 index 7ee15f52..7311ed64 100644 --- a/cuda/impl/psb_s_cuda_hybg_reallocate_nz.F90 +++ b/cuda/impl/psb_s_cuda_hybg_reallocate_nz.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_hybg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_hybg_reallocate_nz -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_s_cuda_hybg_sparse_mat), intent(inout) :: a @@ -55,10 +51,8 @@ subroutine psb_s_cuda_hybg_reallocate_nz(nz,a) ! call a%psb_s_csr_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hybg_scal.F90 b/cuda/impl/psb_s_cuda_hybg_scal.F90 index 7a3978b7..d6f8eb8d 100644 --- a/cuda/impl/psb_s_cuda_hybg_scal.F90 +++ b/cuda/impl/psb_s_cuda_hybg_scal.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_hybg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_hybg_scal -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none class(psb_s_cuda_hybg_sparse_mat), intent(inout) :: a real(psb_spk_), intent(in) :: d(:) @@ -60,10 +56,8 @@ subroutine psb_s_cuda_hybg_scal(d,a,info,side) call a%psb_s_csr_sparse_mat%scal(d,info,side=side) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hybg_scals.F90 b/cuda/impl/psb_s_cuda_hybg_scals.F90 index a19ae3f6..f80d8efe 100644 --- a/cuda/impl/psb_s_cuda_hybg_scals.F90 +++ b/cuda/impl/psb_s_cuda_hybg_scals.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_hybg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_hybg_scals -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none class(psb_s_cuda_hybg_sparse_mat), intent(inout) :: a real(psb_spk_), intent(in) :: d @@ -60,10 +56,8 @@ subroutine psb_s_cuda_hybg_scals(d,a,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_hybg_to_gpu.F90 b/cuda/impl/psb_s_cuda_hybg_to_gpu.F90 index ec415176..168a0981 100644 --- a/cuda/impl/psb_s_cuda_hybg_to_gpu.F90 +++ b/cuda/impl/psb_s_cuda_hybg_to_gpu.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_hybg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_hybg_to_gpu -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none class(psb_s_cuda_hybg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -51,7 +47,6 @@ subroutine psb_s_cuda_hybg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -148,7 +143,6 @@ subroutine psb_s_cuda_hybg_to_gpu(a,info,nzrm) if (info /= 0) then write(0,*) 'Error in HYBG_TO_GPU ',info end if -#endif end subroutine psb_s_cuda_hybg_to_gpu #endif diff --git a/cuda/impl/psb_s_cuda_hybg_vect_mv.F90 b/cuda/impl/psb_s_cuda_hybg_vect_mv.F90 index a83c4561..6273f31a 100644 --- a/cuda/impl/psb_s_cuda_hybg_vect_mv.F90 +++ b/cuda/impl/psb_s_cuda_hybg_vect_mv.F90 @@ -33,14 +33,10 @@ subroutine psb_s_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_hybg_vect_mv -#else - use psb_s_cuda_hybg_mat_mod -#endif use psb_s_cuda_vect_mod implicit none class(psb_s_cuda_hybg_sparse_mat), intent(in) :: a @@ -71,8 +67,6 @@ subroutine psb_s_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') - -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= szero) then @@ -112,9 +106,6 @@ subroutine psb_s_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call a%psb_s_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_s_cuda_mv_csrg_from_coo.F90 b/cuda/impl/psb_s_cuda_mv_csrg_from_coo.F90 index a9e297bd..b61e94d6 100644 --- a/cuda/impl/psb_s_cuda_mv_csrg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_mv_csrg_from_coo.F90 @@ -29,16 +29,11 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_mv_csrg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_mv_csrg_from_coo -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none class(psb_s_cuda_csrg_sparse_mat), intent(inout) :: a @@ -51,9 +46,7 @@ subroutine psb_s_cuda_mv_csrg_from_coo(a,b,info) call a%psb_s_csr_sparse_mat%mv_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif if (info /= 0) goto 9999 return diff --git a/cuda/impl/psb_s_cuda_mv_csrg_from_fmt.F90 b/cuda/impl/psb_s_cuda_mv_csrg_from_fmt.F90 index 54bc0ae4..52643a10 100644 --- a/cuda/impl/psb_s_cuda_mv_csrg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_mv_csrg_from_fmt.F90 @@ -29,16 +29,11 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_mv_csrg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_csrg_mat_mod, psb_protect_name => psb_s_cuda_mv_csrg_from_fmt -#else - use psb_s_cuda_csrg_mat_mod -#endif implicit none class(psb_s_cuda_csrg_sparse_mat), intent(inout) :: a @@ -55,9 +50,7 @@ subroutine psb_s_cuda_mv_csrg_from_fmt(a,b,info) class default call a%psb_s_csr_sparse_mat%mv_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_s_cuda_mv_csrg_from_fmt diff --git a/cuda/impl/psb_s_cuda_mv_diag_from_coo.F90 b/cuda/impl/psb_s_cuda_mv_diag_from_coo.F90 index fda60d96..1b2fe8a1 100644 --- a/cuda/impl/psb_s_cuda_mv_diag_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_mv_diag_from_coo.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_mv_diag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_s_cuda_diag_mat_mod, psb_protect_name => psb_s_cuda_mv_diag_from_coo -#else - use psb_s_cuda_diag_mat_mod -#endif implicit none diff --git a/cuda/impl/psb_s_cuda_mv_elg_from_coo.F90 b/cuda/impl/psb_s_cuda_mv_elg_from_coo.F90 index 447e2971..e8dbbabf 100644 --- a/cuda/impl/psb_s_cuda_mv_elg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_mv_elg_from_coo.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_s_cuda_mv_elg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_mv_elg_from_coo -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a @@ -57,5 +52,4 @@ subroutine psb_s_cuda_mv_elg_from_coo(a,b,info) return - end subroutine psb_s_cuda_mv_elg_from_coo diff --git a/cuda/impl/psb_s_cuda_mv_elg_from_fmt.F90 b/cuda/impl/psb_s_cuda_mv_elg_from_fmt.F90 index e88080dd..21d9a339 100644 --- a/cuda/impl/psb_s_cuda_mv_elg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_mv_elg_from_fmt.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - + subroutine psb_s_cuda_mv_elg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_s_cuda_elg_mat_mod, psb_protect_name => psb_s_cuda_mv_elg_from_fmt -#else - use psb_s_cuda_elg_mat_mod -#endif implicit none class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a @@ -49,9 +44,7 @@ subroutine psb_s_cuda_mv_elg_from_fmt(a,b,info) !locals type(psb_s_coo_sparse_mat) :: tmp Integer(Psb_ipk_) :: nza, nr, i,j,irw, idl,err_act, nc, ld, nzm, m -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = psb_success_ @@ -65,13 +58,9 @@ subroutine psb_s_cuda_mv_elg_from_fmt(a,b,info) m = b%get_nrows() nc = b%get_ncols() nza = b%get_nzeros() -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) ld = gpu_parms%pitch nzm = gpu_parms%maxRowSize -#else - ld = m -#endif a%psb_s_base_sparse_mat = b%psb_s_base_sparse_mat call move_alloc(b%irn, a%irn) call move_alloc(b%idiag, a%idiag) @@ -87,9 +76,7 @@ subroutine psb_s_cuda_mv_elg_from_fmt(a,b,info) end if a%nzt = nza call b%free() -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif class default call b%mv_to_coo(tmp,info) diff --git a/cuda/impl/psb_s_cuda_mv_hdiag_from_coo.F90 b/cuda/impl/psb_s_cuda_mv_hdiag_from_coo.F90 index f3252eb2..b0370ebb 100644 --- a/cuda/impl/psb_s_cuda_mv_hdiag_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_mv_hdiag_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_s_cuda_mv_hdiag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_s_cuda_hdiag_mat_mod, psb_protect_name => psb_s_cuda_mv_hdiag_from_coo use psb_cuda_env_mod -#else - use psb_s_cuda_hdiag_mat_mod -#endif implicit none @@ -54,16 +48,12 @@ subroutine psb_s_cuda_mv_hdiag_from_coo(a,b,info) info = psb_success_ -#ifdef HAVE_SPGPU a%hacksize = psb_cuda_WarpSize() -#endif call a%psb_s_hdia_sparse_mat%mv_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_s_cuda_mv_hlg_from_coo.F90 b/cuda/impl/psb_s_cuda_mv_hlg_from_coo.F90 index 9810a85e..4c8aab71 100644 --- a/cuda/impl/psb_s_cuda_mv_hlg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_mv_hlg_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_s_cuda_mv_hlg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_cuda_env_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_mv_hlg_from_coo -#else - use psb_s_cuda_hlg_mat_mod -#endif implicit none class(psb_s_cuda_hlg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_s_cuda_mv_hlg_from_fmt.F90 b/cuda/impl/psb_s_cuda_mv_hlg_from_fmt.F90 index 700dc151..a162e2aa 100644 --- a/cuda/impl/psb_s_cuda_mv_hlg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_mv_hlg_from_fmt.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_s_cuda_mv_hlg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_s_cuda_hlg_mat_mod, psb_protect_name => psb_s_cuda_mv_hlg_from_fmt -#else - use psb_s_cuda_hlg_mat_mod -#endif implicit none class(psb_s_cuda_hlg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_s_cuda_mv_hybg_from_coo.F90 b/cuda/impl/psb_s_cuda_mv_hybg_from_coo.F90 index ca9f34c1..ddae4546 100644 --- a/cuda/impl/psb_s_cuda_mv_hybg_from_coo.F90 +++ b/cuda/impl/psb_s_cuda_mv_hybg_from_coo.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_mv_hybg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_mv_hybg_from_coo -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none class(psb_s_cuda_hybg_sparse_mat), intent(inout) :: a @@ -50,10 +46,8 @@ subroutine psb_s_cuda_mv_hybg_from_coo(a,b,info) call a%psb_s_csr_sparse_mat%mv_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_s_cuda_mv_hybg_from_fmt.F90 b/cuda/impl/psb_s_cuda_mv_hybg_from_fmt.F90 index 5ba606af..c6250104 100644 --- a/cuda/impl/psb_s_cuda_mv_hybg_from_fmt.F90 +++ b/cuda/impl/psb_s_cuda_mv_hybg_from_fmt.F90 @@ -33,12 +33,8 @@ subroutine psb_s_cuda_mv_hybg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_s_cuda_hybg_mat_mod, psb_protect_name => psb_s_cuda_mv_hybg_from_fmt -#else - use psb_s_cuda_hybg_mat_mod -#endif implicit none class(psb_s_cuda_hybg_sparse_mat), intent(inout) :: a @@ -54,9 +50,7 @@ subroutine psb_s_cuda_mv_hybg_from_fmt(a,b,info) class default call a%psb_s_csr_sparse_mat%mv_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_s_cuda_mv_hybg_from_fmt #endif diff --git a/cuda/impl/psb_z_cuda_cp_csrg_from_coo.F90 b/cuda/impl/psb_z_cuda_cp_csrg_from_coo.F90 index 186190ac..90f3fb4f 100644 --- a/cuda/impl/psb_z_cuda_cp_csrg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_cp_csrg_from_coo.F90 @@ -32,12 +32,8 @@ subroutine psb_z_cuda_cp_csrg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_cp_csrg_from_coo -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none class(psb_z_cuda_csrg_sparse_mat), intent(inout) :: a @@ -48,10 +44,8 @@ subroutine psb_z_cuda_cp_csrg_from_coo(a,b,info) call a%psb_z_csr_sparse_mat%cp_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_z_cuda_cp_csrg_from_fmt.F90 b/cuda/impl/psb_z_cuda_cp_csrg_from_fmt.F90 index d1e1a82d..26490a15 100644 --- a/cuda/impl/psb_z_cuda_cp_csrg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_cp_csrg_from_fmt.F90 @@ -32,12 +32,8 @@ subroutine psb_z_cuda_cp_csrg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_cp_csrg_from_fmt -#else - use psb_z_cuda_csrg_mat_mod -#endif !use iso_c_binding implicit none @@ -53,9 +49,7 @@ subroutine psb_z_cuda_cp_csrg_from_fmt(a,b,info) class default call a%psb_z_csr_sparse_mat%cp_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_z_cuda_cp_csrg_from_fmt diff --git a/cuda/impl/psb_z_cuda_cp_diag_from_coo.F90 b/cuda/impl/psb_z_cuda_cp_diag_from_coo.F90 index c303b127..34706502 100644 --- a/cuda/impl/psb_z_cuda_cp_diag_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_cp_diag_from_coo.F90 @@ -33,13 +33,9 @@ subroutine psb_z_cuda_cp_diag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_z_cuda_diag_mat_mod, psb_protect_name => psb_z_cuda_cp_diag_from_coo -#else - use psb_z_cuda_diag_mat_mod -#endif implicit none class(psb_z_cuda_diag_sparse_mat), intent(inout) :: a @@ -50,10 +46,8 @@ subroutine psb_z_cuda_cp_diag_from_coo(a,b,info) info = psb_success_ call a%psb_z_dia_sparse_mat%cp_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_z_cuda_cp_elg_from_coo.F90 b/cuda/impl/psb_z_cuda_cp_elg_from_coo.F90 index 4b18b89b..e8553cbf 100644 --- a/cuda/impl/psb_z_cuda_cp_elg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_cp_elg_from_coo.F90 @@ -28,20 +28,14 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_z_cuda_cp_elg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_cp_elg_from_coo use psi_ext_util_mod use psb_cuda_env_mod -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a @@ -57,16 +51,11 @@ subroutine psb_z_cuda_cp_elg_from_coo(a,b,info) integer(psb_ipk_), allocatable :: idisp(:) info = psb_success_ -#ifdef HAVE_SPGPU hacksize = max(1,psb_cuda_WarpSize()) -#else - hacksize = 1 -#endif if (b%is_dev()) call b%sync() if (b%is_by_rows()) then -#ifdef HAVE_SPGPU call psi_z_count_ell_from_coo(a,b,idisp,ldv,nzm,info,hacksize=hacksize) @@ -82,15 +71,8 @@ subroutine psb_z_cuda_cp_elg_from_coo(a,b,info) if (info == 0) info = psi_CopyCooToElg(nr,nc,nza, hacksize,ldv,nzm, & & a%irn,idisp,b%ja,b%val, a%deviceMat) call a%set_dev() -#else - - call psi_z_convert_ell_from_coo(a,b,info,hacksize=hacksize) - call a%set_host() -#endif - else call b%cp_to_coo(tmp,info) -#ifdef HAVE_SPGPU call psi_z_count_ell_from_coo(a,tmp,idisp,ldv,nzm,info,hacksize=hacksize) @@ -107,11 +89,6 @@ subroutine psb_z_cuda_cp_elg_from_coo(a,b,info) & a%irn,idisp,tmp%ja,tmp%val, a%deviceMat) call a%set_dev() -#else - - call psi_z_convert_ell_from_coo(a,tmp,info,hacksize=hacksize) - call a%set_host() -#endif end if if (info /= psb_success_) goto 9999 diff --git a/cuda/impl/psb_z_cuda_cp_elg_from_fmt.F90 b/cuda/impl/psb_z_cuda_cp_elg_from_fmt.F90 index 6fa91de6..85066cef 100644 --- a/cuda/impl/psb_z_cuda_cp_elg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_cp_elg_from_fmt.F90 @@ -33,13 +33,9 @@ subroutine psb_z_cuda_cp_elg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_cp_elg_from_fmt -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a @@ -51,9 +47,7 @@ subroutine psb_z_cuda_cp_elg_from_fmt(a,b,info) Integer(Psb_ipk_) :: nza, nr, i,j,irw, idl,err_act, nc, ld, nzm, m integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = psb_success_ if (b%is_dev()) call b%sync() @@ -67,13 +61,9 @@ subroutine psb_z_cuda_cp_elg_from_fmt(a,b,info) m = b%get_nrows() nc = b%get_ncols() nza = b%get_nzeros() -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) ld = gpu_parms%pitch nzm = gpu_parms%maxRowSize -#else - ld = m -#endif a%psb_z_base_sparse_mat = b%psb_z_base_sparse_mat if (info == 0) call psb_safe_cpy( b%idiag, a%idiag , info) if (info == 0) call psb_safe_cpy( b%irn, a%irn , info) @@ -88,9 +78,7 @@ subroutine psb_z_cuda_cp_elg_from_fmt(a,b,info) a%val(1:m,1:nzm) = b%val(1:m,1:nzm) end if a%nzt = nza -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif class default diff --git a/cuda/impl/psb_z_cuda_cp_hdiag_from_coo.F90 b/cuda/impl/psb_z_cuda_cp_hdiag_from_coo.F90 index c94d8824..36013faa 100644 --- a/cuda/impl/psb_z_cuda_cp_hdiag_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_cp_hdiag_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_z_cuda_cp_hdiag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_z_cuda_hdiag_mat_mod, psb_protect_name => psb_z_cuda_cp_hdiag_from_coo use psb_cuda_env_mod -#else - use psb_z_cuda_hdiag_mat_mod -#endif implicit none class(psb_z_cuda_hdiag_sparse_mat), intent(inout) :: a @@ -53,16 +47,12 @@ subroutine psb_z_cuda_cp_hdiag_from_coo(a,b,info) info = psb_success_ -#ifdef HAVE_SPGPU a%hacksize = psb_cuda_WarpSize() -#endif call a%psb_z_hdia_sparse_mat%cp_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_z_cuda_cp_hlg_from_coo.F90 b/cuda/impl/psb_z_cuda_cp_hlg_from_coo.F90 index 1607f1b6..f7be0835 100644 --- a/cuda/impl/psb_z_cuda_cp_hlg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_cp_hlg_from_coo.F90 @@ -33,14 +33,10 @@ subroutine psb_z_cuda_cp_hlg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_cuda_env_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_cp_hlg_from_coo -#else - use psb_z_cuda_hlg_mat_mod -#endif implicit none class(psb_z_cuda_hlg_sparse_mat), intent(inout) :: a @@ -61,11 +57,7 @@ subroutine psb_z_cuda_cp_hlg_from_coo(a,b,info) info = psb_success_ debug_unit = psb_get_debug_unit() debug_level = psb_get_debug_level() -#ifdef HAVE_SPGPU hksz = max(1,psb_cuda_WarpSize()) -#else - hksz = psi_get_hksz() -#endif if (b%is_by_rows()) then diff --git a/cuda/impl/psb_z_cuda_cp_hlg_from_fmt.F90 b/cuda/impl/psb_z_cuda_cp_hlg_from_fmt.F90 index e8c1f95d..253a034f 100644 --- a/cuda/impl/psb_z_cuda_cp_hlg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_cp_hlg_from_fmt.F90 @@ -33,13 +33,9 @@ subroutine psb_z_cuda_cp_hlg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_cp_hlg_from_fmt -#else - use psb_z_cuda_hlg_mat_mod -#endif implicit none class(psb_z_cuda_hlg_sparse_mat), intent(inout) :: a @@ -53,9 +49,7 @@ subroutine psb_z_cuda_cp_hlg_from_fmt(a,b,info) call a%cp_from_coo(b,info) class default call a%psb_z_hll_sparse_mat%cp_from_fmt(b,info) -#ifdef HAVE_SPGPU if (info == 0) call a%to_gpu(info) -#endif end select if (info /= 0) goto 9999 diff --git a/cuda/impl/psb_z_cuda_cp_hybg_from_coo.F90 b/cuda/impl/psb_z_cuda_cp_hybg_from_coo.F90 index 6031526a..a6491d68 100644 --- a/cuda/impl/psb_z_cuda_cp_hybg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_cp_hybg_from_coo.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_cp_hybg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_cp_hybg_from_coo -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none class(psb_z_cuda_hybg_sparse_mat), intent(inout) :: a @@ -49,10 +45,8 @@ subroutine psb_z_cuda_cp_hybg_from_coo(a,b,info) call a%psb_z_csr_sparse_mat%cp_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_z_cuda_cp_hybg_from_fmt.F90 b/cuda/impl/psb_z_cuda_cp_hybg_from_fmt.F90 index 0202ef24..748fadca 100644 --- a/cuda/impl/psb_z_cuda_cp_hybg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_cp_hybg_from_fmt.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_cp_hybg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_cp_hybg_from_fmt -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none class(psb_z_cuda_hybg_sparse_mat), intent(inout) :: a @@ -53,9 +49,7 @@ subroutine psb_z_cuda_cp_hybg_from_fmt(a,b,info) class default call a%psb_z_csr_sparse_mat%cp_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_z_cuda_cp_hybg_from_fmt diff --git a/cuda/impl/psb_z_cuda_csrg_allocate_mnnz.F90 b/cuda/impl/psb_z_cuda_csrg_allocate_mnnz.F90 index a7533e59..a7988dd3 100644 --- a/cuda/impl/psb_z_cuda_csrg_allocate_mnnz.F90 +++ b/cuda/impl/psb_z_cuda_csrg_allocate_mnnz.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_csrg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_allocate_mnnz -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_z_cuda_csrg_sparse_mat), intent(inout) :: a @@ -52,11 +48,9 @@ subroutine psb_z_cuda_csrg_allocate_mnnz(m,n,a,nz) call a%psb_z_csr_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU info = initFcusparse() if (info == 0) call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_csrg_csmm.F90 b/cuda/impl/psb_z_cuda_csrg_csmm.F90 index 49fb9fcf..731b7417 100644 --- a/cuda/impl/psb_z_cuda_csrg_csmm.F90 +++ b/cuda/impl/psb_z_cuda_csrg_csmm.F90 @@ -33,14 +33,10 @@ subroutine psb_z_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_csmm -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none class(psb_z_cuda_csrg_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:,:) @@ -94,7 +90,6 @@ subroutine psb_z_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -119,9 +114,6 @@ subroutine psb_z_cuda_csrg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_csrg_csmv.F90 b/cuda/impl/psb_z_cuda_csrg_csmv.F90 index 54ad6f4f..f6b01e7e 100644 --- a/cuda/impl/psb_z_cuda_csrg_csmv.F90 +++ b/cuda/impl/psb_z_cuda_csrg_csmv.F90 @@ -33,14 +33,10 @@ subroutine psb_z_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_csmv -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none class(psb_z_cuda_csrg_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -96,7 +92,6 @@ subroutine psb_z_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -124,9 +119,6 @@ subroutine psb_z_cuda_csrg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_csrg_from_gpu.F90 b/cuda/impl/psb_z_cuda_csrg_from_gpu.F90 index bb3b49d5..78db4435 100644 --- a/cuda/impl/psb_z_cuda_csrg_from_gpu.F90 +++ b/cuda/impl/psb_z_cuda_csrg_from_gpu.F90 @@ -33,13 +33,9 @@ subroutine psb_z_cuda_csrg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_from_gpu -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none class(psb_z_cuda_csrg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +44,6 @@ subroutine psb_z_cuda_csrg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (.not.(c_associated(a%deviceMat%mat))) then call a%free() return @@ -68,6 +63,5 @@ subroutine psb_z_cuda_csrg_from_gpu(a,info) #endif call a%set_sync() -#endif end subroutine psb_z_cuda_csrg_from_gpu diff --git a/cuda/impl/psb_z_cuda_csrg_inner_vect_sv.F90 b/cuda/impl/psb_z_cuda_csrg_inner_vect_sv.F90 index 6c7b1fcb..9a3f8281 100644 --- a/cuda/impl/psb_z_cuda_csrg_inner_vect_sv.F90 +++ b/cuda/impl/psb_z_cuda_csrg_inner_vect_sv.F90 @@ -32,13 +32,9 @@ subroutine psb_z_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_inner_vect_sv -#else - use psb_z_cuda_csrg_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_csrg_sparse_mat), intent(in) :: a @@ -75,7 +71,6 @@ subroutine psb_z_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra.or.(beta/=dzero)) then call x%sync() call y%sync() @@ -112,12 +107,6 @@ subroutine psb_z_cuda_csrg_inner_vect_sv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call x%sync() - call y%sync() - call a%psb_z_csr_sparse_mat%inner_spsm(alpha,x,beta,y,info,trans) - call y%set_host() -#endif if (info /= psb_success_) then info = psb_err_from_subroutine_ call psb_errpush(info,name, a_err='csrg_vect_sv') diff --git a/cuda/impl/psb_z_cuda_csrg_reallocate_nz.F90 b/cuda/impl/psb_z_cuda_csrg_reallocate_nz.F90 index 61ae0f59..964cd84e 100644 --- a/cuda/impl/psb_z_cuda_csrg_reallocate_nz.F90 +++ b/cuda/impl/psb_z_cuda_csrg_reallocate_nz.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_csrg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_reallocate_nz -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_z_cuda_csrg_sparse_mat), intent(inout) :: a @@ -55,10 +51,8 @@ subroutine psb_z_cuda_csrg_reallocate_nz(nz,a) ! call a%psb_z_csr_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_csrg_scal.F90 b/cuda/impl/psb_z_cuda_csrg_scal.F90 index a2099933..9d97433e 100644 --- a/cuda/impl/psb_z_cuda_csrg_scal.F90 +++ b/cuda/impl/psb_z_cuda_csrg_scal.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_csrg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_scal -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none class(psb_z_cuda_csrg_sparse_mat), intent(inout) :: a complex(psb_dpk_), intent(in) :: d(:) @@ -58,10 +54,8 @@ subroutine psb_z_cuda_csrg_scal(d,a,info,side) call a%psb_z_csr_sparse_mat%scal(d,info,side=side) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_csrg_scals.F90 b/cuda/impl/psb_z_cuda_csrg_scals.F90 index 72fee99b..1479ea3a 100644 --- a/cuda/impl/psb_z_cuda_csrg_scals.F90 +++ b/cuda/impl/psb_z_cuda_csrg_scals.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_csrg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_scals -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none class(psb_z_cuda_csrg_sparse_mat), intent(inout) :: a complex(psb_dpk_), intent(in) :: d @@ -56,10 +52,8 @@ subroutine psb_z_cuda_csrg_scals(d,a,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_csrg_to_gpu.F90 b/cuda/impl/psb_z_cuda_csrg_to_gpu.F90 index c6f217ab..f7e65627 100644 --- a/cuda/impl/psb_z_cuda_csrg_to_gpu.F90 +++ b/cuda/impl/psb_z_cuda_csrg_to_gpu.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_csrg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_to_gpu -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none class(psb_z_cuda_csrg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -51,7 +47,6 @@ subroutine psb_z_cuda_csrg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -320,6 +315,5 @@ subroutine psb_z_cuda_csrg_to_gpu(a,info,nzrm) if (info /= 0) then write(0,*) 'Error in CSRG_TO_GPU ',info end if -#endif end subroutine psb_z_cuda_csrg_to_gpu diff --git a/cuda/impl/psb_z_cuda_csrg_vect_mv.F90 b/cuda/impl/psb_z_cuda_csrg_vect_mv.F90 index 964134fb..977d7ff9 100644 --- a/cuda/impl/psb_z_cuda_csrg_vect_mv.F90 +++ b/cuda/impl/psb_z_cuda_csrg_vect_mv.F90 @@ -33,14 +33,10 @@ subroutine psb_z_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_csrg_vect_mv -#else - use psb_z_cuda_csrg_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_csrg_sparse_mat), intent(in) :: a @@ -72,7 +68,6 @@ subroutine psb_z_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= zzero) then @@ -112,9 +107,6 @@ subroutine psb_z_cuda_csrg_vect_mv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_diag_csmv.F90 b/cuda/impl/psb_z_cuda_diag_csmv.F90 index 2e86f0f8..fde7147e 100644 --- a/cuda/impl/psb_z_cuda_diag_csmv.F90 +++ b/cuda/impl/psb_z_cuda_diag_csmv.F90 @@ -33,13 +33,9 @@ subroutine psb_z_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_z_cuda_diag_mat_mod, psb_protect_name => psb_z_cuda_diag_csmv -#else - use psb_z_cuda_diag_mat_mod -#endif implicit none class(psb_z_cuda_diag_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +90,6 @@ subroutine psb_z_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_z_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +116,6 @@ subroutine psb_z_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -132,5 +124,4 @@ subroutine psb_z_cuda_diag_csmv(alpha,a,x,beta,y,info,trans) return - end subroutine psb_z_cuda_diag_csmv diff --git a/cuda/impl/psb_z_cuda_diag_to_gpu.F90 b/cuda/impl/psb_z_cuda_diag_to_gpu.F90 index a28858b5..672ce938 100644 --- a/cuda/impl/psb_z_cuda_diag_to_gpu.F90 +++ b/cuda/impl/psb_z_cuda_diag_to_gpu.F90 @@ -33,13 +33,9 @@ subroutine psb_z_cuda_diag_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_z_cuda_diag_mat_mod, psb_protect_name => psb_z_cuda_diag_to_gpu -#else - use psb_z_cuda_diag_mat_mod -#endif use iso_c_binding implicit none class(psb_z_cuda_diag_sparse_mat), intent(inout) :: a @@ -47,13 +43,10 @@ subroutine psb_z_cuda_diag_to_gpu(a,info,nzrm) integer(psb_ipk_), intent(in), optional :: nzrm integer(psb_ipk_) :: m, nzm, n, c,pitch,maxrowsize,d -#ifdef HAVE_SPGPU type(diagdev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%data)).or.(.not.allocated(a%offset))) return n = size(a%data,1) @@ -69,6 +62,5 @@ subroutine psb_z_cuda_diag_to_gpu(a,info,nzrm) if (info == 0) info = & & writeDiagDevice(a%deviceMat,a%data,a%offset,n) ! if (info /= 0) goto 9999 -#endif end subroutine psb_z_cuda_diag_to_gpu diff --git a/cuda/impl/psb_z_cuda_diag_vect_mv.F90 b/cuda/impl/psb_z_cuda_diag_vect_mv.F90 index 12f3c3e7..c6d11f04 100644 --- a/cuda/impl/psb_z_cuda_diag_vect_mv.F90 +++ b/cuda/impl/psb_z_cuda_diag_vect_mv.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_z_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_z_cuda_diag_mat_mod, psb_protect_name => psb_z_cuda_diag_vect_mv -#else - use psb_z_cuda_diag_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_diag_sparse_mat), intent(in) :: a @@ -71,7 +65,6 @@ subroutine psb_z_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= szero) then @@ -112,9 +105,6 @@ subroutine psb_z_cuda_diag_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_z_dia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_dnsg_mat_impl.F90 b/cuda/impl/psb_z_cuda_dnsg_mat_impl.F90 index c2a641b6..c79a7e8c 100644 --- a/cuda/impl/psb_z_cuda_dnsg_mat_impl.F90 +++ b/cuda/impl/psb_z_cuda_dnsg_mat_impl.F90 @@ -32,13 +32,9 @@ subroutine psb_z_cuda_dnsg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod use psb_z_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_z_vectordev_mod use psb_z_cuda_dnsg_mat_mod, psb_protect_name => psb_z_cuda_dnsg_vect_mv -#else - use psb_z_cuda_dnsg_mat_mod -#endif implicit none class(psb_z_cuda_dnsg_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta @@ -123,13 +119,9 @@ end subroutine psb_z_cuda_dnsg_vect_mv subroutine psb_z_cuda_dnsg_mold(a,b,info) use psb_base_mod use psb_z_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_z_vectordev_mod use psb_z_cuda_dnsg_mat_mod, psb_protect_name => psb_z_cuda_dnsg_mold -#else - use psb_z_cuda_dnsg_mat_mod -#endif implicit none class(psb_z_cuda_dnsg_sparse_mat), intent(in) :: a class(psb_z_base_sparse_mat), intent(inout), allocatable :: b @@ -190,17 +182,12 @@ end subroutine psb_z_cuda_dnsg_mold !!$ end subroutine psb_z_cuda_dnsg_allocate_mnnz !!$ end interface - subroutine psb_z_cuda_dnsg_to_gpu(a,info) use psb_base_mod use psb_z_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_z_vectordev_mod use psb_z_cuda_dnsg_mat_mod, psb_protect_name => psb_z_cuda_dnsg_to_gpu -#else - use psb_z_cuda_dnsg_mat_mod -#endif class(psb_z_cuda_dnsg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info Integer(Psb_ipk_) :: err_act, pitch, lda @@ -209,15 +196,12 @@ subroutine psb_z_cuda_dnsg_to_gpu(a,info) call psb_erractionsave(err_act) info = psb_success_ -#ifdef HAVE_SPGPU if (debug) write(0,*) 'DNS_TO_GPU',size(a%val,1),size(a%val,2) info = FallocDnsDevice(a%deviceMat,a%get_nrows(),a%get_ncols(),& & spgpu_type_complex_double,1) if (info == 0) info = writeDnsDevice(a%deviceMat,a%val,size(a%val,1),size(a%val,2)) if (debug) write(0,*) 'DNS_TO_GPU: From writeDnsDEvice',info - -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return @@ -233,13 +217,9 @@ end subroutine psb_z_cuda_dnsg_to_gpu subroutine psb_z_cuda_cp_dnsg_from_coo(a,b,info) use psb_base_mod use psb_z_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_z_vectordev_mod use psb_z_cuda_dnsg_mat_mod, psb_protect_name => psb_z_cuda_cp_dnsg_from_coo -#else - use psb_z_cuda_dnsg_mat_mod -#endif implicit none class(psb_z_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -272,13 +252,9 @@ end subroutine psb_z_cuda_cp_dnsg_from_coo subroutine psb_z_cuda_cp_dnsg_from_fmt(a,b,info) use psb_base_mod use psb_z_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_z_vectordev_mod use psb_z_cuda_dnsg_mat_mod, psb_protect_name => psb_z_cuda_cp_dnsg_from_fmt -#else - use psb_z_cuda_dnsg_mat_mod -#endif implicit none class(psb_z_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -348,13 +324,9 @@ end subroutine psb_z_cuda_cp_dnsg_from_fmt subroutine psb_z_cuda_mv_dnsg_from_coo(a,b,info) use psb_base_mod use psb_z_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_z_vectordev_mod use psb_z_cuda_dnsg_mat_mod, psb_protect_name => psb_z_cuda_mv_dnsg_from_coo -#else - use psb_z_cuda_dnsg_mat_mod -#endif implicit none class(psb_z_cuda_dnsg_sparse_mat), intent(inout) :: a @@ -383,18 +355,13 @@ subroutine psb_z_cuda_mv_dnsg_from_coo(a,b,info) return end subroutine psb_z_cuda_mv_dnsg_from_coo - - + subroutine psb_z_cuda_mv_dnsg_from_fmt(a,b,info) use psb_base_mod use psb_z_cuda_vect_mod -#ifdef HAVE_SPGPU use dnsdev_mod use psb_z_vectordev_mod use psb_z_cuda_dnsg_mat_mod, psb_protect_name => psb_z_cuda_mv_dnsg_from_fmt -#else - use psb_z_cuda_dnsg_mat_mod -#endif implicit none class(psb_z_cuda_dnsg_sparse_mat), intent(inout) :: a class(psb_z_base_sparse_mat), intent(inout) :: b diff --git a/cuda/impl/psb_z_cuda_elg_allocate_mnnz.F90 b/cuda/impl/psb_z_cuda_elg_allocate_mnnz.F90 index a2e36feb..5c54d00b 100644 --- a/cuda/impl/psb_z_cuda_elg_allocate_mnnz.F90 +++ b/cuda/impl/psb_z_cuda_elg_allocate_mnnz.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_z_cuda_elg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_allocate_mnnz -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a @@ -47,9 +41,7 @@ subroutine psb_z_cuda_elg_allocate_mnnz(m,n,a,nz) Integer(Psb_ipk_) :: err_act, info, nz_,ld character(len=20) :: name='allocate_mnz' logical, parameter :: debug=.false. -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif call psb_erractionsave(err_act) info = psb_success_ @@ -74,13 +66,9 @@ subroutine psb_z_cuda_elg_allocate_mnnz(m,n,a,nz) goto 9999 endif -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nz_,nz_*m,n,spgpu_type_complex_double,1) ld = gpu_parms%pitch nz_ = gpu_parms%maxRowSize -#else - ld = m -#endif if (info == psb_success_) call psb_realloc(m,a%irn,info) if (info == psb_success_) call psb_realloc(m,a%idiag,info) @@ -98,10 +86,8 @@ subroutine psb_z_cuda_elg_allocate_mnnz(m,n,a,nz) call a%set_dupl(psb_dupl_def_) end if -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz_) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_elg_asb.f90 b/cuda/impl/psb_z_cuda_elg_asb.f90 index 511183f5..65b58425 100644 --- a/cuda/impl/psb_z_cuda_elg_asb.f90 +++ b/cuda/impl/psb_z_cuda_elg_asb.f90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_asb(a) use psb_base_mod diff --git a/cuda/impl/psb_z_cuda_elg_csmm.F90 b/cuda/impl/psb_z_cuda_elg_csmm.F90 index d4034b65..4414f0e6 100644 --- a/cuda/impl/psb_z_cuda_elg_csmm.F90 +++ b/cuda/impl/psb_z_cuda_elg_csmm.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_csmm -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:,:) @@ -92,8 +87,6 @@ subroutine psb_z_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) goto 9999 end if - -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() call a%psb_z_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) @@ -119,9 +112,6 @@ subroutine psb_z_cuda_elg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_elg_csmv.F90 b/cuda/impl/psb_z_cuda_elg_csmv.F90 index eba12d16..060147b9 100644 --- a/cuda/impl/psb_z_cuda_elg_csmv.F90 +++ b/cuda/impl/psb_z_cuda_elg_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_csmv -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_z_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() call a%psb_z_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) @@ -122,9 +116,6 @@ subroutine psb_z_cuda_elg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_elg_csput.F90 b/cuda/impl/psb_z_cuda_elg_csput.F90 index 5a52f4f8..a9eb7c43 100644 --- a/cuda/impl/psb_z_cuda_elg_csput.F90 +++ b/cuda/impl/psb_z_cuda_elg_csput.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_base_mod use iso_c_binding -#ifdef HAVE_SPGPU use elldev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_csput_a -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a @@ -128,13 +123,9 @@ subroutine psb_z_cuda_elg_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) use psb_base_mod use iso_c_binding -#ifdef HAVE_SPGPU use elldev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_csput_v use psb_z_cuda_vect_mod -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_z_cuda_elg_from_gpu.F90 b/cuda/impl/psb_z_cuda_elg_from_gpu.F90 index ffed4349..b1291ab2 100644 --- a/cuda/impl/psb_z_cuda_elg_from_gpu.F90 +++ b/cuda/impl/psb_z_cuda_elg_from_gpu.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - + subroutine psb_z_cuda_elg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_from_gpu -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +43,6 @@ subroutine psb_z_cuda_elg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (.not.(c_associated(a%deviceMat))) then call a%free() return @@ -69,6 +63,5 @@ subroutine psb_z_cuda_elg_from_gpu(a,info) if (info == 0) info = & & readEllDevice(a%deviceMat,a%val,a%ja,pitch,a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_z_cuda_elg_from_gpu diff --git a/cuda/impl/psb_z_cuda_elg_inner_vect_sv.F90 b/cuda/impl/psb_z_cuda_elg_inner_vect_sv.F90 index 7564d5dd..443e7cbb 100644 --- a/cuda/impl/psb_z_cuda_elg_inner_vect_sv.F90 +++ b/cuda/impl/psb_z_cuda_elg_inner_vect_sv.F90 @@ -27,19 +27,14 @@ ! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. -! - +! subroutine psb_z_cuda_elg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_inner_vect_sv -#else - use psb_z_cuda_elg_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_elg_sparse_mat), intent(in) :: a diff --git a/cuda/impl/psb_z_cuda_elg_mold.F90 b/cuda/impl/psb_z_cuda_elg_mold.F90 index e027c9f2..e9a3891d 100644 --- a/cuda/impl/psb_z_cuda_elg_mold.F90 +++ b/cuda/impl/psb_z_cuda_elg_mold.F90 @@ -28,8 +28,6 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_z_cuda_elg_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_z_cuda_elg_reallocate_nz.F90 b/cuda/impl/psb_z_cuda_elg_reallocate_nz.F90 index 16cebe70..3a8c2760 100644 --- a/cuda/impl/psb_z_cuda_elg_reallocate_nz.F90 +++ b/cuda/impl/psb_z_cuda_elg_reallocate_nz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_reallocate_nz -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a @@ -64,10 +59,8 @@ subroutine psb_z_cuda_elg_reallocate_nz(nz,a) goto 9999 end if -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nzrm) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_elg_scal.F90 b/cuda/impl/psb_z_cuda_elg_scal.F90 index 4802aaaa..a9846362 100644 --- a/cuda/impl/psb_z_cuda_elg_scal.F90 +++ b/cuda/impl/psb_z_cuda_elg_scal.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_scal -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a complex(psb_dpk_), intent(in) :: d(:) @@ -63,10 +58,8 @@ subroutine psb_z_cuda_elg_scal(d,a,info,side) call a%psb_z_ell_sparse_mat%scal(d,info,side) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_elg_scals.F90 b/cuda/impl/psb_z_cuda_elg_scals.F90 index 5db823da..b4462589 100644 --- a/cuda/impl/psb_z_cuda_elg_scals.F90 +++ b/cuda/impl/psb_z_cuda_elg_scals.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_scals -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a complex(psb_dpk_), intent(in) :: d @@ -59,10 +54,8 @@ subroutine psb_z_cuda_elg_scals(d,a,info) a%val(:,:) = a%val(:,:) * d -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_z_cuda_elg_to_gpu.F90 b/cuda/impl/psb_z_cuda_elg_to_gpu.F90 index 6d86bdd9..3a0ecd14 100644 --- a/cuda/impl/psb_z_cuda_elg_to_gpu.F90 +++ b/cuda/impl/psb_z_cuda_elg_to_gpu.F90 @@ -29,30 +29,22 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_to_gpu -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(in), optional :: nzrm integer(psb_ipk_) :: m, nzm, n, pitch,maxrowsize, nzt -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -88,6 +80,5 @@ subroutine psb_z_cuda_elg_to_gpu(a,info,nzrm) if (info == 0) info = & & writeEllDevice(a%deviceMat,a%val,a%ja,size(a%ja,1),a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_z_cuda_elg_to_gpu diff --git a/cuda/impl/psb_z_cuda_elg_trim.f90 b/cuda/impl/psb_z_cuda_elg_trim.f90 index 3d261150..98f92efe 100644 --- a/cuda/impl/psb_z_cuda_elg_trim.f90 +++ b/cuda/impl/psb_z_cuda_elg_trim.f90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_trim(a) use psb_base_mod diff --git a/cuda/impl/psb_z_cuda_elg_vect_mv.F90 b/cuda/impl/psb_z_cuda_elg_vect_mv.F90 index 4bd1b3ed..1b1a0720 100644 --- a/cuda/impl/psb_z_cuda_elg_vect_mv.F90 +++ b/cuda/impl/psb_z_cuda_elg_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_elg_vect_mv -#else - use psb_z_cuda_elg_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_elg_sparse_mat), intent(in) :: a @@ -71,7 +66,6 @@ subroutine psb_z_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (a%is_dev()) call a%sync() if (.not.x%is_host()) call x%sync() @@ -116,10 +110,6 @@ subroutine psb_z_cuda_elg_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - if (a%is_dev()) call a%sync() - call a%psb_z_ell_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hdiag_csmv.F90 b/cuda/impl/psb_z_cuda_hdiag_csmv.F90 index 8be14704..187655a8 100644 --- a/cuda/impl/psb_z_cuda_hdiag_csmv.F90 +++ b/cuda/impl/psb_z_cuda_hdiag_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_z_cuda_hdiag_mat_mod, psb_protect_name => psb_z_cuda_hdiag_csmv -#else - use psb_z_cuda_hdiag_mat_mod -#endif implicit none class(psb_z_cuda_hdiag_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_z_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_z_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_z_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -132,5 +123,4 @@ subroutine psb_z_cuda_hdiag_csmv(alpha,a,x,beta,y,info,trans) return - end subroutine psb_z_cuda_hdiag_csmv diff --git a/cuda/impl/psb_z_cuda_hdiag_mold.F90 b/cuda/impl/psb_z_cuda_hdiag_mold.F90 index 33fdd8eb..7b86b3a3 100644 --- a/cuda/impl/psb_z_cuda_hdiag_mold.F90 +++ b/cuda/impl/psb_z_cuda_hdiag_mold.F90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hdiag_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_z_cuda_hdiag_to_gpu.F90 b/cuda/impl/psb_z_cuda_hdiag_to_gpu.F90 index 47126aca..a1140961 100644 --- a/cuda/impl/psb_z_cuda_hdiag_to_gpu.F90 +++ b/cuda/impl/psb_z_cuda_hdiag_to_gpu.F90 @@ -29,29 +29,21 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hdiag_to_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_z_cuda_hdiag_mat_mod, psb_protect_name => psb_z_cuda_hdiag_to_gpu -#else - use psb_z_cuda_hdiag_mat_mod -#endif use iso_c_binding implicit none class(psb_z_cuda_hdiag_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: nr, nc, hacksize, hackcount, allocheight -#ifdef HAVE_SPGPU type(hdiagdev_parms) :: gpu_parms -#endif info = 0 -#ifdef HAVE_SPGPU nr = a%get_nrows() nc = a%get_ncols() hacksize = a%hackSize @@ -81,6 +73,4 @@ subroutine psb_z_cuda_hdiag_to_gpu(a,info) if (info == 0) info = & & writeHdiagDevice(a%deviceMat,a%val,a%diaOffsets,a%hackOffsets) -#endif - end subroutine psb_z_cuda_hdiag_to_gpu diff --git a/cuda/impl/psb_z_cuda_hdiag_vect_mv.F90 b/cuda/impl/psb_z_cuda_hdiag_vect_mv.F90 index cf0b3457..aef5628c 100644 --- a/cuda/impl/psb_z_cuda_hdiag_vect_mv.F90 +++ b/cuda/impl/psb_z_cuda_hdiag_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_z_cuda_hdiag_mat_mod, psb_protect_name => psb_z_cuda_hdiag_vect_mv -#else - use psb_z_cuda_hdiag_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_hdiag_sparse_mat), intent(in) :: a @@ -71,7 +66,6 @@ subroutine psb_z_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= dzero) then @@ -112,9 +106,6 @@ subroutine psb_z_cuda_hdiag_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_z_hdia_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hlg_allocate_mnnz.F90 b/cuda/impl/psb_z_cuda_hlg_allocate_mnnz.F90 index 228244f1..f8566661 100644 --- a/cuda/impl/psb_z_cuda_hlg_allocate_mnnz.F90 +++ b/cuda/impl/psb_z_cuda_hlg_allocate_mnnz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_allocate_mnnz -#else - use psb_z_cuda_hlg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_z_cuda_hlg_sparse_mat), intent(inout) :: a @@ -47,19 +42,15 @@ subroutine psb_z_cuda_hlg_allocate_mnnz(m,n,a,nz) Integer(psb_ipk_) :: err_act, info, nz_,ld character(len=20) :: name='allocate_mnz' logical, parameter :: debug=.false. -#ifdef HAVE_SPGPU type(hlldev_parms) :: gpu_parms -#endif call psb_erractionsave(err_act) info = psb_success_ call a%psb_z_hll_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz_) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hlg_csmm.F90 b/cuda/impl/psb_z_cuda_hlg_csmm.F90 index 325ab0d0..8eb30ef9 100644 --- a/cuda/impl/psb_z_cuda_hlg_csmm.F90 +++ b/cuda/impl/psb_z_cuda_hlg_csmm.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_csmm -#else - use psb_z_cuda_hlg_mat_mod -#endif implicit none class(psb_z_cuda_hlg_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:,:) @@ -93,7 +88,6 @@ subroutine psb_z_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_z_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -118,9 +112,6 @@ subroutine psb_z_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return @@ -128,5 +119,4 @@ subroutine psb_z_cuda_hlg_csmm(alpha,a,x,beta,y,info,trans) return - end subroutine psb_z_cuda_hlg_csmm diff --git a/cuda/impl/psb_z_cuda_hlg_csmv.F90 b/cuda/impl/psb_z_cuda_hlg_csmv.F90 index ac84190e..1a807016 100644 --- a/cuda/impl/psb_z_cuda_hlg_csmv.F90 +++ b/cuda/impl/psb_z_cuda_hlg_csmv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_csmv -#else - use psb_z_cuda_hlg_mat_mod -#endif implicit none class(psb_z_cuda_hlg_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -94,7 +89,6 @@ subroutine psb_z_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_z_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_z_cuda_hlg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hlg_from_gpu.F90 b/cuda/impl/psb_z_cuda_hlg_from_gpu.F90 index 4db6c3ce..8260ecd7 100644 --- a/cuda/impl/psb_z_cuda_hlg_from_gpu.F90 +++ b/cuda/impl/psb_z_cuda_hlg_from_gpu.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_from_gpu(a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_from_gpu -#else - use psb_z_cuda_hlg_mat_mod -#endif implicit none class(psb_z_cuda_hlg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -48,7 +43,6 @@ subroutine psb_z_cuda_hlg_from_gpu(a,info) info = 0 -#ifdef HAVE_SPGPU if (a%is_sync()) return if (a%is_host()) return if (.not.(c_associated(a%deviceMat))) then @@ -71,6 +65,5 @@ subroutine psb_z_cuda_hlg_from_gpu(a,info) if (info == 0) info = & & readHllDevice(a%deviceMat,a%val,a%ja,a%hkoffs,a%irn,a%idiag) call a%set_sync() -#endif end subroutine psb_z_cuda_hlg_from_gpu diff --git a/cuda/impl/psb_z_cuda_hlg_inner_vect_sv.F90 b/cuda/impl/psb_z_cuda_hlg_inner_vect_sv.F90 index f99a5a9e..6a914fc0 100644 --- a/cuda/impl/psb_z_cuda_hlg_inner_vect_sv.F90 +++ b/cuda/impl/psb_z_cuda_hlg_inner_vect_sv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_inner_vect_sv -#else - use psb_z_cuda_hlg_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_hlg_sparse_mat), intent(in) :: a @@ -69,11 +64,9 @@ subroutine psb_z_cuda_hlg_inner_vect_sv(alpha,a,x,beta,y,info,trans) goto 9999 end if - call psb_erractionrestore(err_act) return - 9999 call psb_error_handler(err_act) return diff --git a/cuda/impl/psb_z_cuda_hlg_mold.F90 b/cuda/impl/psb_z_cuda_hlg_mold.F90 index cc9ad510..bc631ece 100644 --- a/cuda/impl/psb_z_cuda_hlg_mold.F90 +++ b/cuda/impl/psb_z_cuda_hlg_mold.F90 @@ -29,7 +29,6 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_mold(a,b,info) use psb_base_mod diff --git a/cuda/impl/psb_z_cuda_hlg_reallocate_nz.F90 b/cuda/impl/psb_z_cuda_hlg_reallocate_nz.F90 index aaba9be5..ac3fbbd1 100644 --- a/cuda/impl/psb_z_cuda_hlg_reallocate_nz.F90 +++ b/cuda/impl/psb_z_cuda_hlg_reallocate_nz.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_reallocate_nz -#else - use psb_z_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none integer(psb_ipk_), intent(in) :: nz @@ -52,10 +47,8 @@ subroutine psb_z_cuda_hlg_reallocate_nz(nz,a) call a%psb_z_hll_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hlg_scal.F90 b/cuda/impl/psb_z_cuda_hlg_scal.F90 index 3ffda36a..7b9df998 100644 --- a/cuda/impl/psb_z_cuda_hlg_scal.F90 +++ b/cuda/impl/psb_z_cuda_hlg_scal.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_scal -#else - use psb_z_cuda_hlg_mat_mod -#endif implicit none class(psb_z_cuda_hlg_sparse_mat), intent(inout) :: a complex(psb_dpk_), intent(in) :: d(:) @@ -60,10 +55,8 @@ subroutine psb_z_cuda_hlg_scal(d,a,info,side) call a%psb_z_hll_sparse_mat%scal(d,info,side) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hlg_scals.F90 b/cuda/impl/psb_z_cuda_hlg_scals.F90 index bae50c7c..b867e3b8 100644 --- a/cuda/impl/psb_z_cuda_hlg_scals.F90 +++ b/cuda/impl/psb_z_cuda_hlg_scals.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_scals -#else - use psb_z_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none class(psb_z_cuda_hlg_sparse_mat), intent(inout) :: a @@ -59,10 +54,8 @@ subroutine psb_z_cuda_hlg_scals(d,a,info) call a%psb_z_hll_sparse_mat%scal(d,info) if (info /= psb_success_) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hlg_to_gpu.F90 b/cuda/impl/psb_z_cuda_hlg_to_gpu.F90 index 93c9f043..8f81842a 100644 --- a/cuda/impl/psb_z_cuda_hlg_to_gpu.F90 +++ b/cuda/impl/psb_z_cuda_hlg_to_gpu.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_to_gpu -#else - use psb_z_cuda_hlg_mat_mod -#endif use iso_c_binding implicit none class(psb_z_cuda_hlg_sparse_mat), intent(inout) :: a @@ -50,7 +45,6 @@ subroutine psb_z_cuda_hlg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return n = a%get_nrows() @@ -63,6 +57,5 @@ subroutine psb_z_cuda_hlg_to_gpu(a,info,nzrm) if (info == 0) info = & & writehllDevice(a%deviceMat,a%val,a%ja,a%hkoffs,a%irn,a%idiag) ! if (info /= 0) goto 9999 -#endif end subroutine psb_z_cuda_hlg_to_gpu diff --git a/cuda/impl/psb_z_cuda_hlg_vect_mv.F90 b/cuda/impl/psb_z_cuda_hlg_vect_mv.F90 index f377efec..e2e93b85 100644 --- a/cuda/impl/psb_z_cuda_hlg_vect_mv.F90 +++ b/cuda/impl/psb_z_cuda_hlg_vect_mv.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_hlg_vect_mv -#else - use psb_z_cuda_hlg_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_hlg_sparse_mat), intent(in) :: a @@ -69,9 +64,7 @@ subroutine psb_z_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) goto 9999 endif - tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= zzero) then @@ -115,9 +108,6 @@ subroutine psb_z_cuda_hlg_vect_mv(alpha,a,x,beta,y,info,trans) end select end if -#else - call a%psb_z_hll_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hybg_allocate_mnnz.F90 b/cuda/impl/psb_z_cuda_hybg_allocate_mnnz.F90 index 0c6f9aa9..39e10134 100644 --- a/cuda/impl/psb_z_cuda_hybg_allocate_mnnz.F90 +++ b/cuda/impl/psb_z_cuda_hybg_allocate_mnnz.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_hybg_allocate_mnnz(m,n,a,nz) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_hybg_allocate_mnnz -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: m,n class(psb_z_cuda_hybg_sparse_mat), intent(inout) :: a @@ -52,11 +48,9 @@ subroutine psb_z_cuda_hybg_allocate_mnnz(m,n,a,nz) call a%psb_z_csr_sparse_mat%allocate(m,n,nz) -#ifdef HAVE_SPGPU info = initFcusparse() call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hybg_csmm.F90 b/cuda/impl/psb_z_cuda_hybg_csmm.F90 index d4a32420..bcd1874a 100644 --- a/cuda/impl/psb_z_cuda_hybg_csmm.F90 +++ b/cuda/impl/psb_z_cuda_hybg_csmm.F90 @@ -33,14 +33,10 @@ subroutine psb_z_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_hybg_csmm -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none class(psb_z_cuda_hybg_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:,:) @@ -92,8 +88,6 @@ subroutine psb_z_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) goto 9999 end if - -#ifdef HAVE_SPGPU if (tra) then call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -121,9 +115,6 @@ subroutine psb_z_cuda_hybg_csmm(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hybg_csmv.F90 b/cuda/impl/psb_z_cuda_hybg_csmv.F90 index 180a8ae1..d7c5cab6 100644 --- a/cuda/impl/psb_z_cuda_hybg_csmv.F90 +++ b/cuda/impl/psb_z_cuda_hybg_csmv.F90 @@ -33,14 +33,10 @@ subroutine psb_z_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_hybg_csmv -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none class(psb_z_cuda_hybg_sparse_mat), intent(in) :: a complex(psb_dpk_), intent(in) :: alpha, beta, x(:) @@ -95,7 +91,6 @@ subroutine psb_z_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) goto 9999 end if -#ifdef HAVE_SPGPU if (tra) then call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) else @@ -123,9 +118,6 @@ subroutine psb_z_cuda_hybg_csmv(alpha,a,x,beta,y,info,trans) call freeMultiVecDevice(gpX) call freeMultiVecDevice(gpY) endif -#else - call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hybg_inner_vect_sv.F90 b/cuda/impl/psb_z_cuda_hybg_inner_vect_sv.F90 index 1df47788..36fa3890 100644 --- a/cuda/impl/psb_z_cuda_hybg_inner_vect_sv.F90 +++ b/cuda/impl/psb_z_cuda_hybg_inner_vect_sv.F90 @@ -33,13 +33,9 @@ subroutine psb_z_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_hybg_inner_vect_sv -#else - use psb_z_cuda_hybg_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_hybg_sparse_mat), intent(in) :: a @@ -76,7 +72,6 @@ subroutine psb_z_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') -#ifdef HAVE_SPGPU if (tra.or.(beta/=zzero)) then call x%sync() call y%sync() @@ -113,12 +108,6 @@ subroutine psb_z_cuda_hybg_inner_vect_sv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call x%sync() - call y%sync() - call a%psb_z_csr_sparse_mat%inner_spsm(alpha,x,beta,y,info,trans) - call y%set_host() -#endif if (info /= psb_success_) then info = psb_err_from_subroutine_ call psb_errpush(info,name, a_err='hybg_vect_sv') diff --git a/cuda/impl/psb_z_cuda_hybg_reallocate_nz.F90 b/cuda/impl/psb_z_cuda_hybg_reallocate_nz.F90 index 5278ba35..f295b332 100644 --- a/cuda/impl/psb_z_cuda_hybg_reallocate_nz.F90 +++ b/cuda/impl/psb_z_cuda_hybg_reallocate_nz.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_hybg_reallocate_nz(nz,a) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_hybg_reallocate_nz -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none integer(psb_ipk_), intent(in) :: nz class(psb_z_cuda_hybg_sparse_mat), intent(inout) :: a @@ -55,10 +51,8 @@ subroutine psb_z_cuda_hybg_reallocate_nz(nz,a) ! call a%psb_z_csr_sparse_mat%reallocate(nz) -#ifdef HAVE_SPGPU call a%to_gpu(info,nzrm=nz) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hybg_scal.F90 b/cuda/impl/psb_z_cuda_hybg_scal.F90 index cd436e76..40b9d6b0 100644 --- a/cuda/impl/psb_z_cuda_hybg_scal.F90 +++ b/cuda/impl/psb_z_cuda_hybg_scal.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_hybg_scal(d,a,info,side) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_hybg_scal -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none class(psb_z_cuda_hybg_sparse_mat), intent(inout) :: a complex(psb_dpk_), intent(in) :: d(:) @@ -60,10 +56,8 @@ subroutine psb_z_cuda_hybg_scal(d,a,info,side) call a%psb_z_csr_sparse_mat%scal(d,info,side=side) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hybg_scals.F90 b/cuda/impl/psb_z_cuda_hybg_scals.F90 index 0a9ee79d..bd7b9224 100644 --- a/cuda/impl/psb_z_cuda_hybg_scals.F90 +++ b/cuda/impl/psb_z_cuda_hybg_scals.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_hybg_scals(d,a,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_hybg_scals -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none class(psb_z_cuda_hybg_sparse_mat), intent(inout) :: a complex(psb_dpk_), intent(in) :: d @@ -60,10 +56,8 @@ subroutine psb_z_cuda_hybg_scals(d,a,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_hybg_to_gpu.F90 b/cuda/impl/psb_z_cuda_hybg_to_gpu.F90 index 107b5049..f3a32c81 100644 --- a/cuda/impl/psb_z_cuda_hybg_to_gpu.F90 +++ b/cuda/impl/psb_z_cuda_hybg_to_gpu.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_hybg_to_gpu(a,info,nzrm) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_hybg_to_gpu -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none class(psb_z_cuda_hybg_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(out) :: info @@ -51,7 +47,6 @@ subroutine psb_z_cuda_hybg_to_gpu(a,info,nzrm) info = 0 -#ifdef HAVE_SPGPU if ((.not.allocated(a%val)).or.(.not.allocated(a%ja))) return m = a%get_nrows() @@ -148,7 +143,6 @@ subroutine psb_z_cuda_hybg_to_gpu(a,info,nzrm) if (info /= 0) then write(0,*) 'Error in HYBG_TO_GPU ',info end if -#endif end subroutine psb_z_cuda_hybg_to_gpu #endif diff --git a/cuda/impl/psb_z_cuda_hybg_vect_mv.F90 b/cuda/impl/psb_z_cuda_hybg_vect_mv.F90 index 22751f2d..0cb1db22 100644 --- a/cuda/impl/psb_z_cuda_hybg_vect_mv.F90 +++ b/cuda/impl/psb_z_cuda_hybg_vect_mv.F90 @@ -33,14 +33,10 @@ subroutine psb_z_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use elldev_mod use psb_vectordev_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_hybg_vect_mv -#else - use psb_z_cuda_hybg_mat_mod -#endif use psb_z_cuda_vect_mod implicit none class(psb_z_cuda_hybg_sparse_mat), intent(in) :: a @@ -71,8 +67,6 @@ subroutine psb_z_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) tra = (psb_toupper(trans_) == 'T').or.(psb_toupper(trans_)=='C') - -#ifdef HAVE_SPGPU if (tra) then if (.not.x%is_host()) call x%sync() if (beta /= zzero) then @@ -112,9 +106,6 @@ subroutine psb_z_cuda_hybg_vect_mv(alpha,a,x,beta,y,info,trans) call y%bld(ry) end select end if -#else - call a%psb_z_csr_sparse_mat%spmm(alpha,x,beta,y,info,trans) -#endif if (info /= 0) goto 9999 call psb_erractionrestore(err_act) return diff --git a/cuda/impl/psb_z_cuda_mv_csrg_from_coo.F90 b/cuda/impl/psb_z_cuda_mv_csrg_from_coo.F90 index d5390ee3..7cfd4f19 100644 --- a/cuda/impl/psb_z_cuda_mv_csrg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_mv_csrg_from_coo.F90 @@ -29,16 +29,11 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_mv_csrg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_mv_csrg_from_coo -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none class(psb_z_cuda_csrg_sparse_mat), intent(inout) :: a @@ -51,9 +46,7 @@ subroutine psb_z_cuda_mv_csrg_from_coo(a,b,info) call a%psb_z_csr_sparse_mat%mv_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif if (info /= 0) goto 9999 return diff --git a/cuda/impl/psb_z_cuda_mv_csrg_from_fmt.F90 b/cuda/impl/psb_z_cuda_mv_csrg_from_fmt.F90 index e2bfdb73..f03294c8 100644 --- a/cuda/impl/psb_z_cuda_mv_csrg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_mv_csrg_from_fmt.F90 @@ -29,16 +29,11 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_mv_csrg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_csrg_mat_mod, psb_protect_name => psb_z_cuda_mv_csrg_from_fmt -#else - use psb_z_cuda_csrg_mat_mod -#endif implicit none class(psb_z_cuda_csrg_sparse_mat), intent(inout) :: a @@ -55,9 +50,7 @@ subroutine psb_z_cuda_mv_csrg_from_fmt(a,b,info) class default call a%psb_z_csr_sparse_mat%mv_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_z_cuda_mv_csrg_from_fmt diff --git a/cuda/impl/psb_z_cuda_mv_diag_from_coo.F90 b/cuda/impl/psb_z_cuda_mv_diag_from_coo.F90 index b61813bf..8e702e7e 100644 --- a/cuda/impl/psb_z_cuda_mv_diag_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_mv_diag_from_coo.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_mv_diag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use diagdev_mod use psb_vectordev_mod use psb_z_cuda_diag_mat_mod, psb_protect_name => psb_z_cuda_mv_diag_from_coo -#else - use psb_z_cuda_diag_mat_mod -#endif implicit none diff --git a/cuda/impl/psb_z_cuda_mv_elg_from_coo.F90 b/cuda/impl/psb_z_cuda_mv_elg_from_coo.F90 index e3ff4036..f0cb23f3 100644 --- a/cuda/impl/psb_z_cuda_mv_elg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_mv_elg_from_coo.F90 @@ -29,17 +29,12 @@ ! POSSIBILITY OF SUCH DAMAGE. ! - subroutine psb_z_cuda_mv_elg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_mv_elg_from_coo -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a @@ -57,5 +52,4 @@ subroutine psb_z_cuda_mv_elg_from_coo(a,b,info) return - end subroutine psb_z_cuda_mv_elg_from_coo diff --git a/cuda/impl/psb_z_cuda_mv_elg_from_fmt.F90 b/cuda/impl/psb_z_cuda_mv_elg_from_fmt.F90 index 07a80173..29f63423 100644 --- a/cuda/impl/psb_z_cuda_mv_elg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_mv_elg_from_fmt.F90 @@ -28,18 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - + subroutine psb_z_cuda_mv_elg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use elldev_mod use psb_vectordev_mod use psb_z_cuda_elg_mat_mod, psb_protect_name => psb_z_cuda_mv_elg_from_fmt -#else - use psb_z_cuda_elg_mat_mod -#endif implicit none class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a @@ -49,9 +44,7 @@ subroutine psb_z_cuda_mv_elg_from_fmt(a,b,info) !locals type(psb_z_coo_sparse_mat) :: tmp Integer(Psb_ipk_) :: nza, nr, i,j,irw, idl,err_act, nc, ld, nzm, m -#ifdef HAVE_SPGPU type(elldev_parms) :: gpu_parms -#endif info = psb_success_ @@ -65,13 +58,9 @@ subroutine psb_z_cuda_mv_elg_from_fmt(a,b,info) m = b%get_nrows() nc = b%get_ncols() nza = b%get_nzeros() -#ifdef HAVE_SPGPU gpu_parms = FgetEllDeviceParams(m,nzm,nza,nc,spgpu_type_double,1) ld = gpu_parms%pitch nzm = gpu_parms%maxRowSize -#else - ld = m -#endif a%psb_z_base_sparse_mat = b%psb_z_base_sparse_mat call move_alloc(b%irn, a%irn) call move_alloc(b%idiag, a%idiag) @@ -87,9 +76,7 @@ subroutine psb_z_cuda_mv_elg_from_fmt(a,b,info) end if a%nzt = nza call b%free() -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif class default call b%mv_to_coo(tmp,info) diff --git a/cuda/impl/psb_z_cuda_mv_hdiag_from_coo.F90 b/cuda/impl/psb_z_cuda_mv_hdiag_from_coo.F90 index f25e6370..dd6dae1e 100644 --- a/cuda/impl/psb_z_cuda_mv_hdiag_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_mv_hdiag_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_z_cuda_mv_hdiag_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hdiagdev_mod use psb_vectordev_mod use psb_z_cuda_hdiag_mat_mod, psb_protect_name => psb_z_cuda_mv_hdiag_from_coo use psb_cuda_env_mod -#else - use psb_z_cuda_hdiag_mat_mod -#endif implicit none @@ -54,16 +48,12 @@ subroutine psb_z_cuda_mv_hdiag_from_coo(a,b,info) info = psb_success_ -#ifdef HAVE_SPGPU a%hacksize = psb_cuda_WarpSize() -#endif call a%psb_z_hdia_sparse_mat%mv_from_coo(b,info) -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_z_cuda_mv_hlg_from_coo.F90 b/cuda/impl/psb_z_cuda_mv_hlg_from_coo.F90 index 3bc630de..609680b9 100644 --- a/cuda/impl/psb_z_cuda_mv_hlg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_mv_hlg_from_coo.F90 @@ -28,19 +28,13 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_z_cuda_mv_hlg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_cuda_env_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_mv_hlg_from_coo -#else - use psb_z_cuda_hlg_mat_mod -#endif implicit none class(psb_z_cuda_hlg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_z_cuda_mv_hlg_from_fmt.F90 b/cuda/impl/psb_z_cuda_mv_hlg_from_fmt.F90 index d746a341..e67c8d83 100644 --- a/cuda/impl/psb_z_cuda_mv_hlg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_mv_hlg_from_fmt.F90 @@ -28,18 +28,12 @@ ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! POSSIBILITY OF SUCH DAMAGE. ! - - subroutine psb_z_cuda_mv_hlg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use hlldev_mod use psb_vectordev_mod use psb_z_cuda_hlg_mat_mod, psb_protect_name => psb_z_cuda_mv_hlg_from_fmt -#else - use psb_z_cuda_hlg_mat_mod -#endif implicit none class(psb_z_cuda_hlg_sparse_mat), intent(inout) :: a diff --git a/cuda/impl/psb_z_cuda_mv_hybg_from_coo.F90 b/cuda/impl/psb_z_cuda_mv_hybg_from_coo.F90 index 7d0d9eec..69fda3d6 100644 --- a/cuda/impl/psb_z_cuda_mv_hybg_from_coo.F90 +++ b/cuda/impl/psb_z_cuda_mv_hybg_from_coo.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_mv_hybg_from_coo(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_mv_hybg_from_coo -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none class(psb_z_cuda_hybg_sparse_mat), intent(inout) :: a @@ -50,10 +46,8 @@ subroutine psb_z_cuda_mv_hybg_from_coo(a,b,info) call a%psb_z_csr_sparse_mat%mv_from_coo(b,info) if (info /= 0) goto 9999 -#ifdef HAVE_SPGPU call a%to_gpu(info) if (info /= 0) goto 9999 -#endif return diff --git a/cuda/impl/psb_z_cuda_mv_hybg_from_fmt.F90 b/cuda/impl/psb_z_cuda_mv_hybg_from_fmt.F90 index 7bfc27e3..55c33a09 100644 --- a/cuda/impl/psb_z_cuda_mv_hybg_from_fmt.F90 +++ b/cuda/impl/psb_z_cuda_mv_hybg_from_fmt.F90 @@ -33,12 +33,8 @@ subroutine psb_z_cuda_mv_hybg_from_fmt(a,b,info) use psb_base_mod -#ifdef HAVE_SPGPU use cusparse_mod use psb_z_cuda_hybg_mat_mod, psb_protect_name => psb_z_cuda_mv_hybg_from_fmt -#else - use psb_z_cuda_hybg_mat_mod -#endif implicit none class(psb_z_cuda_hybg_sparse_mat), intent(inout) :: a @@ -54,9 +50,7 @@ subroutine psb_z_cuda_mv_hybg_from_fmt(a,b,info) class default call a%psb_z_csr_sparse_mat%mv_from_fmt(b,info) if (info /= 0) return -#ifdef HAVE_SPGPU call a%to_gpu(info) -#endif end select end subroutine psb_z_cuda_mv_hybg_from_fmt #endif diff --git a/cuda/ivectordev.c b/cuda/ivectordev.c index 71d5c472..241f1115 100644 --- a/cuda/ivectordev.c +++ b/cuda/ivectordev.c @@ -32,7 +32,6 @@ #include #include -#if defined(HAVE_SPGPU) //#include "utils.h" //#include "common.h" #include "ivectordev.h" @@ -177,6 +176,3 @@ int iscatMultiVecDeviceInt(void* deviceVec, int vectorId, int n, int first, void return SPGPU_SUCCESS; } - -#endif - diff --git a/cuda/ivectordev.h b/cuda/ivectordev.h index 5f7ca974..2db54be4 100644 --- a/cuda/ivectordev.h +++ b/cuda/ivectordev.h @@ -31,7 +31,6 @@ #pragma once -#if defined(HAVE_SPGPU) //#include "utils.h" #include "vectordev.h" #include "cuda_runtime.h" @@ -60,5 +59,3 @@ int iscatMultiVecDeviceIntVecIdx(void* deviceVec, int vectorId, int n, int first int indexBase, int beta); int iscatMultiVecDeviceInt(void* deviceVec, int vectorId, int n, int first, void *indexes, int hfirst, void* host_values, int indexBase, int beta); - -#endif diff --git a/cuda/psb_base_vectordev_mod.F90 b/cuda/psb_base_vectordev_mod.F90 index f8c303d0..da02b2f3 100644 --- a/cuda/psb_base_vectordev_mod.F90 +++ b/cuda/psb_base_vectordev_mod.F90 @@ -40,9 +40,6 @@ module psb_base_vectordev_mod integer(c_int) :: pitch integer(c_int) :: size end type multivec_dev_parms - -#ifdef HAVE_SPGPU - interface function FallocMultiVecDevice(deviceVec,count,Size,elementType) & @@ -54,7 +51,6 @@ module psb_base_vectordev_mod end function FallocMultiVecDevice end interface - interface subroutine unregisterMapped(buf) & & bind(c,name='unregisterMapped') @@ -98,7 +94,4 @@ module psb_base_vectordev_mod end function getMultiVecDevicePitch end interface -#endif - - end module psb_base_vectordev_mod diff --git a/cuda/psb_c_cuda_csrg_mat_mod.F90 b/cuda/psb_c_cuda_csrg_mat_mod.F90 index a98d7e99..1fdeec4a 100644 --- a/cuda/psb_c_cuda_csrg_mat_mod.F90 +++ b/cuda/psb_c_cuda_csrg_mat_mod.F90 @@ -48,7 +48,6 @@ module psb_c_cuda_csrg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(c_Cmat) :: deviceMat integer(psb_ipk_) :: devstate = is_host @@ -81,13 +80,8 @@ module psb_c_cuda_csrg_mat_mod procedure, pass(a) :: to_gpu => psb_c_cuda_csrg_to_gpu procedure, pass(a) :: from_gpu => psb_c_cuda_csrg_from_gpu final :: c_cuda_csrg_finalize -#else - contains - procedure, pass(a) :: mold => psb_c_cuda_csrg_mold -#endif end type psb_c_cuda_csrg_sparse_mat -#ifdef HAVE_SPGPU private :: c_cuda_csrg_get_nzeros, c_cuda_csrg_free, c_cuda_csrg_get_fmt, & & c_cuda_csrg_get_size, c_cuda_csrg_sizeof, c_cuda_csrg_get_nz_row @@ -378,16 +372,4 @@ contains end subroutine c_cuda_csrg_finalize -#else - interface - subroutine psb_c_cuda_csrg_mold(a,b,info) - import :: psb_c_cuda_csrg_sparse_mat, psb_c_base_sparse_mat, psb_ipk_ - class(psb_c_cuda_csrg_sparse_mat), intent(in) :: a - class(psb_c_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_c_cuda_csrg_mold - end interface - -#endif - end module psb_c_cuda_csrg_mat_mod diff --git a/cuda/psb_c_cuda_diag_mat_mod.F90 b/cuda/psb_c_cuda_diag_mat_mod.F90 index 1d5db05b..93ffe498 100644 --- a/cuda/psb_c_cuda_diag_mat_mod.F90 +++ b/cuda/psb_c_cuda_diag_mat_mod.F90 @@ -44,7 +44,6 @@ module psb_c_cuda_diag_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -68,13 +67,8 @@ module psb_c_cuda_diag_mat_mod procedure, pass(a) :: mold => psb_c_cuda_diag_mold procedure, pass(a) :: to_gpu => psb_c_cuda_diag_to_gpu final :: c_cuda_diag_finalize -#else - contains - procedure, pass(a) :: mold => psb_c_cuda_diag_mold -#endif end type psb_c_cuda_diag_sparse_mat -#ifdef HAVE_SPGPU private :: c_cuda_diag_get_nzeros, c_cuda_diag_free, c_cuda_diag_get_fmt, & & c_cuda_diag_get_size, c_cuda_diag_sizeof, c_cuda_diag_get_nz_row @@ -292,17 +286,4 @@ contains return end subroutine c_cuda_diag_finalize -#else - - interface - subroutine psb_c_cuda_diag_mold(a,b,info) - import :: psb_c_cuda_diag_sparse_mat, psb_c_base_sparse_mat, psb_ipk_ - class(psb_c_cuda_diag_sparse_mat), intent(in) :: a - class(psb_c_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_c_cuda_diag_mold - end interface - -#endif - end module psb_c_cuda_diag_mat_mod diff --git a/cuda/psb_c_cuda_dnsg_mat_mod.F90 b/cuda/psb_c_cuda_dnsg_mat_mod.F90 index e89e117b..b0ca8c46 100644 --- a/cuda/psb_c_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_c_cuda_dnsg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_c_cuda_dnsg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of DNS, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -69,13 +68,8 @@ module psb_c_cuda_dnsg_mat_mod procedure, pass(a) :: mold => psb_c_cuda_dnsg_mold procedure, pass(a) :: to_gpu => psb_c_cuda_dnsg_to_gpu final :: c_cuda_dnsg_finalize -#else - contains - procedure, pass(a) :: mold => psb_c_cuda_dnsg_mold -#endif end type psb_c_cuda_dnsg_sparse_mat -#ifdef HAVE_SPGPU private :: c_cuda_dnsg_get_nzeros, c_cuda_dnsg_free, c_cuda_dnsg_get_fmt, & & c_cuda_dnsg_get_size, c_cuda_dnsg_get_nz_row @@ -278,17 +272,4 @@ contains return end subroutine c_cuda_dnsg_finalize -#else - - interface - subroutine psb_c_cuda_dnsg_mold(a,b,info) - import :: psb_c_cuda_dnsg_sparse_mat, psb_c_base_sparse_mat, psb_ipk_ - class(psb_c_cuda_dnsg_sparse_mat), intent(in) :: a - class(psb_c_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_c_cuda_dnsg_mold - end interface - -#endif - end module psb_c_cuda_dnsg_mat_mod diff --git a/cuda/psb_c_cuda_elg_mat_mod.F90 b/cuda/psb_c_cuda_elg_mat_mod.F90 index 43250ce3..c9b48005 100644 --- a/cuda/psb_c_cuda_elg_mat_mod.F90 +++ b/cuda/psb_c_cuda_elg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_c_cuda_elg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of ELL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host @@ -86,14 +85,8 @@ module psb_c_cuda_elg_mat_mod procedure, pass(a) :: to_gpu => psb_c_cuda_elg_to_gpu procedure, pass(a) :: asb => psb_c_cuda_elg_asb final :: c_cuda_elg_finalize -#else - contains - procedure, pass(a) :: mold => psb_c_cuda_elg_mold - procedure, pass(a) :: asb => psb_c_cuda_elg_asb -#endif end type psb_c_cuda_elg_sparse_mat -#ifdef HAVE_SPGPU private :: c_cuda_elg_get_nzeros, c_cuda_elg_free, c_cuda_elg_get_fmt, & & c_cuda_elg_get_size, c_cuda_elg_sizeof, c_cuda_elg_get_nz_row, c_cuda_elg_sync @@ -460,24 +453,4 @@ contains end subroutine c_cuda_elg_finalize -#else - - interface - subroutine psb_c_cuda_elg_asb(a) - import :: psb_c_cuda_elg_sparse_mat - class(psb_c_cuda_elg_sparse_mat), intent(inout) :: a - end subroutine psb_c_cuda_elg_asb - end interface - - interface - subroutine psb_c_cuda_elg_mold(a,b,info) - import :: psb_c_cuda_elg_sparse_mat, psb_c_base_sparse_mat, psb_ipk_ - class(psb_c_cuda_elg_sparse_mat), intent(in) :: a - class(psb_c_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_c_cuda_elg_mold - end interface - -#endif - end module psb_c_cuda_elg_mat_mod diff --git a/cuda/psb_c_cuda_hdiag_mat_mod.F90 b/cuda/psb_c_cuda_hdiag_mat_mod.F90 index 54f47684..f06e501e 100644 --- a/cuda/psb_c_cuda_hdiag_mat_mod.F90 +++ b/cuda/psb_c_cuda_hdiag_mat_mod.F90 @@ -38,7 +38,6 @@ module psb_c_cuda_hdiag_mat_mod type, extends(psb_c_hdia_sparse_mat) :: psb_c_cuda_hdiag_sparse_mat ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -62,13 +61,8 @@ module psb_c_cuda_hdiag_mat_mod procedure, pass(a) :: mold => psb_c_cuda_hdiag_mold procedure, pass(a) :: to_gpu => psb_c_cuda_hdiag_to_gpu final :: c_cuda_hdiag_finalize -#else - contains - procedure, pass(a) :: mold => psb_c_cuda_hdiag_mold -#endif end type psb_c_cuda_hdiag_sparse_mat -#ifdef HAVE_SPGPU private :: c_cuda_hdiag_get_nzeros, c_cuda_hdiag_free, c_cuda_hdiag_get_fmt, & & c_cuda_hdiag_get_size, c_cuda_hdiag_sizeof, c_cuda_hdiag_get_nz_row @@ -271,17 +265,4 @@ contains return end subroutine c_cuda_hdiag_finalize -#else - - interface - subroutine psb_c_cuda_hdiag_mold(a,b,info) - import :: psb_c_cuda_hdiag_sparse_mat, psb_c_base_sparse_mat, psb_ipk_ - class(psb_c_cuda_hdiag_sparse_mat), intent(in) :: a - class(psb_c_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_c_cuda_hdiag_mold - end interface - -#endif - end module psb_c_cuda_hdiag_mat_mod diff --git a/cuda/psb_c_cuda_hlg_mat_mod.F90 b/cuda/psb_c_cuda_hlg_mat_mod.F90 index 74284f30..e98f2474 100644 --- a/cuda/psb_c_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_c_cuda_hlg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_c_cuda_hlg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host @@ -82,13 +81,8 @@ module psb_c_cuda_hlg_mat_mod procedure, pass(a) :: from_gpu => psb_c_cuda_hlg_from_gpu procedure, pass(a) :: to_gpu => psb_c_cuda_hlg_to_gpu final :: c_cuda_hlg_finalize -#else - contains - procedure, pass(a) :: mold => psb_c_cuda_hlg_mold -#endif end type psb_c_cuda_hlg_sparse_mat -#ifdef HAVE_SPGPU private :: c_cuda_hlg_get_nzeros, c_cuda_hlg_free, c_cuda_hlg_get_fmt, & & c_cuda_hlg_get_size, c_cuda_hlg_sizeof, c_cuda_hlg_get_nz_row @@ -382,17 +376,4 @@ contains return end subroutine c_cuda_hlg_finalize -#else - - interface - subroutine psb_c_cuda_hlg_mold(a,b,info) - import :: psb_c_cuda_hlg_sparse_mat, psb_c_base_sparse_mat, psb_ipk_ - class(psb_c_cuda_hlg_sparse_mat), intent(in) :: a - class(psb_c_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_c_cuda_hlg_mold - end interface - -#endif - end module psb_c_cuda_hlg_mat_mod diff --git a/cuda/psb_c_cuda_hybg_mat_mod.F90 b/cuda/psb_c_cuda_hybg_mat_mod.F90 index d16988ba..1c94bc0f 100644 --- a/cuda/psb_c_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_c_cuda_hybg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_c_cuda_hybg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(c_Hmat) :: deviceMat contains @@ -69,13 +68,8 @@ module psb_c_cuda_hybg_mat_mod procedure, pass(a) :: mold => psb_c_cuda_hybg_mold procedure, pass(a) :: to_gpu => psb_c_cuda_hybg_to_gpu final :: c_cuda_hybg_finalize -#else - contains - procedure, pass(a) :: mold => psb_c_cuda_hybg_mold -#endif end type psb_c_cuda_hybg_sparse_mat -#ifdef HAVE_SPGPU private :: c_cuda_hybg_get_nzeros, c_cuda_hybg_free, c_cuda_hybg_get_fmt, & & c_cuda_hybg_get_size, c_cuda_hybg_sizeof, c_cuda_hybg_get_nz_row @@ -289,18 +283,5 @@ contains return end subroutine c_cuda_hybg_finalize -#else - - interface - subroutine psb_c_cuda_hybg_mold(a,b,info) - import :: psb_c_cuda_hybg_sparse_mat, psb_c_base_sparse_mat, psb_ipk_ - class(psb_c_cuda_hybg_sparse_mat), intent(in) :: a - class(psb_c_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_c_cuda_hybg_mold - end interface - -#endif - end module psb_c_cuda_hybg_mat_mod #endif diff --git a/cuda/psb_c_cuda_vect_mod.F90 b/cuda/psb_c_cuda_vect_mod.F90 index be06167e..c140dadb 100644 --- a/cuda/psb_c_cuda_vect_mod.F90 +++ b/cuda/psb_c_cuda_vect_mod.F90 @@ -35,20 +35,17 @@ module psb_c_cuda_vect_mod use psb_const_mod use psb_error_mod use psb_c_vect_mod - use psb_i_vect_mod -#ifdef HAVE_SPGPU use psb_cuda_env_mod + use psb_i_vect_mod use psb_i_cuda_vect_mod use psb_i_vectordev_mod use psb_c_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_c_base_vect_type) :: psb_c_vect_cuda -#ifdef HAVE_SPGPU integer :: state = is_host type(c_ptr) :: deviceVect = c_null_ptr complex(c_float_complex), allocatable :: pinned_buffer(:) @@ -105,7 +102,6 @@ module psb_c_cuda_vect_mod procedure, pass(x) :: absval2 => c_cuda_absval2 final :: c_cuda_vect_finalize -#endif end type psb_c_vect_cuda public :: psb_c_vect_cuda_ @@ -126,8 +122,6 @@ contains end function constructor -#ifdef HAVE_SPGPU - subroutine c_cuda_device_wait() call psb_cudaSync() end subroutine c_cuda_device_wait @@ -1204,8 +1198,6 @@ contains end subroutine c_cuda_ins_a -#endif - end module psb_c_cuda_vect_mod @@ -1221,20 +1213,16 @@ module psb_c_cuda_multivect_mod use psb_error_mod use psb_c_multivect_mod use psb_c_base_multivect_mod - + use psb_cuda_env_mod use psb_i_multivect_mod -#ifdef HAVE_SPGPU use psb_i_cuda_multivect_mod use psb_c_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_c_base_multivect_type) :: psb_c_multivect_cuda -#ifdef HAVE_SPGPU - integer(psb_ipk_) :: state = is_host, m_nrows=0, m_ncols=0 type(c_ptr) :: deviceVect = c_null_ptr real(c_double), allocatable :: buffer(:,:) @@ -1276,7 +1264,6 @@ module psb_c_cuda_multivect_mod !!$ procedure, pass(y) :: sctb => c_cuda_multi_sctb !!$ procedure, pass(y) :: sctb_x => c_cuda_multi_sctb_x final :: c_cuda_multi_vect_finalize -#endif end type psb_c_multivect_cuda public :: psb_c_multivect_cuda @@ -1297,7 +1284,6 @@ contains end function constructor -#ifdef HAVE_SPGPU !!$ subroutine c_cuda_multi_gthzv_x(i,n,idx,x,y) !!$ use psi_serial_mod @@ -1981,8 +1967,6 @@ contains end subroutine c_cuda_multi_ins -#endif - end module psb_c_cuda_multivect_mod diff --git a/cuda/psb_c_vectordev_mod.F90 b/cuda/psb_c_vectordev_mod.F90 index f3c243a6..b15b2371 100644 --- a/cuda/psb_c_vectordev_mod.F90 +++ b/cuda/psb_c_vectordev_mod.F90 @@ -34,8 +34,6 @@ module psb_c_vectordev_mod use psb_base_vectordev_mod -#ifdef HAVE_SPGPU - interface registerMapped function registerMappedFloatComplex(buf,d_p,n,dummy) & & result(res) bind(c,name='registerMappedFloatComplex') @@ -385,6 +383,4 @@ contains call unregisterMapped(c_loc(buffer)) end subroutine inner_unregisterFloatComplex -#endif - end module psb_c_vectordev_mod diff --git a/cuda/psb_cuda_env_mod.F90 b/cuda/psb_cuda_env_mod.F90 index 0d1d4ced..4778d229 100644 --- a/cuda/psb_cuda_env_mod.F90 +++ b/cuda/psb_cuda_env_mod.F90 @@ -37,7 +37,6 @@ module psb_cuda_env_mod ! interface psb_cuda_init ! module procedure psb_cuda_init ! end interface -#if defined(HAVE_CUDA) use core_mod interface @@ -126,7 +125,6 @@ module psb_cuda_env_mod use iso_c_binding end subroutine psb_cuda_innerClose end interface -#endif interface function psb_C_DeviceHasUVA() & @@ -209,7 +207,6 @@ Contains info = psb_success_ call psb_erractionsave(err_act) -#if defined (HAVE_CUDA) #if defined(SERIAL_MPI) iam = 0 #else @@ -234,7 +231,6 @@ Contains goto 9999 end if call psb_cudaCreateHandle() -#endif call psb_erractionrestore(err_act) return 9999 call psb_error_handler(ctxt,err_act) @@ -245,18 +241,12 @@ Contains subroutine psb_cuda_DeviceSync() -#if defined(HAVE_CUDA) call psb_cudaSync() -#endif end subroutine psb_cuda_DeviceSync function psb_cuda_getDeviceCount() result(res) integer :: res -#if defined(HAVE_CUDA) res = psb_cuda_inner_getDeviceCount() -#else - res = 0 -#endif end function psb_cuda_getDeviceCount subroutine psb_cuda_exit() diff --git a/cuda/psb_d_cuda_csrg_mat_mod.F90 b/cuda/psb_d_cuda_csrg_mat_mod.F90 index 465c16a7..101959bd 100644 --- a/cuda/psb_d_cuda_csrg_mat_mod.F90 +++ b/cuda/psb_d_cuda_csrg_mat_mod.F90 @@ -48,7 +48,6 @@ module psb_d_cuda_csrg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(d_Cmat) :: deviceMat integer(psb_ipk_) :: devstate = is_host @@ -81,13 +80,8 @@ module psb_d_cuda_csrg_mat_mod procedure, pass(a) :: to_gpu => psb_d_cuda_csrg_to_gpu procedure, pass(a) :: from_gpu => psb_d_cuda_csrg_from_gpu final :: d_cuda_csrg_finalize -#else - contains - procedure, pass(a) :: mold => psb_d_cuda_csrg_mold -#endif end type psb_d_cuda_csrg_sparse_mat -#ifdef HAVE_SPGPU private :: d_cuda_csrg_get_nzeros, d_cuda_csrg_free, d_cuda_csrg_get_fmt, & & d_cuda_csrg_get_size, d_cuda_csrg_sizeof, d_cuda_csrg_get_nz_row @@ -378,16 +372,4 @@ contains end subroutine d_cuda_csrg_finalize -#else - interface - subroutine psb_d_cuda_csrg_mold(a,b,info) - import :: psb_d_cuda_csrg_sparse_mat, psb_d_base_sparse_mat, psb_ipk_ - class(psb_d_cuda_csrg_sparse_mat), intent(in) :: a - class(psb_d_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cuda_csrg_mold - end interface - -#endif - end module psb_d_cuda_csrg_mat_mod diff --git a/cuda/psb_d_cuda_diag_mat_mod.F90 b/cuda/psb_d_cuda_diag_mat_mod.F90 index 1d55faa0..11e4e349 100644 --- a/cuda/psb_d_cuda_diag_mat_mod.F90 +++ b/cuda/psb_d_cuda_diag_mat_mod.F90 @@ -44,7 +44,6 @@ module psb_d_cuda_diag_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -68,13 +67,8 @@ module psb_d_cuda_diag_mat_mod procedure, pass(a) :: mold => psb_d_cuda_diag_mold procedure, pass(a) :: to_gpu => psb_d_cuda_diag_to_gpu final :: d_cuda_diag_finalize -#else - contains - procedure, pass(a) :: mold => psb_d_cuda_diag_mold -#endif end type psb_d_cuda_diag_sparse_mat -#ifdef HAVE_SPGPU private :: d_cuda_diag_get_nzeros, d_cuda_diag_free, d_cuda_diag_get_fmt, & & d_cuda_diag_get_size, d_cuda_diag_sizeof, d_cuda_diag_get_nz_row @@ -292,17 +286,4 @@ contains return end subroutine d_cuda_diag_finalize -#else - - interface - subroutine psb_d_cuda_diag_mold(a,b,info) - import :: psb_d_cuda_diag_sparse_mat, psb_d_base_sparse_mat, psb_ipk_ - class(psb_d_cuda_diag_sparse_mat), intent(in) :: a - class(psb_d_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cuda_diag_mold - end interface - -#endif - end module psb_d_cuda_diag_mat_mod diff --git a/cuda/psb_d_cuda_dnsg_mat_mod.F90 b/cuda/psb_d_cuda_dnsg_mat_mod.F90 index bb24eb1a..f11e7823 100644 --- a/cuda/psb_d_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_d_cuda_dnsg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_d_cuda_dnsg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of DNS, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -69,13 +68,8 @@ module psb_d_cuda_dnsg_mat_mod procedure, pass(a) :: mold => psb_d_cuda_dnsg_mold procedure, pass(a) :: to_gpu => psb_d_cuda_dnsg_to_gpu final :: d_cuda_dnsg_finalize -#else - contains - procedure, pass(a) :: mold => psb_d_cuda_dnsg_mold -#endif end type psb_d_cuda_dnsg_sparse_mat -#ifdef HAVE_SPGPU private :: d_cuda_dnsg_get_nzeros, d_cuda_dnsg_free, d_cuda_dnsg_get_fmt, & & d_cuda_dnsg_get_size, d_cuda_dnsg_get_nz_row @@ -278,17 +272,4 @@ contains return end subroutine d_cuda_dnsg_finalize -#else - - interface - subroutine psb_d_cuda_dnsg_mold(a,b,info) - import :: psb_d_cuda_dnsg_sparse_mat, psb_d_base_sparse_mat, psb_ipk_ - class(psb_d_cuda_dnsg_sparse_mat), intent(in) :: a - class(psb_d_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cuda_dnsg_mold - end interface - -#endif - end module psb_d_cuda_dnsg_mat_mod diff --git a/cuda/psb_d_cuda_elg_mat_mod.F90 b/cuda/psb_d_cuda_elg_mat_mod.F90 index 1ac47664..1af80f2a 100644 --- a/cuda/psb_d_cuda_elg_mat_mod.F90 +++ b/cuda/psb_d_cuda_elg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_d_cuda_elg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of ELL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host @@ -86,14 +85,8 @@ module psb_d_cuda_elg_mat_mod procedure, pass(a) :: to_gpu => psb_d_cuda_elg_to_gpu procedure, pass(a) :: asb => psb_d_cuda_elg_asb final :: d_cuda_elg_finalize -#else - contains - procedure, pass(a) :: mold => psb_d_cuda_elg_mold - procedure, pass(a) :: asb => psb_d_cuda_elg_asb -#endif end type psb_d_cuda_elg_sparse_mat -#ifdef HAVE_SPGPU private :: d_cuda_elg_get_nzeros, d_cuda_elg_free, d_cuda_elg_get_fmt, & & d_cuda_elg_get_size, d_cuda_elg_sizeof, d_cuda_elg_get_nz_row, d_cuda_elg_sync @@ -460,24 +453,4 @@ contains end subroutine d_cuda_elg_finalize -#else - - interface - subroutine psb_d_cuda_elg_asb(a) - import :: psb_d_cuda_elg_sparse_mat - class(psb_d_cuda_elg_sparse_mat), intent(inout) :: a - end subroutine psb_d_cuda_elg_asb - end interface - - interface - subroutine psb_d_cuda_elg_mold(a,b,info) - import :: psb_d_cuda_elg_sparse_mat, psb_d_base_sparse_mat, psb_ipk_ - class(psb_d_cuda_elg_sparse_mat), intent(in) :: a - class(psb_d_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cuda_elg_mold - end interface - -#endif - end module psb_d_cuda_elg_mat_mod diff --git a/cuda/psb_d_cuda_hdiag_mat_mod.F90 b/cuda/psb_d_cuda_hdiag_mat_mod.F90 index 17bacffe..46b63b43 100644 --- a/cuda/psb_d_cuda_hdiag_mat_mod.F90 +++ b/cuda/psb_d_cuda_hdiag_mat_mod.F90 @@ -38,7 +38,6 @@ module psb_d_cuda_hdiag_mat_mod type, extends(psb_d_hdia_sparse_mat) :: psb_d_cuda_hdiag_sparse_mat ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -62,13 +61,8 @@ module psb_d_cuda_hdiag_mat_mod procedure, pass(a) :: mold => psb_d_cuda_hdiag_mold procedure, pass(a) :: to_gpu => psb_d_cuda_hdiag_to_gpu final :: d_cuda_hdiag_finalize -#else - contains - procedure, pass(a) :: mold => psb_d_cuda_hdiag_mold -#endif end type psb_d_cuda_hdiag_sparse_mat -#ifdef HAVE_SPGPU private :: d_cuda_hdiag_get_nzeros, d_cuda_hdiag_free, d_cuda_hdiag_get_fmt, & & d_cuda_hdiag_get_size, d_cuda_hdiag_sizeof, d_cuda_hdiag_get_nz_row @@ -271,17 +265,4 @@ contains return end subroutine d_cuda_hdiag_finalize -#else - - interface - subroutine psb_d_cuda_hdiag_mold(a,b,info) - import :: psb_d_cuda_hdiag_sparse_mat, psb_d_base_sparse_mat, psb_ipk_ - class(psb_d_cuda_hdiag_sparse_mat), intent(in) :: a - class(psb_d_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cuda_hdiag_mold - end interface - -#endif - end module psb_d_cuda_hdiag_mat_mod diff --git a/cuda/psb_d_cuda_hlg_mat_mod.F90 b/cuda/psb_d_cuda_hlg_mat_mod.F90 index 19ecb62b..6627f824 100644 --- a/cuda/psb_d_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_d_cuda_hlg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_d_cuda_hlg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host @@ -82,13 +81,8 @@ module psb_d_cuda_hlg_mat_mod procedure, pass(a) :: from_gpu => psb_d_cuda_hlg_from_gpu procedure, pass(a) :: to_gpu => psb_d_cuda_hlg_to_gpu final :: d_cuda_hlg_finalize -#else - contains - procedure, pass(a) :: mold => psb_d_cuda_hlg_mold -#endif end type psb_d_cuda_hlg_sparse_mat -#ifdef HAVE_SPGPU private :: d_cuda_hlg_get_nzeros, d_cuda_hlg_free, d_cuda_hlg_get_fmt, & & d_cuda_hlg_get_size, d_cuda_hlg_sizeof, d_cuda_hlg_get_nz_row @@ -382,17 +376,4 @@ contains return end subroutine d_cuda_hlg_finalize -#else - - interface - subroutine psb_d_cuda_hlg_mold(a,b,info) - import :: psb_d_cuda_hlg_sparse_mat, psb_d_base_sparse_mat, psb_ipk_ - class(psb_d_cuda_hlg_sparse_mat), intent(in) :: a - class(psb_d_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cuda_hlg_mold - end interface - -#endif - end module psb_d_cuda_hlg_mat_mod diff --git a/cuda/psb_d_cuda_hybg_mat_mod.F90 b/cuda/psb_d_cuda_hybg_mat_mod.F90 index be4c8392..065c0db3 100644 --- a/cuda/psb_d_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_d_cuda_hybg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_d_cuda_hybg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(d_Hmat) :: deviceMat contains @@ -69,13 +68,8 @@ module psb_d_cuda_hybg_mat_mod procedure, pass(a) :: mold => psb_d_cuda_hybg_mold procedure, pass(a) :: to_gpu => psb_d_cuda_hybg_to_gpu final :: d_cuda_hybg_finalize -#else - contains - procedure, pass(a) :: mold => psb_d_cuda_hybg_mold -#endif end type psb_d_cuda_hybg_sparse_mat -#ifdef HAVE_SPGPU private :: d_cuda_hybg_get_nzeros, d_cuda_hybg_free, d_cuda_hybg_get_fmt, & & d_cuda_hybg_get_size, d_cuda_hybg_sizeof, d_cuda_hybg_get_nz_row @@ -289,18 +283,5 @@ contains return end subroutine d_cuda_hybg_finalize -#else - - interface - subroutine psb_d_cuda_hybg_mold(a,b,info) - import :: psb_d_cuda_hybg_sparse_mat, psb_d_base_sparse_mat, psb_ipk_ - class(psb_d_cuda_hybg_sparse_mat), intent(in) :: a - class(psb_d_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cuda_hybg_mold - end interface - -#endif - end module psb_d_cuda_hybg_mat_mod #endif diff --git a/cuda/psb_d_cuda_vect_mod.F90 b/cuda/psb_d_cuda_vect_mod.F90 index 83ec108b..44381c99 100644 --- a/cuda/psb_d_cuda_vect_mod.F90 +++ b/cuda/psb_d_cuda_vect_mod.F90 @@ -35,20 +35,17 @@ module psb_d_cuda_vect_mod use psb_const_mod use psb_error_mod use psb_d_vect_mod - use psb_i_vect_mod -#ifdef HAVE_SPGPU use psb_cuda_env_mod + use psb_i_vect_mod use psb_i_cuda_vect_mod use psb_i_vectordev_mod use psb_d_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_d_base_vect_type) :: psb_d_vect_cuda -#ifdef HAVE_SPGPU integer :: state = is_host type(c_ptr) :: deviceVect = c_null_ptr real(c_double), allocatable :: pinned_buffer(:) @@ -105,7 +102,6 @@ module psb_d_cuda_vect_mod procedure, pass(x) :: absval2 => d_cuda_absval2 final :: d_cuda_vect_finalize -#endif end type psb_d_vect_cuda public :: psb_d_vect_cuda_ @@ -126,8 +122,6 @@ contains end function constructor -#ifdef HAVE_SPGPU - subroutine d_cuda_device_wait() call psb_cudaSync() end subroutine d_cuda_device_wait @@ -1204,8 +1198,6 @@ contains end subroutine d_cuda_ins_a -#endif - end module psb_d_cuda_vect_mod @@ -1221,20 +1213,16 @@ module psb_d_cuda_multivect_mod use psb_error_mod use psb_d_multivect_mod use psb_d_base_multivect_mod - + use psb_cuda_env_mod use psb_i_multivect_mod -#ifdef HAVE_SPGPU use psb_i_cuda_multivect_mod use psb_d_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_d_base_multivect_type) :: psb_d_multivect_cuda -#ifdef HAVE_SPGPU - integer(psb_ipk_) :: state = is_host, m_nrows=0, m_ncols=0 type(c_ptr) :: deviceVect = c_null_ptr real(c_double), allocatable :: buffer(:,:) @@ -1276,7 +1264,6 @@ module psb_d_cuda_multivect_mod !!$ procedure, pass(y) :: sctb => d_cuda_multi_sctb !!$ procedure, pass(y) :: sctb_x => d_cuda_multi_sctb_x final :: d_cuda_multi_vect_finalize -#endif end type psb_d_multivect_cuda public :: psb_d_multivect_cuda @@ -1297,7 +1284,6 @@ contains end function constructor -#ifdef HAVE_SPGPU !!$ subroutine d_cuda_multi_gthzv_x(i,n,idx,x,y) !!$ use psi_serial_mod @@ -1981,8 +1967,6 @@ contains end subroutine d_cuda_multi_ins -#endif - end module psb_d_cuda_multivect_mod diff --git a/cuda/psb_d_vectordev_mod.F90 b/cuda/psb_d_vectordev_mod.F90 index cda0d9d7..802add96 100644 --- a/cuda/psb_d_vectordev_mod.F90 +++ b/cuda/psb_d_vectordev_mod.F90 @@ -34,8 +34,6 @@ module psb_d_vectordev_mod use psb_base_vectordev_mod -#ifdef HAVE_SPGPU - interface registerMapped function registerMappedDouble(buf,d_p,n,dummy) & & result(res) bind(c,name='registerMappedDouble') @@ -385,6 +383,4 @@ contains call unregisterMapped(c_loc(buffer)) end subroutine inner_unregisterDouble -#endif - end module psb_d_vectordev_mod diff --git a/cuda/psb_i_cuda_csrg_mat_mod.F90 b/cuda/psb_i_cuda_csrg_mat_mod.F90 index de0eac09..0867a8a5 100644 --- a/cuda/psb_i_cuda_csrg_mat_mod.F90 +++ b/cuda/psb_i_cuda_csrg_mat_mod.F90 @@ -48,7 +48,6 @@ module psb_i_cuda_csrg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(i_Cmat) :: deviceMat integer(psb_ipk_) :: devstate = is_host @@ -81,13 +80,8 @@ module psb_i_cuda_csrg_mat_mod procedure, pass(a) :: to_gpu => psb_i_cuda_csrg_to_gpu procedure, pass(a) :: from_gpu => psb_i_cuda_csrg_from_gpu final :: i_cuda_csrg_finalize -#else - contains - procedure, pass(a) :: mold => psb_i_cuda_csrg_mold -#endif end type psb_i_cuda_csrg_sparse_mat -#ifdef HAVE_SPGPU private :: i_cuda_csrg_get_nzeros, i_cuda_csrg_free, i_cuda_csrg_get_fmt, & & i_cuda_csrg_get_size, i_cuda_csrg_sizeof, i_cuda_csrg_get_nz_row @@ -378,16 +372,4 @@ contains end subroutine i_cuda_csrg_finalize -#else - interface - subroutine psb_i_cuda_csrg_mold(a,b,info) - import :: psb_i_cuda_csrg_sparse_mat, psb_i_base_sparse_mat, psb_ipk_ - class(psb_i_cuda_csrg_sparse_mat), intent(in) :: a - class(psb_i_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_i_cuda_csrg_mold - end interface - -#endif - end module psb_i_cuda_csrg_mat_mod diff --git a/cuda/psb_i_cuda_diag_mat_mod.F90 b/cuda/psb_i_cuda_diag_mat_mod.F90 index 94a3cc3e..98090f06 100644 --- a/cuda/psb_i_cuda_diag_mat_mod.F90 +++ b/cuda/psb_i_cuda_diag_mat_mod.F90 @@ -44,7 +44,6 @@ module psb_i_cuda_diag_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -68,13 +67,8 @@ module psb_i_cuda_diag_mat_mod procedure, pass(a) :: mold => psb_i_cuda_diag_mold procedure, pass(a) :: to_gpu => psb_i_cuda_diag_to_gpu final :: i_cuda_diag_finalize -#else - contains - procedure, pass(a) :: mold => psb_i_cuda_diag_mold -#endif end type psb_i_cuda_diag_sparse_mat -#ifdef HAVE_SPGPU private :: i_cuda_diag_get_nzeros, i_cuda_diag_free, i_cuda_diag_get_fmt, & & i_cuda_diag_get_size, i_cuda_diag_sizeof, i_cuda_diag_get_nz_row @@ -292,17 +286,4 @@ contains return end subroutine i_cuda_diag_finalize -#else - - interface - subroutine psb_i_cuda_diag_mold(a,b,info) - import :: psb_i_cuda_diag_sparse_mat, psb_i_base_sparse_mat, psb_ipk_ - class(psb_i_cuda_diag_sparse_mat), intent(in) :: a - class(psb_i_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_i_cuda_diag_mold - end interface - -#endif - end module psb_i_cuda_diag_mat_mod diff --git a/cuda/psb_i_cuda_dnsg_mat_mod.F90 b/cuda/psb_i_cuda_dnsg_mat_mod.F90 index f357977e..6586d115 100644 --- a/cuda/psb_i_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_i_cuda_dnsg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_i_cuda_dnsg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of DNS, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -69,13 +68,8 @@ module psb_i_cuda_dnsg_mat_mod procedure, pass(a) :: mold => psb_i_cuda_dnsg_mold procedure, pass(a) :: to_gpu => psb_i_cuda_dnsg_to_gpu final :: i_cuda_dnsg_finalize -#else - contains - procedure, pass(a) :: mold => psb_i_cuda_dnsg_mold -#endif end type psb_i_cuda_dnsg_sparse_mat -#ifdef HAVE_SPGPU private :: i_cuda_dnsg_get_nzeros, i_cuda_dnsg_free, i_cuda_dnsg_get_fmt, & & i_cuda_dnsg_get_size, i_cuda_dnsg_get_nz_row @@ -278,17 +272,4 @@ contains return end subroutine i_cuda_dnsg_finalize -#else - - interface - subroutine psb_i_cuda_dnsg_mold(a,b,info) - import :: psb_i_cuda_dnsg_sparse_mat, psb_i_base_sparse_mat, psb_ipk_ - class(psb_i_cuda_dnsg_sparse_mat), intent(in) :: a - class(psb_i_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_i_cuda_dnsg_mold - end interface - -#endif - end module psb_i_cuda_dnsg_mat_mod diff --git a/cuda/psb_i_cuda_elg_mat_mod.F90 b/cuda/psb_i_cuda_elg_mat_mod.F90 index aa3e2d4d..48311eea 100644 --- a/cuda/psb_i_cuda_elg_mat_mod.F90 +++ b/cuda/psb_i_cuda_elg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_i_cuda_elg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of ELL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host @@ -86,14 +85,8 @@ module psb_i_cuda_elg_mat_mod procedure, pass(a) :: to_gpu => psb_i_cuda_elg_to_gpu procedure, pass(a) :: asb => psb_i_cuda_elg_asb final :: i_cuda_elg_finalize -#else - contains - procedure, pass(a) :: mold => psb_i_cuda_elg_mold - procedure, pass(a) :: asb => psb_i_cuda_elg_asb -#endif end type psb_i_cuda_elg_sparse_mat -#ifdef HAVE_SPGPU private :: i_cuda_elg_get_nzeros, i_cuda_elg_free, i_cuda_elg_get_fmt, & & i_cuda_elg_get_size, i_cuda_elg_sizeof, i_cuda_elg_get_nz_row, i_cuda_elg_sync @@ -460,24 +453,4 @@ contains end subroutine i_cuda_elg_finalize -#else - - interface - subroutine psb_i_cuda_elg_asb(a) - import :: psb_i_cuda_elg_sparse_mat - class(psb_i_cuda_elg_sparse_mat), intent(inout) :: a - end subroutine psb_i_cuda_elg_asb - end interface - - interface - subroutine psb_i_cuda_elg_mold(a,b,info) - import :: psb_i_cuda_elg_sparse_mat, psb_i_base_sparse_mat, psb_ipk_ - class(psb_i_cuda_elg_sparse_mat), intent(in) :: a - class(psb_i_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_i_cuda_elg_mold - end interface - -#endif - end module psb_i_cuda_elg_mat_mod diff --git a/cuda/psb_i_cuda_hdiag_mat_mod.F90 b/cuda/psb_i_cuda_hdiag_mat_mod.F90 index 03ff573b..22277f3a 100644 --- a/cuda/psb_i_cuda_hdiag_mat_mod.F90 +++ b/cuda/psb_i_cuda_hdiag_mat_mod.F90 @@ -38,7 +38,6 @@ module psb_i_cuda_hdiag_mat_mod type, extends(psb_i_hdia_sparse_mat) :: psb_i_cuda_hdiag_sparse_mat ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -62,13 +61,8 @@ module psb_i_cuda_hdiag_mat_mod procedure, pass(a) :: mold => psb_i_cuda_hdiag_mold procedure, pass(a) :: to_gpu => psb_i_cuda_hdiag_to_gpu final :: i_cuda_hdiag_finalize -#else - contains - procedure, pass(a) :: mold => psb_i_cuda_hdiag_mold -#endif end type psb_i_cuda_hdiag_sparse_mat -#ifdef HAVE_SPGPU private :: i_cuda_hdiag_get_nzeros, i_cuda_hdiag_free, i_cuda_hdiag_get_fmt, & & i_cuda_hdiag_get_size, i_cuda_hdiag_sizeof, i_cuda_hdiag_get_nz_row @@ -271,17 +265,4 @@ contains return end subroutine i_cuda_hdiag_finalize -#else - - interface - subroutine psb_i_cuda_hdiag_mold(a,b,info) - import :: psb_i_cuda_hdiag_sparse_mat, psb_i_base_sparse_mat, psb_ipk_ - class(psb_i_cuda_hdiag_sparse_mat), intent(in) :: a - class(psb_i_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_i_cuda_hdiag_mold - end interface - -#endif - end module psb_i_cuda_hdiag_mat_mod diff --git a/cuda/psb_i_cuda_hlg_mat_mod.F90 b/cuda/psb_i_cuda_hlg_mat_mod.F90 index f97470d2..b4e3046e 100644 --- a/cuda/psb_i_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_i_cuda_hlg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_i_cuda_hlg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host @@ -82,13 +81,8 @@ module psb_i_cuda_hlg_mat_mod procedure, pass(a) :: from_gpu => psb_i_cuda_hlg_from_gpu procedure, pass(a) :: to_gpu => psb_i_cuda_hlg_to_gpu final :: i_cuda_hlg_finalize -#else - contains - procedure, pass(a) :: mold => psb_i_cuda_hlg_mold -#endif end type psb_i_cuda_hlg_sparse_mat -#ifdef HAVE_SPGPU private :: i_cuda_hlg_get_nzeros, i_cuda_hlg_free, i_cuda_hlg_get_fmt, & & i_cuda_hlg_get_size, i_cuda_hlg_sizeof, i_cuda_hlg_get_nz_row @@ -382,17 +376,4 @@ contains return end subroutine i_cuda_hlg_finalize -#else - - interface - subroutine psb_i_cuda_hlg_mold(a,b,info) - import :: psb_i_cuda_hlg_sparse_mat, psb_i_base_sparse_mat, psb_ipk_ - class(psb_i_cuda_hlg_sparse_mat), intent(in) :: a - class(psb_i_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_i_cuda_hlg_mold - end interface - -#endif - end module psb_i_cuda_hlg_mat_mod diff --git a/cuda/psb_i_cuda_hybg_mat_mod.F90 b/cuda/psb_i_cuda_hybg_mat_mod.F90 index 10333c24..f6fc3110 100644 --- a/cuda/psb_i_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_i_cuda_hybg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_i_cuda_hybg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(i_Hmat) :: deviceMat contains @@ -69,13 +68,8 @@ module psb_i_cuda_hybg_mat_mod procedure, pass(a) :: mold => psb_i_cuda_hybg_mold procedure, pass(a) :: to_gpu => psb_i_cuda_hybg_to_gpu final :: i_cuda_hybg_finalize -#else - contains - procedure, pass(a) :: mold => psb_i_cuda_hybg_mold -#endif end type psb_i_cuda_hybg_sparse_mat -#ifdef HAVE_SPGPU private :: i_cuda_hybg_get_nzeros, i_cuda_hybg_free, i_cuda_hybg_get_fmt, & & i_cuda_hybg_get_size, i_cuda_hybg_sizeof, i_cuda_hybg_get_nz_row @@ -289,18 +283,5 @@ contains return end subroutine i_cuda_hybg_finalize -#else - - interface - subroutine psb_i_cuda_hybg_mold(a,b,info) - import :: psb_i_cuda_hybg_sparse_mat, psb_i_base_sparse_mat, psb_ipk_ - class(psb_i_cuda_hybg_sparse_mat), intent(in) :: a - class(psb_i_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_i_cuda_hybg_mold - end interface - -#endif - end module psb_i_cuda_hybg_mat_mod #endif diff --git a/cuda/psb_i_cuda_vect_mod.F90 b/cuda/psb_i_cuda_vect_mod.F90 index 8d940513..df8f4113 100644 --- a/cuda/psb_i_cuda_vect_mod.F90 +++ b/cuda/psb_i_cuda_vect_mod.F90 @@ -35,17 +35,14 @@ module psb_i_cuda_vect_mod use psb_const_mod use psb_error_mod use psb_i_vect_mod -#ifdef HAVE_SPGPU use psb_cuda_env_mod use psb_i_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_i_base_vect_type) :: psb_i_vect_cuda -#ifdef HAVE_SPGPU integer :: state = is_host type(c_ptr) :: deviceVect = c_null_ptr integer(c_int), allocatable :: pinned_buffer(:) @@ -88,7 +85,6 @@ module psb_i_cuda_vect_mod procedure, pass(x) :: maybe_free_buffer => i_cuda_maybe_free_buffer final :: i_cuda_vect_finalize -#endif end type psb_i_vect_cuda public :: psb_i_vect_cuda_ @@ -109,8 +105,6 @@ contains end function constructor -#ifdef HAVE_SPGPU - subroutine i_cuda_device_wait() call psb_cudaSync() end subroutine i_cuda_device_wait @@ -888,8 +882,6 @@ contains end subroutine i_cuda_ins_a -#endif - end module psb_i_cuda_vect_mod @@ -905,18 +897,14 @@ module psb_i_cuda_multivect_mod use psb_error_mod use psb_i_multivect_mod use psb_i_base_multivect_mod - -#ifdef HAVE_SPGPU + use psb_cuda_env_mod use psb_i_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_i_base_multivect_type) :: psb_i_multivect_cuda -#ifdef HAVE_SPGPU - integer(psb_ipk_) :: state = is_host, m_nrows=0, m_ncols=0 type(c_ptr) :: deviceVect = c_null_ptr real(c_double), allocatable :: buffer(:,:) @@ -958,7 +946,6 @@ module psb_i_cuda_multivect_mod !!$ procedure, pass(y) :: sctb => i_cuda_multi_sctb !!$ procedure, pass(y) :: sctb_x => i_cuda_multi_sctb_x final :: i_cuda_multi_vect_finalize -#endif end type psb_i_multivect_cuda public :: psb_i_multivect_cuda @@ -979,7 +966,6 @@ contains end function constructor -#ifdef HAVE_SPGPU !!$ subroutine i_cuda_multi_gthzv_x(i,n,idx,x,y) !!$ use psi_serial_mod @@ -1663,8 +1649,6 @@ contains end subroutine i_cuda_multi_ins -#endif - end module psb_i_cuda_multivect_mod diff --git a/cuda/psb_i_vectordev_mod.F90 b/cuda/psb_i_vectordev_mod.F90 index 9998d355..84037aaf 100644 --- a/cuda/psb_i_vectordev_mod.F90 +++ b/cuda/psb_i_vectordev_mod.F90 @@ -34,8 +34,6 @@ module psb_i_vectordev_mod use psb_base_vectordev_mod -#ifdef HAVE_SPGPU - interface registerMapped function registerMappedInt(buf,d_p,n,dummy) & & result(res) bind(c,name='registerMappedInt') @@ -278,6 +276,4 @@ contains call unregisterMapped(c_loc(buffer)) end subroutine inner_unregisterInt -#endif - end module psb_i_vectordev_mod diff --git a/cuda/psb_s_cuda_csrg_mat_mod.F90 b/cuda/psb_s_cuda_csrg_mat_mod.F90 index fb13d034..bd654dbb 100644 --- a/cuda/psb_s_cuda_csrg_mat_mod.F90 +++ b/cuda/psb_s_cuda_csrg_mat_mod.F90 @@ -48,7 +48,6 @@ module psb_s_cuda_csrg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(s_Cmat) :: deviceMat integer(psb_ipk_) :: devstate = is_host @@ -81,13 +80,8 @@ module psb_s_cuda_csrg_mat_mod procedure, pass(a) :: to_gpu => psb_s_cuda_csrg_to_gpu procedure, pass(a) :: from_gpu => psb_s_cuda_csrg_from_gpu final :: s_cuda_csrg_finalize -#else - contains - procedure, pass(a) :: mold => psb_s_cuda_csrg_mold -#endif end type psb_s_cuda_csrg_sparse_mat -#ifdef HAVE_SPGPU private :: s_cuda_csrg_get_nzeros, s_cuda_csrg_free, s_cuda_csrg_get_fmt, & & s_cuda_csrg_get_size, s_cuda_csrg_sizeof, s_cuda_csrg_get_nz_row @@ -378,16 +372,4 @@ contains end subroutine s_cuda_csrg_finalize -#else - interface - subroutine psb_s_cuda_csrg_mold(a,b,info) - import :: psb_s_cuda_csrg_sparse_mat, psb_s_base_sparse_mat, psb_ipk_ - class(psb_s_cuda_csrg_sparse_mat), intent(in) :: a - class(psb_s_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_s_cuda_csrg_mold - end interface - -#endif - end module psb_s_cuda_csrg_mat_mod diff --git a/cuda/psb_s_cuda_diag_mat_mod.F90 b/cuda/psb_s_cuda_diag_mat_mod.F90 index 709cd728..b13a8502 100644 --- a/cuda/psb_s_cuda_diag_mat_mod.F90 +++ b/cuda/psb_s_cuda_diag_mat_mod.F90 @@ -44,7 +44,6 @@ module psb_s_cuda_diag_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -68,13 +67,8 @@ module psb_s_cuda_diag_mat_mod procedure, pass(a) :: mold => psb_s_cuda_diag_mold procedure, pass(a) :: to_gpu => psb_s_cuda_diag_to_gpu final :: s_cuda_diag_finalize -#else - contains - procedure, pass(a) :: mold => psb_s_cuda_diag_mold -#endif end type psb_s_cuda_diag_sparse_mat -#ifdef HAVE_SPGPU private :: s_cuda_diag_get_nzeros, s_cuda_diag_free, s_cuda_diag_get_fmt, & & s_cuda_diag_get_size, s_cuda_diag_sizeof, s_cuda_diag_get_nz_row @@ -292,17 +286,4 @@ contains return end subroutine s_cuda_diag_finalize -#else - - interface - subroutine psb_s_cuda_diag_mold(a,b,info) - import :: psb_s_cuda_diag_sparse_mat, psb_s_base_sparse_mat, psb_ipk_ - class(psb_s_cuda_diag_sparse_mat), intent(in) :: a - class(psb_s_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_s_cuda_diag_mold - end interface - -#endif - end module psb_s_cuda_diag_mat_mod diff --git a/cuda/psb_s_cuda_dnsg_mat_mod.F90 b/cuda/psb_s_cuda_dnsg_mat_mod.F90 index b01c8365..8193655e 100644 --- a/cuda/psb_s_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_s_cuda_dnsg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_s_cuda_dnsg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of DNS, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -69,13 +68,8 @@ module psb_s_cuda_dnsg_mat_mod procedure, pass(a) :: mold => psb_s_cuda_dnsg_mold procedure, pass(a) :: to_gpu => psb_s_cuda_dnsg_to_gpu final :: s_cuda_dnsg_finalize -#else - contains - procedure, pass(a) :: mold => psb_s_cuda_dnsg_mold -#endif end type psb_s_cuda_dnsg_sparse_mat -#ifdef HAVE_SPGPU private :: s_cuda_dnsg_get_nzeros, s_cuda_dnsg_free, s_cuda_dnsg_get_fmt, & & s_cuda_dnsg_get_size, s_cuda_dnsg_get_nz_row @@ -278,17 +272,4 @@ contains return end subroutine s_cuda_dnsg_finalize -#else - - interface - subroutine psb_s_cuda_dnsg_mold(a,b,info) - import :: psb_s_cuda_dnsg_sparse_mat, psb_s_base_sparse_mat, psb_ipk_ - class(psb_s_cuda_dnsg_sparse_mat), intent(in) :: a - class(psb_s_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_s_cuda_dnsg_mold - end interface - -#endif - end module psb_s_cuda_dnsg_mat_mod diff --git a/cuda/psb_s_cuda_elg_mat_mod.F90 b/cuda/psb_s_cuda_elg_mat_mod.F90 index d6b003b5..1aa9d36d 100644 --- a/cuda/psb_s_cuda_elg_mat_mod.F90 +++ b/cuda/psb_s_cuda_elg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_s_cuda_elg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of ELL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host @@ -86,14 +85,8 @@ module psb_s_cuda_elg_mat_mod procedure, pass(a) :: to_gpu => psb_s_cuda_elg_to_gpu procedure, pass(a) :: asb => psb_s_cuda_elg_asb final :: s_cuda_elg_finalize -#else - contains - procedure, pass(a) :: mold => psb_s_cuda_elg_mold - procedure, pass(a) :: asb => psb_s_cuda_elg_asb -#endif end type psb_s_cuda_elg_sparse_mat -#ifdef HAVE_SPGPU private :: s_cuda_elg_get_nzeros, s_cuda_elg_free, s_cuda_elg_get_fmt, & & s_cuda_elg_get_size, s_cuda_elg_sizeof, s_cuda_elg_get_nz_row, s_cuda_elg_sync @@ -460,24 +453,4 @@ contains end subroutine s_cuda_elg_finalize -#else - - interface - subroutine psb_s_cuda_elg_asb(a) - import :: psb_s_cuda_elg_sparse_mat - class(psb_s_cuda_elg_sparse_mat), intent(inout) :: a - end subroutine psb_s_cuda_elg_asb - end interface - - interface - subroutine psb_s_cuda_elg_mold(a,b,info) - import :: psb_s_cuda_elg_sparse_mat, psb_s_base_sparse_mat, psb_ipk_ - class(psb_s_cuda_elg_sparse_mat), intent(in) :: a - class(psb_s_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_s_cuda_elg_mold - end interface - -#endif - end module psb_s_cuda_elg_mat_mod diff --git a/cuda/psb_s_cuda_hdiag_mat_mod.F90 b/cuda/psb_s_cuda_hdiag_mat_mod.F90 index 0a66ff09..cac72c86 100644 --- a/cuda/psb_s_cuda_hdiag_mat_mod.F90 +++ b/cuda/psb_s_cuda_hdiag_mat_mod.F90 @@ -38,7 +38,6 @@ module psb_s_cuda_hdiag_mat_mod type, extends(psb_s_hdia_sparse_mat) :: psb_s_cuda_hdiag_sparse_mat ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -62,13 +61,8 @@ module psb_s_cuda_hdiag_mat_mod procedure, pass(a) :: mold => psb_s_cuda_hdiag_mold procedure, pass(a) :: to_gpu => psb_s_cuda_hdiag_to_gpu final :: s_cuda_hdiag_finalize -#else - contains - procedure, pass(a) :: mold => psb_s_cuda_hdiag_mold -#endif end type psb_s_cuda_hdiag_sparse_mat -#ifdef HAVE_SPGPU private :: s_cuda_hdiag_get_nzeros, s_cuda_hdiag_free, s_cuda_hdiag_get_fmt, & & s_cuda_hdiag_get_size, s_cuda_hdiag_sizeof, s_cuda_hdiag_get_nz_row @@ -271,17 +265,4 @@ contains return end subroutine s_cuda_hdiag_finalize -#else - - interface - subroutine psb_s_cuda_hdiag_mold(a,b,info) - import :: psb_s_cuda_hdiag_sparse_mat, psb_s_base_sparse_mat, psb_ipk_ - class(psb_s_cuda_hdiag_sparse_mat), intent(in) :: a - class(psb_s_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_s_cuda_hdiag_mold - end interface - -#endif - end module psb_s_cuda_hdiag_mat_mod diff --git a/cuda/psb_s_cuda_hlg_mat_mod.F90 b/cuda/psb_s_cuda_hlg_mat_mod.F90 index 81b94e5d..4f7b4b6f 100644 --- a/cuda/psb_s_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_s_cuda_hlg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_s_cuda_hlg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host @@ -82,13 +81,8 @@ module psb_s_cuda_hlg_mat_mod procedure, pass(a) :: from_gpu => psb_s_cuda_hlg_from_gpu procedure, pass(a) :: to_gpu => psb_s_cuda_hlg_to_gpu final :: s_cuda_hlg_finalize -#else - contains - procedure, pass(a) :: mold => psb_s_cuda_hlg_mold -#endif end type psb_s_cuda_hlg_sparse_mat -#ifdef HAVE_SPGPU private :: s_cuda_hlg_get_nzeros, s_cuda_hlg_free, s_cuda_hlg_get_fmt, & & s_cuda_hlg_get_size, s_cuda_hlg_sizeof, s_cuda_hlg_get_nz_row @@ -382,17 +376,4 @@ contains return end subroutine s_cuda_hlg_finalize -#else - - interface - subroutine psb_s_cuda_hlg_mold(a,b,info) - import :: psb_s_cuda_hlg_sparse_mat, psb_s_base_sparse_mat, psb_ipk_ - class(psb_s_cuda_hlg_sparse_mat), intent(in) :: a - class(psb_s_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_s_cuda_hlg_mold - end interface - -#endif - end module psb_s_cuda_hlg_mat_mod diff --git a/cuda/psb_s_cuda_hybg_mat_mod.F90 b/cuda/psb_s_cuda_hybg_mat_mod.F90 index ae76aac1..f1446b15 100644 --- a/cuda/psb_s_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_s_cuda_hybg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_s_cuda_hybg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(s_Hmat) :: deviceMat contains @@ -69,13 +68,8 @@ module psb_s_cuda_hybg_mat_mod procedure, pass(a) :: mold => psb_s_cuda_hybg_mold procedure, pass(a) :: to_gpu => psb_s_cuda_hybg_to_gpu final :: s_cuda_hybg_finalize -#else - contains - procedure, pass(a) :: mold => psb_s_cuda_hybg_mold -#endif end type psb_s_cuda_hybg_sparse_mat -#ifdef HAVE_SPGPU private :: s_cuda_hybg_get_nzeros, s_cuda_hybg_free, s_cuda_hybg_get_fmt, & & s_cuda_hybg_get_size, s_cuda_hybg_sizeof, s_cuda_hybg_get_nz_row @@ -289,18 +283,5 @@ contains return end subroutine s_cuda_hybg_finalize -#else - - interface - subroutine psb_s_cuda_hybg_mold(a,b,info) - import :: psb_s_cuda_hybg_sparse_mat, psb_s_base_sparse_mat, psb_ipk_ - class(psb_s_cuda_hybg_sparse_mat), intent(in) :: a - class(psb_s_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_s_cuda_hybg_mold - end interface - -#endif - end module psb_s_cuda_hybg_mat_mod #endif diff --git a/cuda/psb_s_cuda_vect_mod.F90 b/cuda/psb_s_cuda_vect_mod.F90 index e19c980a..7778eb50 100644 --- a/cuda/psb_s_cuda_vect_mod.F90 +++ b/cuda/psb_s_cuda_vect_mod.F90 @@ -35,20 +35,17 @@ module psb_s_cuda_vect_mod use psb_const_mod use psb_error_mod use psb_s_vect_mod - use psb_i_vect_mod -#ifdef HAVE_SPGPU use psb_cuda_env_mod + use psb_i_vect_mod use psb_i_cuda_vect_mod use psb_i_vectordev_mod use psb_s_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_s_base_vect_type) :: psb_s_vect_cuda -#ifdef HAVE_SPGPU integer :: state = is_host type(c_ptr) :: deviceVect = c_null_ptr real(c_float), allocatable :: pinned_buffer(:) @@ -105,7 +102,6 @@ module psb_s_cuda_vect_mod procedure, pass(x) :: absval2 => s_cuda_absval2 final :: s_cuda_vect_finalize -#endif end type psb_s_vect_cuda public :: psb_s_vect_cuda_ @@ -126,8 +122,6 @@ contains end function constructor -#ifdef HAVE_SPGPU - subroutine s_cuda_device_wait() call psb_cudaSync() end subroutine s_cuda_device_wait @@ -1204,8 +1198,6 @@ contains end subroutine s_cuda_ins_a -#endif - end module psb_s_cuda_vect_mod @@ -1221,20 +1213,16 @@ module psb_s_cuda_multivect_mod use psb_error_mod use psb_s_multivect_mod use psb_s_base_multivect_mod - + use psb_cuda_env_mod use psb_i_multivect_mod -#ifdef HAVE_SPGPU use psb_i_cuda_multivect_mod use psb_s_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_s_base_multivect_type) :: psb_s_multivect_cuda -#ifdef HAVE_SPGPU - integer(psb_ipk_) :: state = is_host, m_nrows=0, m_ncols=0 type(c_ptr) :: deviceVect = c_null_ptr real(c_double), allocatable :: buffer(:,:) @@ -1276,7 +1264,6 @@ module psb_s_cuda_multivect_mod !!$ procedure, pass(y) :: sctb => s_cuda_multi_sctb !!$ procedure, pass(y) :: sctb_x => s_cuda_multi_sctb_x final :: s_cuda_multi_vect_finalize -#endif end type psb_s_multivect_cuda public :: psb_s_multivect_cuda @@ -1297,7 +1284,6 @@ contains end function constructor -#ifdef HAVE_SPGPU !!$ subroutine s_cuda_multi_gthzv_x(i,n,idx,x,y) !!$ use psi_serial_mod @@ -1981,8 +1967,6 @@ contains end subroutine s_cuda_multi_ins -#endif - end module psb_s_cuda_multivect_mod diff --git a/cuda/psb_s_vectordev_mod.F90 b/cuda/psb_s_vectordev_mod.F90 index a7319b95..3ecabe70 100644 --- a/cuda/psb_s_vectordev_mod.F90 +++ b/cuda/psb_s_vectordev_mod.F90 @@ -34,8 +34,6 @@ module psb_s_vectordev_mod use psb_base_vectordev_mod -#ifdef HAVE_SPGPU - interface registerMapped function registerMappedFloat(buf,d_p,n,dummy) & & result(res) bind(c,name='registerMappedFloat') @@ -385,6 +383,4 @@ contains call unregisterMapped(c_loc(buffer)) end subroutine inner_unregisterFloat -#endif - end module psb_s_vectordev_mod diff --git a/cuda/psb_z_cuda_csrg_mat_mod.F90 b/cuda/psb_z_cuda_csrg_mat_mod.F90 index 75170185..389149aa 100644 --- a/cuda/psb_z_cuda_csrg_mat_mod.F90 +++ b/cuda/psb_z_cuda_csrg_mat_mod.F90 @@ -48,7 +48,6 @@ module psb_z_cuda_csrg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(z_Cmat) :: deviceMat integer(psb_ipk_) :: devstate = is_host @@ -81,13 +80,8 @@ module psb_z_cuda_csrg_mat_mod procedure, pass(a) :: to_gpu => psb_z_cuda_csrg_to_gpu procedure, pass(a) :: from_gpu => psb_z_cuda_csrg_from_gpu final :: z_cuda_csrg_finalize -#else - contains - procedure, pass(a) :: mold => psb_z_cuda_csrg_mold -#endif end type psb_z_cuda_csrg_sparse_mat -#ifdef HAVE_SPGPU private :: z_cuda_csrg_get_nzeros, z_cuda_csrg_free, z_cuda_csrg_get_fmt, & & z_cuda_csrg_get_size, z_cuda_csrg_sizeof, z_cuda_csrg_get_nz_row @@ -378,16 +372,4 @@ contains end subroutine z_cuda_csrg_finalize -#else - interface - subroutine psb_z_cuda_csrg_mold(a,b,info) - import :: psb_z_cuda_csrg_sparse_mat, psb_z_base_sparse_mat, psb_ipk_ - class(psb_z_cuda_csrg_sparse_mat), intent(in) :: a - class(psb_z_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_z_cuda_csrg_mold - end interface - -#endif - end module psb_z_cuda_csrg_mat_mod diff --git a/cuda/psb_z_cuda_diag_mat_mod.F90 b/cuda/psb_z_cuda_diag_mat_mod.F90 index 80906778..592d50b2 100644 --- a/cuda/psb_z_cuda_diag_mat_mod.F90 +++ b/cuda/psb_z_cuda_diag_mat_mod.F90 @@ -44,7 +44,6 @@ module psb_z_cuda_diag_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -68,13 +67,8 @@ module psb_z_cuda_diag_mat_mod procedure, pass(a) :: mold => psb_z_cuda_diag_mold procedure, pass(a) :: to_gpu => psb_z_cuda_diag_to_gpu final :: z_cuda_diag_finalize -#else - contains - procedure, pass(a) :: mold => psb_z_cuda_diag_mold -#endif end type psb_z_cuda_diag_sparse_mat -#ifdef HAVE_SPGPU private :: z_cuda_diag_get_nzeros, z_cuda_diag_free, z_cuda_diag_get_fmt, & & z_cuda_diag_get_size, z_cuda_diag_sizeof, z_cuda_diag_get_nz_row @@ -292,17 +286,4 @@ contains return end subroutine z_cuda_diag_finalize -#else - - interface - subroutine psb_z_cuda_diag_mold(a,b,info) - import :: psb_z_cuda_diag_sparse_mat, psb_z_base_sparse_mat, psb_ipk_ - class(psb_z_cuda_diag_sparse_mat), intent(in) :: a - class(psb_z_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_z_cuda_diag_mold - end interface - -#endif - end module psb_z_cuda_diag_mat_mod diff --git a/cuda/psb_z_cuda_dnsg_mat_mod.F90 b/cuda/psb_z_cuda_dnsg_mat_mod.F90 index 3fb2488b..3669d6ac 100644 --- a/cuda/psb_z_cuda_dnsg_mat_mod.F90 +++ b/cuda/psb_z_cuda_dnsg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_z_cuda_dnsg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of DNS, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -69,13 +68,8 @@ module psb_z_cuda_dnsg_mat_mod procedure, pass(a) :: mold => psb_z_cuda_dnsg_mold procedure, pass(a) :: to_gpu => psb_z_cuda_dnsg_to_gpu final :: z_cuda_dnsg_finalize -#else - contains - procedure, pass(a) :: mold => psb_z_cuda_dnsg_mold -#endif end type psb_z_cuda_dnsg_sparse_mat -#ifdef HAVE_SPGPU private :: z_cuda_dnsg_get_nzeros, z_cuda_dnsg_free, z_cuda_dnsg_get_fmt, & & z_cuda_dnsg_get_size, z_cuda_dnsg_get_nz_row @@ -278,17 +272,4 @@ contains return end subroutine z_cuda_dnsg_finalize -#else - - interface - subroutine psb_z_cuda_dnsg_mold(a,b,info) - import :: psb_z_cuda_dnsg_sparse_mat, psb_z_base_sparse_mat, psb_ipk_ - class(psb_z_cuda_dnsg_sparse_mat), intent(in) :: a - class(psb_z_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_z_cuda_dnsg_mold - end interface - -#endif - end module psb_z_cuda_dnsg_mat_mod diff --git a/cuda/psb_z_cuda_elg_mat_mod.F90 b/cuda/psb_z_cuda_elg_mat_mod.F90 index 9090b0a2..bd36e4b6 100644 --- a/cuda/psb_z_cuda_elg_mat_mod.F90 +++ b/cuda/psb_z_cuda_elg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_z_cuda_elg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of ELL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer(psb_ipk_) :: devstate = is_host @@ -86,14 +85,8 @@ module psb_z_cuda_elg_mat_mod procedure, pass(a) :: to_gpu => psb_z_cuda_elg_to_gpu procedure, pass(a) :: asb => psb_z_cuda_elg_asb final :: z_cuda_elg_finalize -#else - contains - procedure, pass(a) :: mold => psb_z_cuda_elg_mold - procedure, pass(a) :: asb => psb_z_cuda_elg_asb -#endif end type psb_z_cuda_elg_sparse_mat -#ifdef HAVE_SPGPU private :: z_cuda_elg_get_nzeros, z_cuda_elg_free, z_cuda_elg_get_fmt, & & z_cuda_elg_get_size, z_cuda_elg_sizeof, z_cuda_elg_get_nz_row, z_cuda_elg_sync @@ -460,24 +453,4 @@ contains end subroutine z_cuda_elg_finalize -#else - - interface - subroutine psb_z_cuda_elg_asb(a) - import :: psb_z_cuda_elg_sparse_mat - class(psb_z_cuda_elg_sparse_mat), intent(inout) :: a - end subroutine psb_z_cuda_elg_asb - end interface - - interface - subroutine psb_z_cuda_elg_mold(a,b,info) - import :: psb_z_cuda_elg_sparse_mat, psb_z_base_sparse_mat, psb_ipk_ - class(psb_z_cuda_elg_sparse_mat), intent(in) :: a - class(psb_z_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_z_cuda_elg_mold - end interface - -#endif - end module psb_z_cuda_elg_mat_mod diff --git a/cuda/psb_z_cuda_hdiag_mat_mod.F90 b/cuda/psb_z_cuda_hdiag_mat_mod.F90 index b64498f6..70897664 100644 --- a/cuda/psb_z_cuda_hdiag_mat_mod.F90 +++ b/cuda/psb_z_cuda_hdiag_mat_mod.F90 @@ -38,7 +38,6 @@ module psb_z_cuda_hdiag_mat_mod type, extends(psb_z_hdia_sparse_mat) :: psb_z_cuda_hdiag_sparse_mat ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr contains @@ -62,13 +61,8 @@ module psb_z_cuda_hdiag_mat_mod procedure, pass(a) :: mold => psb_z_cuda_hdiag_mold procedure, pass(a) :: to_gpu => psb_z_cuda_hdiag_to_gpu final :: z_cuda_hdiag_finalize -#else - contains - procedure, pass(a) :: mold => psb_z_cuda_hdiag_mold -#endif end type psb_z_cuda_hdiag_sparse_mat -#ifdef HAVE_SPGPU private :: z_cuda_hdiag_get_nzeros, z_cuda_hdiag_free, z_cuda_hdiag_get_fmt, & & z_cuda_hdiag_get_size, z_cuda_hdiag_sizeof, z_cuda_hdiag_get_nz_row @@ -271,17 +265,4 @@ contains return end subroutine z_cuda_hdiag_finalize -#else - - interface - subroutine psb_z_cuda_hdiag_mold(a,b,info) - import :: psb_z_cuda_hdiag_sparse_mat, psb_z_base_sparse_mat, psb_ipk_ - class(psb_z_cuda_hdiag_sparse_mat), intent(in) :: a - class(psb_z_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_z_cuda_hdiag_mold - end interface - -#endif - end module psb_z_cuda_hdiag_mat_mod diff --git a/cuda/psb_z_cuda_hlg_mat_mod.F90 b/cuda/psb_z_cuda_hlg_mat_mod.F90 index 29ed68fa..2acf43f1 100644 --- a/cuda/psb_z_cuda_hlg_mat_mod.F90 +++ b/cuda/psb_z_cuda_hlg_mat_mod.F90 @@ -49,7 +49,6 @@ module psb_z_cuda_hlg_mat_mod ! If HAVE_SPGPU is undefined this is just ! a copy of HLL, indistinguishable. ! -#ifdef HAVE_SPGPU type(c_ptr) :: deviceMat = c_null_ptr integer :: devstate = is_host @@ -82,13 +81,8 @@ module psb_z_cuda_hlg_mat_mod procedure, pass(a) :: from_gpu => psb_z_cuda_hlg_from_gpu procedure, pass(a) :: to_gpu => psb_z_cuda_hlg_to_gpu final :: z_cuda_hlg_finalize -#else - contains - procedure, pass(a) :: mold => psb_z_cuda_hlg_mold -#endif end type psb_z_cuda_hlg_sparse_mat -#ifdef HAVE_SPGPU private :: z_cuda_hlg_get_nzeros, z_cuda_hlg_free, z_cuda_hlg_get_fmt, & & z_cuda_hlg_get_size, z_cuda_hlg_sizeof, z_cuda_hlg_get_nz_row @@ -382,17 +376,4 @@ contains return end subroutine z_cuda_hlg_finalize -#else - - interface - subroutine psb_z_cuda_hlg_mold(a,b,info) - import :: psb_z_cuda_hlg_sparse_mat, psb_z_base_sparse_mat, psb_ipk_ - class(psb_z_cuda_hlg_sparse_mat), intent(in) :: a - class(psb_z_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_z_cuda_hlg_mold - end interface - -#endif - end module psb_z_cuda_hlg_mat_mod diff --git a/cuda/psb_z_cuda_hybg_mat_mod.F90 b/cuda/psb_z_cuda_hybg_mat_mod.F90 index 1bbc11b2..96620300 100644 --- a/cuda/psb_z_cuda_hybg_mat_mod.F90 +++ b/cuda/psb_z_cuda_hybg_mat_mod.F90 @@ -45,7 +45,6 @@ module psb_z_cuda_hybg_mat_mod ! ! ! -#ifdef HAVE_SPGPU type(z_Hmat) :: deviceMat contains @@ -69,13 +68,8 @@ module psb_z_cuda_hybg_mat_mod procedure, pass(a) :: mold => psb_z_cuda_hybg_mold procedure, pass(a) :: to_gpu => psb_z_cuda_hybg_to_gpu final :: z_cuda_hybg_finalize -#else - contains - procedure, pass(a) :: mold => psb_z_cuda_hybg_mold -#endif end type psb_z_cuda_hybg_sparse_mat -#ifdef HAVE_SPGPU private :: z_cuda_hybg_get_nzeros, z_cuda_hybg_free, z_cuda_hybg_get_fmt, & & z_cuda_hybg_get_size, z_cuda_hybg_sizeof, z_cuda_hybg_get_nz_row @@ -289,18 +283,5 @@ contains return end subroutine z_cuda_hybg_finalize -#else - - interface - subroutine psb_z_cuda_hybg_mold(a,b,info) - import :: psb_z_cuda_hybg_sparse_mat, psb_z_base_sparse_mat, psb_ipk_ - class(psb_z_cuda_hybg_sparse_mat), intent(in) :: a - class(psb_z_base_sparse_mat), intent(inout), allocatable :: b - integer(psb_ipk_), intent(out) :: info - end subroutine psb_z_cuda_hybg_mold - end interface - -#endif - end module psb_z_cuda_hybg_mat_mod #endif diff --git a/cuda/psb_z_cuda_vect_mod.F90 b/cuda/psb_z_cuda_vect_mod.F90 index 35bfb4b5..53484911 100644 --- a/cuda/psb_z_cuda_vect_mod.F90 +++ b/cuda/psb_z_cuda_vect_mod.F90 @@ -35,20 +35,17 @@ module psb_z_cuda_vect_mod use psb_const_mod use psb_error_mod use psb_z_vect_mod - use psb_i_vect_mod -#ifdef HAVE_SPGPU use psb_cuda_env_mod + use psb_i_vect_mod use psb_i_cuda_vect_mod use psb_i_vectordev_mod use psb_z_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_z_base_vect_type) :: psb_z_vect_cuda -#ifdef HAVE_SPGPU integer :: state = is_host type(c_ptr) :: deviceVect = c_null_ptr complex(c_double_complex), allocatable :: pinned_buffer(:) @@ -105,7 +102,6 @@ module psb_z_cuda_vect_mod procedure, pass(x) :: absval2 => z_cuda_absval2 final :: z_cuda_vect_finalize -#endif end type psb_z_vect_cuda public :: psb_z_vect_cuda_ @@ -126,8 +122,6 @@ contains end function constructor -#ifdef HAVE_SPGPU - subroutine z_cuda_device_wait() call psb_cudaSync() end subroutine z_cuda_device_wait @@ -1204,8 +1198,6 @@ contains end subroutine z_cuda_ins_a -#endif - end module psb_z_cuda_vect_mod @@ -1221,20 +1213,16 @@ module psb_z_cuda_multivect_mod use psb_error_mod use psb_z_multivect_mod use psb_z_base_multivect_mod - + use psb_cuda_env_mod use psb_i_multivect_mod -#ifdef HAVE_SPGPU use psb_i_cuda_multivect_mod use psb_z_vectordev_mod -#endif integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_dev = 1 type, extends(psb_z_base_multivect_type) :: psb_z_multivect_cuda -#ifdef HAVE_SPGPU - integer(psb_ipk_) :: state = is_host, m_nrows=0, m_ncols=0 type(c_ptr) :: deviceVect = c_null_ptr real(c_double), allocatable :: buffer(:,:) @@ -1276,7 +1264,6 @@ module psb_z_cuda_multivect_mod !!$ procedure, pass(y) :: sctb => z_cuda_multi_sctb !!$ procedure, pass(y) :: sctb_x => z_cuda_multi_sctb_x final :: z_cuda_multi_vect_finalize -#endif end type psb_z_multivect_cuda public :: psb_z_multivect_cuda @@ -1297,7 +1284,6 @@ contains end function constructor -#ifdef HAVE_SPGPU !!$ subroutine z_cuda_multi_gthzv_x(i,n,idx,x,y) !!$ use psi_serial_mod @@ -1981,8 +1967,6 @@ contains end subroutine z_cuda_multi_ins -#endif - end module psb_z_cuda_multivect_mod diff --git a/cuda/psb_z_vectordev_mod.F90 b/cuda/psb_z_vectordev_mod.F90 index 58c43a43..8f07cd56 100644 --- a/cuda/psb_z_vectordev_mod.F90 +++ b/cuda/psb_z_vectordev_mod.F90 @@ -34,8 +34,6 @@ module psb_z_vectordev_mod use psb_base_vectordev_mod -#ifdef HAVE_SPGPU - interface registerMapped function registerMappedDoubleComplex(buf,d_p,n,dummy) & & result(res) bind(c,name='registerMappedDoubleComplex') @@ -385,6 +383,4 @@ contains call unregisterMapped(c_loc(buffer)) end subroutine inner_unregisterDoubleComplex -#endif - end module psb_z_vectordev_mod diff --git a/cuda/s_cusparse_mod.F90 b/cuda/s_cusparse_mod.F90 index 6e628fa1..ab322129 100644 --- a/cuda/s_cusparse_mod.F90 +++ b/cuda/s_cusparse_mod.F90 @@ -43,9 +43,6 @@ module s_cusparse_mod end type s_Hmat #endif - -#if defined(HAVE_CUDA) && defined(HAVE_SPGPU) - interface CSRGDeviceFree function s_CSRGDeviceFree(Mat) & & bind(c,name="s_CSRGDeviceFree") result(res) @@ -300,6 +297,4 @@ module s_cusparse_mod end interface #endif -#endif - end module s_cusparse_mod diff --git a/cuda/scusparse.c b/cuda/scusparse.c index 70a0cbd7..2ad2e2dc 100644 --- a/cuda/scusparse.c +++ b/cuda/scusparse.c @@ -33,7 +33,6 @@ #include #include -#ifdef HAVE_SPGPU #include #include #include "cintrf.h" @@ -92,4 +91,3 @@ #include "fcusparse_fct.h" -#endif diff --git a/cuda/svectordev.c b/cuda/svectordev.c index 9a41ae1a..bfa4061a 100644 --- a/cuda/svectordev.c +++ b/cuda/svectordev.c @@ -32,7 +32,6 @@ #include #include -#if defined(HAVE_SPGPU) //#include "utils.h" //#include "common.h" #include "svectordev.h" @@ -300,5 +299,3 @@ int absMultiVecDeviceFloat(int n, float alpha, void *deviceVecA) return(i); } -#endif - diff --git a/cuda/svectordev.h b/cuda/svectordev.h index 1fd4fd11..bf25fcb1 100644 --- a/cuda/svectordev.h +++ b/cuda/svectordev.h @@ -31,7 +31,6 @@ #pragma once -#if defined(HAVE_SPGPU) //#include "utils.h" #include "vectordev.h" #include "cuda_runtime.h" @@ -75,4 +74,3 @@ int absMultiVecDeviceFloat(int n, float alpha, void *deviceVecA); int absMultiVecDeviceFloat2(int n, float alpha, void *deviceVecA, void *deviceVecB); -#endif diff --git a/cuda/vectordev.c b/cuda/vectordev.c index 2b22a8a6..65b4d533 100644 --- a/cuda/vectordev.c +++ b/cuda/vectordev.c @@ -32,7 +32,6 @@ #include #include -#if defined(HAVE_SPGPU) #include "cuComplex.h" #include "vectordev.h" #include "cuda_runtime.h" @@ -194,5 +193,3 @@ int getMultiVecDevicePitch(void* deviceVec) return(i); } -#endif - diff --git a/cuda/vectordev.h b/cuda/vectordev.h index 9739c01b..8eca7063 100644 --- a/cuda/vectordev.h +++ b/cuda/vectordev.h @@ -31,7 +31,6 @@ #pragma once -#if defined(HAVE_SPGPU) //#include "utils.h" #include "cuda_runtime.h" //#include "common.h" @@ -86,5 +85,3 @@ int allocMultiVecDevice(void ** remoteMultiVec, struct MultiVectorDeviceParams * int getMultiVecDeviceSize(void* deviceVec); int getMultiVecDeviceCount(void* deviceVec); int getMultiVecDevicePitch(void* deviceVec); - -#endif diff --git a/cuda/z_cusparse_mod.F90 b/cuda/z_cusparse_mod.F90 index 020f1de5..c3f21c0c 100644 --- a/cuda/z_cusparse_mod.F90 +++ b/cuda/z_cusparse_mod.F90 @@ -43,9 +43,6 @@ module z_cusparse_mod end type z_Hmat #endif - -#if defined(HAVE_CUDA) && defined(HAVE_SPGPU) - interface CSRGDeviceFree function z_CSRGDeviceFree(Mat) & & bind(c,name="z_CSRGDeviceFree") result(res) @@ -298,7 +295,6 @@ module z_cusparse_mod integer(c_int) :: res end function z_HYBGHost2Device end interface -#endif #endif diff --git a/cuda/zcusparse.c b/cuda/zcusparse.c index 3991359a..050c0ccd 100644 --- a/cuda/zcusparse.c +++ b/cuda/zcusparse.c @@ -33,7 +33,6 @@ #include #include -#ifdef HAVE_SPGPU #include #include #include "cintrf.h" @@ -91,4 +90,3 @@ #include "fcusparse_fct.h" -#endif diff --git a/cuda/zvectordev.c b/cuda/zvectordev.c index c3671a86..0fb1c67e 100644 --- a/cuda/zvectordev.c +++ b/cuda/zvectordev.c @@ -32,7 +32,6 @@ #include #include -#if defined(HAVE_SPGPU) //#include "utils.h" //#include "common.h" #include "zvectordev.h" @@ -317,5 +316,3 @@ int absMultiVecDeviceDoubleComplex(int n, cuDoubleComplex alpha, void *deviceVec return(i); } -#endif - diff --git a/cuda/zvectordev.h b/cuda/zvectordev.h index ca3c966e..96330a7a 100644 --- a/cuda/zvectordev.h +++ b/cuda/zvectordev.h @@ -31,7 +31,6 @@ #pragma once -#if defined(HAVE_SPGPU) //#include "utils.h" #include #include "cuComplex.h" @@ -87,5 +86,3 @@ int absMultiVecDeviceDoubleComplex(int n, cuDoubleComplex alpha, void *deviceVec int absMultiVecDeviceDoubleComplex2(int n, cuDoubleComplex alpha, void *deviceVecA, void *deviceVecB); - -#endif