mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 23:06:34 +00:00
30 lines
653 B
Plaintext
30 lines
653 B
Plaintext
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
|
|
module dev
|
|
integer, device :: syncthreads
|
|
|
|
contains
|
|
|
|
attributes(device) subroutine sub1()
|
|
syncthreads = 1 ! syncthreads not overwritten by cudadevice
|
|
end subroutine
|
|
|
|
attributes(global) subroutine sub2()
|
|
!ERROR: 'threadfence' is use-associated from module 'cudadevice' and cannot be re-declared
|
|
integer :: threadfence
|
|
end subroutine
|
|
|
|
attributes(host,device) subroutine sub3()
|
|
if (on_device()) then
|
|
print*, 'on device'
|
|
else
|
|
print*, 'on host'
|
|
end if
|
|
end subroutine
|
|
|
|
attributes(grid_global) subroutine sub4()
|
|
call threadfence()
|
|
end subroutine
|
|
end module
|
|
|