Commit f50c0def authored by Budiardja, Reuben's avatar Budiardja, Reuben
Browse files

Added OpenMP metadirective test cases.

parent a3245fcb
program OpenMP_metadirective_target_test
use omp_lib
use iso_fortran_env
integer :: &
iV
real ( real64 ), dimension ( : ), allocatable :: &
A, B, C
allocate ( A ( 1024 ) )
allocate ( B ( 1024 ) )
allocate ( C ( 1024 ) )
call random_number ( A )
call random_number ( B )
call random_number ( C )
!$OMP begin metadirective &
!$OMP when ( implementation = { vendor(ibm) } : target )
!$OMP end metadirective
!$OMP parallel do
do iV = 1, size ( A )
C ( iV ) = A ( iV ) + B ( iV )
end do
end program OpenMP_metadirective_target_test
program OpenMP_metadirective_target_test
use omp_lib
use iso_fortran_env
integer :: &
iV
real ( real64 ), dimension ( : ), allocatable :: &
A, B, C
allocate ( A ( 1024 ) )
allocate ( B ( 1024 ) )
allocate ( C ( 1024 ) )
call random_number ( A )
call random_number ( B )
call random_number ( C )
!$OMP metadirective &
!$OMP when ( implementation = { vendor(ibm) } : target )
!$OMP parallel do
do iV = 1, size ( A )
C ( iV ) = A ( iV ) + B ( iV )
end do
end program OpenMP_metadirective_target_test
program OpenMP_metadirective_target_test
use omp_lib
use iso_fortran_env
integer :: &
iV, &
UseDevice
real ( real64 ), dimension ( : ), allocatable :: &
A, B, C
UseDevice = 1
allocate ( A ( 1024 ) )
allocate ( B ( 1024 ) )
allocate ( C ( 1024 ) )
call random_number ( A )
call random_number ( B )
call random_number ( C )
!$OMP metadirective &
!$OMP when ( user = { condition ( UseDevice > 0 ) } : target )
!$OMP parallel do
do iV = 1, size ( A )
C ( iV ) = A ( iV ) + B ( iV )
end do
end program OpenMP_metadirective_target_test
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