brintos

brintos / llvm-project-archived public Read only

0
0
Text · 757 B · da034ad Raw
44 lines · plain
1 2! RUN: bbc -fopenacc -fcuda -emit-hlfir %s -o - | FileCheck %s3 4module m5 6interface doit7subroutine __device_sub(a)8    real(4), device, intent(in) :: a(:,:,:)9    !dir$ ignore_tkr(c) a10end11subroutine __host_sub(a)12    real(4), intent(in) :: a(:,:,:)13    !dir$ ignore_tkr(c) a14end15end interface16end module17 18program testex119integer, parameter :: ntimes = 1020integer, parameter :: ni=12821integer, parameter :: nj=25622integer, parameter :: nk=6423real(4), dimension(ni,nj,nk) :: a24 25!$acc enter data copyin(a)26 27block; use m28!$acc host_data use_device(a)29do nt = 1, ntimes30  call doit(a)31end do32!$acc end host_data33end block34 35block; use m36do nt = 1, ntimes37  call doit(a)38end do39end block40end41 42! CHECK: fir.call @_QP__device_sub43! CHECK: fir.call @_QP__host_sub44