Fix tracking of vector allocations.

repack-track
Salvatore Filippone 11 months ago
parent ef82b975e3
commit d94b3dae58

@ -729,7 +729,7 @@ contains
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
nd = getMultiVecDeviceSize(x%deviceVect) nd = getMultiVecDeviceSize(x%deviceVect)
if (nd < nh ) then if (nd < nh ) then
call trackCudaFree(' c_vect_cuda ',x%sizeof()) call trackCudaFree(' c_vect_cuda 1',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
@ -790,13 +790,13 @@ contains
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
info = 0 info = 0
if (allocated(x%v)) deallocate(x%v, stat=info)
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
!!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice' !!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice'
call trackCudaFree(' c_vect_cuda ',x%sizeof()) call trackCudaFree(' c_vect_cuda 2',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
if (allocated(x%v)) deallocate(x%v, stat=info)
call x%free_buffer(info) call x%free_buffer(info)
call x%set_sync() call x%set_sync()
end subroutine c_cuda_free end subroutine c_cuda_free

@ -729,7 +729,7 @@ contains
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
nd = getMultiVecDeviceSize(x%deviceVect) nd = getMultiVecDeviceSize(x%deviceVect)
if (nd < nh ) then if (nd < nh ) then
call trackCudaFree(' d_vect_cuda ',x%sizeof()) call trackCudaFree(' d_vect_cuda 1',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
@ -790,13 +790,13 @@ contains
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
info = 0 info = 0
if (allocated(x%v)) deallocate(x%v, stat=info)
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
!!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice' !!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice'
call trackCudaFree(' d_vect_cuda ',x%sizeof()) call trackCudaFree(' d_vect_cuda 2',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
if (allocated(x%v)) deallocate(x%v, stat=info)
call x%free_buffer(info) call x%free_buffer(info)
call x%set_sync() call x%set_sync()
end subroutine d_cuda_free end subroutine d_cuda_free

@ -711,7 +711,7 @@ contains
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
nd = getMultiVecDeviceSize(x%deviceVect) nd = getMultiVecDeviceSize(x%deviceVect)
if (nd < nh ) then if (nd < nh ) then
call trackCudaFree(' i_vect_cuda ',x%sizeof()) call trackCudaFree(' i_vect_cuda 1',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
@ -772,13 +772,13 @@ contains
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
info = 0 info = 0
if (allocated(x%v)) deallocate(x%v, stat=info)
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
!!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice' !!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice'
call trackCudaFree(' i_vect_cuda ',x%sizeof()) call trackCudaFree(' i_vect_cuda 2',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
if (allocated(x%v)) deallocate(x%v, stat=info)
call x%free_buffer(info) call x%free_buffer(info)
call x%set_sync() call x%set_sync()
end subroutine i_cuda_free end subroutine i_cuda_free

@ -729,7 +729,7 @@ contains
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
nd = getMultiVecDeviceSize(x%deviceVect) nd = getMultiVecDeviceSize(x%deviceVect)
if (nd < nh ) then if (nd < nh ) then
call trackCudaFree(' s_vect_cuda ',x%sizeof()) call trackCudaFree(' s_vect_cuda 1',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
@ -790,13 +790,13 @@ contains
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
info = 0 info = 0
if (allocated(x%v)) deallocate(x%v, stat=info)
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
!!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice' !!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice'
call trackCudaFree(' s_vect_cuda ',x%sizeof()) call trackCudaFree(' s_vect_cuda 2',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
if (allocated(x%v)) deallocate(x%v, stat=info)
call x%free_buffer(info) call x%free_buffer(info)
call x%set_sync() call x%set_sync()
end subroutine s_cuda_free end subroutine s_cuda_free

@ -729,7 +729,7 @@ contains
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
nd = getMultiVecDeviceSize(x%deviceVect) nd = getMultiVecDeviceSize(x%deviceVect)
if (nd < nh ) then if (nd < nh ) then
call trackCudaFree(' z_vect_cuda ',x%sizeof()) call trackCudaFree(' z_vect_cuda 1',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
@ -790,13 +790,13 @@ contains
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
info = 0 info = 0
if (allocated(x%v)) deallocate(x%v, stat=info)
if (c_associated(x%deviceVect)) then if (c_associated(x%deviceVect)) then
!!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice' !!$ write(0,*)'d_cuda_free Calling freeMultiVecDevice'
call trackCudaFree(' z_vect_cuda ',x%sizeof()) call trackCudaFree(' z_vect_cuda 2',x%sizeof())
call freeMultiVecDevice(x%deviceVect) call freeMultiVecDevice(x%deviceVect)
x%deviceVect=c_null_ptr x%deviceVect=c_null_ptr
end if end if
if (allocated(x%v)) deallocate(x%v, stat=info)
call x%free_buffer(info) call x%free_buffer(info)
call x%set_sync() call x%set_sync()
end subroutine z_cuda_free end subroutine z_cuda_free

Loading…
Cancel
Save