Commit 57821b44 authored by Pavel Kus's avatar Pavel Kus
Browse files

fixing not freed a_dev

a_dev was never freed on the GPU
However, this might not be enough. What if bandred runs on GPU and
band_to_tridi on CPU? a_dev is then not allocated. Has to be re-thinked
in general
parent 82ffbd38
......@@ -265,6 +265,7 @@
if (check_for_gpu(my_pe,numberOfGPUDevices, wantDebug=wantDebug)) then
do_useGPU = .true.
a_dev = 0
! set the neccessary parameters
cudaMemcpyHostToDevice = cuda_memcpyHostToDevice()
......@@ -900,6 +901,15 @@
endif
endif
if(do_useGPU .and. (a_dev .ne. 0)) then
successCUDA = cuda_free(a_dev)
if (.not.(successCUDA)) then
print *,"elpa2_template: error in cudaFree, a_dev"
stop 1
endif
endif
if (obj%eigenvalues_only) then
deallocate(q_dummy, stat=istat, errmsg=errorMessage)
if (istat .ne. 0) then
......
Supports Markdown
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