Skip to content

Commit

Permalink
Fix missing deallocate (#63)
Browse files Browse the repository at this point in the history
* Fix missing memory deallocation in kokkos init fortran wrapper.

* just formatting.
  • Loading branch information
pkestene authored Apr 3, 2024
1 parent d383789 commit 967d3de
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/flcl-util-kokkos-f.f90
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
module flcl_util_kokkos_mod
use, intrinsic :: iso_c_binding
use, intrinsic :: iso_fortran_env

implicit none
private

Expand Down Expand Up @@ -73,7 +73,7 @@ end subroutine f_kokkos_initialize_without_args
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
interface
subroutine f_kokkos_finalize() &
& bind(c, name="c_kokkos_finalize")
& bind(c, name="c_kokkos_finalize")
end subroutine f_kokkos_finalize
end interface

Expand Down Expand Up @@ -136,7 +136,11 @@ subroutine kokkos_initialize()
else
call f_kokkos_initialize(cli_count, c_loc(c_strs(0)))
endif


deallocate(strs_array)
deallocate(c_strs)
deallocate(str)

end subroutine kokkos_initialize
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine kokkos_initialize_without_args()
Expand Down Expand Up @@ -181,4 +185,4 @@ function kokkos_is_initialized() result(is_init)
is_init = logical(c_is_init)
end function kokkos_is_initialized
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
end module flcl_util_kokkos_mod
end module flcl_util_kokkos_mod

0 comments on commit 967d3de

Please sign in to comment.