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
4 changes: 2 additions & 2 deletions flang/module/cudadevice.f90
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,11 @@ attributes(device) real(8) function sinpi(x) bind(c,name='__nv_sinpi')
end interface

interface __brev
attributes(device) integer function __brev(i) bind(c)
attributes(device) integer function __brev(i) bind(c, name='__nv_brev')
!dir$ ignore_tkr (d) i
integer, value :: i
end function
attributes(device) integer(8) function __brevll(i) bind(c)
attributes(device) integer(8) function __brevll(i) bind(c, name ='__nv_brevll')
!dir$ ignore_tkr (d) i
integer(8), value :: i
end function
Expand Down
5 changes: 5 additions & 0 deletions flang/test/Lower/CUDA/cuda-device-proc.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ attributes(global) subroutine devsub()
integer(8) :: time
integer :: smalltime
integer(4) :: res
integer(8) :: resl

call syncthreads()
call syncwarp(1)
Expand Down Expand Up @@ -55,6 +56,8 @@ attributes(global) subroutine devsub()
res = __popc(al)
res = __ffs(ai)
res = __ffs(al)
res = __brev(ai)
resl = __brev(al)
end

! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}
Expand Down Expand Up @@ -99,6 +102,8 @@ end
! CHECK: %{{.*}} = fir.call @__nv_popcll(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> i32
! CHECK: %{{.*}} = fir.call @__nv_ffs(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32) -> i32
! CHECK: %{{.*}} = fir.call @__nv_ffsll(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> i32
! CHECK: %{{.*}} = fir.call @__nv_brev(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32) -> i32
! CHECK: %{{.*}} = fir.call @__nv_brevll(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> i64

subroutine host1()
integer, device :: a(32)
Expand Down