1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
!
! Copyright (C) 2022, MaX CoE
! Distributed under the MIT License
! (license terms are at http://opensource.org/licenses/MIT).
!
!--
!
! Utility functions to check allocation status on the device
! using CUDA-Fortran, OpenACC or OpenMP Offload
!
!==================================================================
!==================================================================
! *DO NOT EDIT*: automatically generated from devxlib_malloc_allocated.jf90
!==================================================================
!==================================================================
!
#include<devxlib_macros.h>
#include<devxlib_defs.h>
!
!=======================================
!
submodule (devxlib_malloc) devxlib_malloc_allocated
implicit none
contains
{%- for t in types %}
{%- for p in kinds[t] %}
{%- for d in range(1,dimensions+1) %}
module function {{p.name}}_devxlib_malloc_allocated_{{t[0]|lower}}{{d}}d(array) result(res)
implicit none
!
logical :: res
{{t}}({{p.val}}), allocatable, intent(in) DEV_ATTR :: array({% for dd in range(d) %}:{% if not loop.last %}, {%- endif %}{% endfor %})
res=allocated(array)
return
end function {{p.name}}_devxlib_malloc_allocated_{{t[0]|lower}}{{d}}d
!
{%- endfor %}
{%- endfor %}
{%- endfor %}
{%- for t in types %}
{%- for p in kinds[t] %}
{%- for d in range(1,dimensions+1) %}
module function {{p.name}}_devxlib_malloc_allocated_{{t[0]|lower}}{{d}}d_p(dev_ptr) result(res)
implicit none
!
logical :: res
{{t}}({{p.val}}), pointer, intent(in) DEV_ATTR :: dev_ptr({% for dd in range(d) %}:{% if not loop.last %}, {%- endif %}{% endfor %})
res=associated(dev_ptr)
return
end function {{p.name}}_devxlib_malloc_allocated_{{t[0]|lower}}{{d}}d_p
!
{%- endfor %}
{%- endfor %}
{%- endfor %}
endsubmodule devxlib_malloc_allocated
|