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

interface
attributes(device) real(4) function __powf(x,y) bind(c, name='__nv_powf')
!dir$ ignore_tkr (d) x, y
real(4), value :: x, y
end function
end interface

interface __brev
attributes(device) integer function __brev(i) bind(c, name='__nv_brev')
!dir$ ignore_tkr (d) i
Expand Down
2 changes: 2 additions & 0 deletions flang/test/Lower/CUDA/cuda-device-proc.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ attributes(global) subroutine devsub()
af = __cosf(af)
ai = __mul24(ai, ai)
ai = __umul24(ai, ai)
af = __powf(af, af)
end

! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}
Expand Down Expand Up @@ -114,6 +115,7 @@ end
! CHECK: %{{.*}} = fir.call @__nv_cosf(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32
! CHECK: %{{.*}} = fir.call @__nv_mul24(%{{.*}}, %{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32, i32) -> i32
! CHECK: %{{.*}} = fir.call @__nv_umul24(%{{.*}}, %{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32, i32) -> i32
! CHECK: %{{.*}} = fir.call @__nv_powf(%{{.*}}, %{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32, f32) -> f32

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