diff --git a/flang/module/cudadevice.f90 b/flang/module/cudadevice.f90 index ca637a9c2242b..1b3c98b3e3f96 100644 --- a/flang/module/cudadevice.f90 +++ b/flang/module/cudadevice.f90 @@ -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 diff --git a/flang/test/Lower/CUDA/cuda-device-proc.cuf b/flang/test/Lower/CUDA/cuda-device-proc.cuf index 8b3bf98579782..24600291b788a 100644 --- a/flang/test/Lower/CUDA/cuda-device-proc.cuf +++ b/flang/test/Lower/CUDA/cuda-device-proc.cuf @@ -12,6 +12,7 @@ attributes(global) subroutine devsub() integer(8) :: time integer :: smalltime integer(4) :: res + integer(8) :: resl call syncthreads() call syncwarp(1) @@ -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} @@ -99,6 +102,8 @@ end ! CHECK: %{{.*}} = fir.call @__nv_popcll(%{{.*}}) proc_attrs fastmath : (i64) -> i32 ! CHECK: %{{.*}} = fir.call @__nv_ffs(%{{.*}}) proc_attrs fastmath : (i32) -> i32 ! CHECK: %{{.*}} = fir.call @__nv_ffsll(%{{.*}}) proc_attrs fastmath : (i64) -> i32 +! CHECK: %{{.*}} = fir.call @__nv_brev(%{{.*}}) proc_attrs fastmath : (i32) -> i32 +! CHECK: %{{.*}} = fir.call @__nv_brevll(%{{.*}}) proc_attrs fastmath : (i64) -> i64 subroutine host1() integer, device :: a(32)