Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions flang/test/Lower/CUDA/cuda-device-proc.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,17 @@ end
! CHECK: func.func private @llvm.nvvm.barrier0.and(i32) -> i32
! CHECK: func.func private @llvm.nvvm.barrier0.popc(i32) -> i32
! CHECK: func.func private @llvm.nvvm.barrier0.or(i32) -> i32

subroutine host1()
integer, device :: a(32)
integer :: i, j

block; use cudadevice
!$cuf kernel do(1) <<<*,32>>>
do i = 1, 32
a(i) = a(i) * 2.0
call syncthreads()
a(i) = a(i) + a(j) - 34.0
end do
end block
end
13 changes: 13 additions & 0 deletions flang/test/Semantics/cuf09.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,16 @@ program main
enddo
enddo
end

subroutine host1()
integer, device :: a(32)
integer :: i, j

!$cuf kernel do(1) <<<*,32>>>
do i = 1, 32
a(i) = a(i) * 2.0
!ERROR: 'syncthreads' may not be called in device code
call syncthreads() ! missing explicit use cudadevice
a(i) = a(i) + a(j) - 34.0
end do
end