| 1 |
module my_omp_lib |
| 2 |
use iso_c_binding, only: c_intptr_t |
| 3 |
!use omp_lib |
| 4 |
implicit none |
| 5 |
integer, parameter :: omp_allocator_handle_kind = c_intptr_t |
| 6 |
|
| 7 |
integer (kind=omp_allocator_handle_kind), & |
| 8 |
parameter :: omp_null_allocator = 0 |
| 9 |
|
| 10 |
integer (kind=omp_allocator_handle_kind), & |
| 11 |
parameter :: omp_default_mem_alloc = 1 |
| 12 |
integer (kind=omp_allocator_handle_kind), & |
| 13 |
parameter :: omp_large_cap_mem_alloc = 2 |
| 14 |
integer (kind=omp_allocator_handle_kind), & |
| 15 |
parameter :: omp_const_mem_alloc = 3 |
| 16 |
integer (kind=omp_allocator_handle_kind), & |
| 17 |
parameter :: omp_high_bw_mem_alloc = 4 |
| 18 |
integer (kind=omp_allocator_handle_kind), & |
| 19 |
parameter :: omp_low_lat_mem_alloc = 5 |
| 20 |
integer (kind=omp_allocator_handle_kind), & |
| 21 |
parameter :: omp_cgroup_mem_alloc = 6 |
| 22 |
integer (kind=omp_allocator_handle_kind), & |
| 23 |
parameter :: omp_pteam_mem_alloc = 7 |
| 24 |
integer (kind=omp_allocator_handle_kind), & |
| 25 |
parameter :: omp_thread_mem_alloc = 8 |
| 26 |
end module my_omp_lib |
| 27 |
|
| 28 |
subroutine one(n, my_alloc) |
| 29 |
use my_omp_lib |
| 30 |
implicit none |
| 31 |
integer :: n |
| 32 |
integer(kind=omp_allocator_handle_kind), intent(in) :: my_alloc |
| 33 |
|
| 34 |
!stack variables: |
| 35 |
integer :: a,b,c(n),d(5),e(2) |
| 36 |
!$omp allocate(a) |
| 37 |
!$omp allocate ( b , c ) align ( 32) allocator (my_alloc) |
| 38 |
!$omp allocate (d) align( 128 ) |
| 39 |
!$omp allocate( e ) allocator( omp_high_bw_mem_alloc ) |
| 40 |
|
| 41 |
!saved vars |
| 42 |
integer, save :: k,l,m(5),r(2) |
| 43 |
!$omp allocate(k) align(16) , allocator (omp_large_cap_mem_alloc) |
| 44 |
!$omp allocate ( l ) allocator (omp_large_cap_mem_alloc) , align ( 32) |
| 45 |
!$omp allocate (m) align( 128 ),allocator( omp_high_bw_mem_alloc ) |
| 46 |
!$omp allocate( r ) allocator( omp_high_bw_mem_alloc ) |
| 47 |
|
| 48 |
!common /block/ |
| 49 |
integer :: q,x,y(2),z(5) |
| 50 |
common /com1/ q,x ! { dg-error "Sorry, !.OMP allocate for COMMON block variable 'com1' at .1. not supported" } |
| 51 |
common /com2/ y,z ! { dg-error "Sorry, !.OMP allocate for COMMON block variable 'com2' at .1. not supported" } |
| 52 |
!$omp allocate ( / com1/) align( 128 ) allocator( omp_high_bw_mem_alloc ) |
| 53 |
!$omp allocate(/com2 / ) allocator( omp_high_bw_mem_alloc ) |
| 54 |
end |