Skip to content

Commit

Permalink
Add interfaces for prif_allocate_non_symmetric, prif_deallocate,
Browse files Browse the repository at this point in the history
and `prif_deallocate_non_symmetric` in `allocation_m`.
  • Loading branch information
ktras committed Dec 17, 2023
1 parent 2c3d6fd commit c77cc85
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/caffeine/allocation_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module allocation_m
use iso_c_binding, only: c_ptr, c_int, c_intmax_t, c_size_t, c_funptr
implicit none
private
public :: prif_allocate
public :: prif_allocate, prif_allocate_non_symmetric, prif_deallocate, prif_deallocate_non_symmetric


type, public :: prif_coarray_handle
Expand All @@ -28,6 +28,31 @@ module subroutine prif_allocate( &
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

module subroutine prif_allocate_non_symmetric(size_in_bytes, allocated_memory, stat, errmsg, errmsg_alloc)
implicit none
integer(kind=c_size_t) :: size_in_bytes
type(c_ptr), intent(out) :: allocated_memory
integer(c_int), intent(out), optional :: stat
character(len=*), intent(inout), optional :: errmsg
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

module subroutine prif_deallocate(coarray_handles, stat, errmsg, errmsg_alloc)
implicit none
type(prif_coarray_handle), intent(in) :: coarray_handles(:)
integer(c_int), intent(out), optional :: stat
character(len=*), intent(inout), optional :: errmsg
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

module subroutine prif_deallocate_non_symmetric(mem, stat, errmsg, errmsg_alloc)
implicit none
type(c_ptr), intent(in) :: mem
integer(c_int), intent(out), optional :: stat
character(len=*), intent(inout), optional :: errmsg
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

end interface

end module allocation_m
9 changes: 9 additions & 0 deletions src/caffeine/allocation_s.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,13 @@
product(ubounds-lbounds+1)*element_length, size(ucobounds), lcobounds, ucobounds, final_func, coarray_handle%ptr)
end procedure

module procedure prif_allocate_non_symmetric
end procedure

module procedure prif_deallocate
end procedure

module procedure prif_deallocate_non_symmetric
end procedure

end submodule allocation_s

0 comments on commit c77cc85

Please sign in to comment.