Commit 60b33fe9 authored by Pavel Kus's avatar Pavel Kus

copy a_dev to a_mat at the end of bandred instead of later

Previously, matrix a has been kept on the device at the end of bandred
and then copied to host later in redist_band (called from tridiag_band).
However, it seems to be more convenient to do it at the end of bandred
(since it has to be done anyway). Band to tridi is thus now not using a
on the device at all.  However, we keep it in the interface, sice it
might be usefull in the future.
parent 98e3e884
......@@ -1682,6 +1682,22 @@
endif
#endif
if (useGPU) then
! copy a_dev to a_mat
! we do it here, since a is needed on the host in the following routine
! (band to tridi). Previously, a has been kept on the device and then
! copied in redist_band (called from tridiag_band). However, it seems to
! be easier to do it here.
successCUDA = cuda_memcpy (loc(a_mat), int(a_dev,kind=c_intptr_t), int(lda*matrixCols* size_of_datatype, kind=c_intptr_t), &
cudaMemcpyDeviceToHost)
if (.not.(successCUDA)) then
print *,"bandred_&
&MATH_DATATYPE&
&: error in cudaMemcpy"
stop 1
endif
endif ! useGPU
call obj%timer%stop("bandred_&
&MATH_DATATYPE&
&" // &
......
......@@ -89,17 +89,6 @@ subroutine redist_band_&
&PRECISION_SUFFIX &
)
if (useGPU) then
! copy a_dev to a_mat
successCUDA = cuda_memcpy (loc(a_mat), int(a_dev,kind=c_intptr_t), int(lda*matrixCols* size_of_datatype, kind=c_intptr_t), &
cudaMemcpyDeviceToHost)
if (.not.(successCUDA)) then
print *,"redist_band_&
&MATH_DATATYPE&
&: error in cudaMemcpy"
stop 1
endif
endif ! useGPU
call obj%timer%start("mpi_communication")
call mpi_comm_rank(communicator,my_pe,mpierr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment