From cf315660e1d90198fd93823e3600e96458038349 Mon Sep 17 00:00:00 2001 From: gabrielequatrana Date: Fri, 12 Apr 2024 10:49:54 +0200 Subject: [PATCH] Updated tests --- Make.inc.in | 0 configure | 0 cuda/dvectordev.c | 7 +++- cuda/psb_d_cuda_vect_mod.F90 | 6 ++- cuda/spgpu/kernels/ddot.cu | 2 +- krylov/psb_dbgmres.f90 | 9 ++--- test/block_krylov/{ => cpu}/Makefile | 0 test/block_krylov/{ => cpu}/getp.f90 | 0 .../block_krylov/{ => cpu}/psb_dbf_sample.f90 | 0 test/block_krylov/{ => cpu}/psb_perf_test.f90 | 0 test/block_krylov/gpu/psb_dbf_sample.F90 | 4 +- test/block_krylov/gpu/psb_dpde_gen.F90 | 4 +- test/block_krylov/kernel/dpdegenmm.F90 | 38 ------------------- 13 files changed, 18 insertions(+), 52 deletions(-) mode change 100755 => 100644 Make.inc.in mode change 100755 => 100644 configure rename test/block_krylov/{ => cpu}/Makefile (100%) rename test/block_krylov/{ => cpu}/getp.f90 (100%) rename test/block_krylov/{ => cpu}/psb_dbf_sample.f90 (100%) rename test/block_krylov/{ => cpu}/psb_perf_test.f90 (100%) diff --git a/Make.inc.in b/Make.inc.in old mode 100755 new mode 100644 diff --git a/configure b/configure old mode 100755 new mode 100644 diff --git a/cuda/dvectordev.c b/cuda/dvectordev.c index bba7d136..615f4974 100644 --- a/cuda/dvectordev.c +++ b/cuda/dvectordev.c @@ -227,7 +227,11 @@ int dotMultiVecDeviceDouble(double* y_res, int n, void* devMultiVecA, void* devM struct MultiVectDevice *devVecB = (struct MultiVectDevice *) devMultiVecB; spgpuHandle_t handle=psb_cudaGetHandle(); - spgpuDmdot(handle, y_res, n, (double*)devVecA->v_, (double*)devVecB->v_,devVecA->count_,devVecB->pitch_); + for (int j=0; jcount_; j++) { + spgpuDmdot(handle, y_res+devVecA->count_*j, n, + ((double*)devVecA->v_)+devVecA->pitch_*j,(double*)devVecB->v_, + devVecB->count_,devVecB->pitch_); + } return(i); } @@ -243,7 +247,6 @@ int axpbyMultiVecDeviceDouble(int n,double alpha, void* devMultiVecX, return SPGPU_UNSUPPORTED; for(j=0;jcount_;j++) - fprintf(stderr,"CUDA ENTERED %d %p %d %d %d \n",j, (((double *)(devVecX->v_))+(pitch)*j), n, pitch, devVecY->size_); spgpuDaxpby(handle,(((double *)(devVecY->v_))+(pitch)*j), n, beta, (((double *)(devVecY->v_))+(pitch)*j), alpha,(((double *)(devVecX->v_))+(pitch)*j)); return(i); diff --git a/cuda/psb_d_cuda_vect_mod.F90 b/cuda/psb_d_cuda_vect_mod.F90 index 748b2d87..1b9c899b 100644 --- a/cuda/psb_d_cuda_vect_mod.F90 +++ b/cuda/psb_d_cuda_vect_mod.F90 @@ -1616,7 +1616,6 @@ contains real(psb_dpk_), external :: ddot integer(psb_ipk_) :: info - res = dzero ! ! Note: this is the gpu implementation. ! When we get here, we are sure that X is of @@ -1626,7 +1625,8 @@ contains type is (psb_d_multivect_cuda) if (x%is_host()) call x%sync() if (yy%is_host()) call yy%sync() - info = dotMultiVecDevice(res,nr,x%deviceVect,yy%deviceVect,x%get_ncols()) + allocate(res(size(x%v,2),size(y%v,2))) + info = dotMultiVecDevice(res,nr,x%deviceVect,yy%deviceVect,size(x%v,2)) if (info /= 0) then info = psb_err_internal_error_ call psb_errpush(info,'d_cuda_multi_dot_v') @@ -1878,6 +1878,7 @@ contains end function d_cuda_multi_nrm2 + ! TODO CUDA function d_cuda_multi_amax(nr,x) result(res) implicit none class(psb_d_multivect_cuda), intent(inout) :: x @@ -1894,6 +1895,7 @@ contains end function d_cuda_multi_amax + ! TODO CUDA function d_cuda_multi_asum(nr,x) result(res) implicit none class(psb_d_multivect_cuda), intent(inout) :: x diff --git a/cuda/spgpu/kernels/ddot.cu b/cuda/spgpu/kernels/ddot.cu index f364ea2c..1d5f0b42 100644 --- a/cuda/spgpu/kernels/ddot.cu +++ b/cuda/spgpu/kernels/ddot.cu @@ -154,7 +154,7 @@ void spgpuDmdot(spgpuHandle_t handle, double* y, int n, __device double* a, __de for (int i=0; i