Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -399,6 +399,13 @@ attributes(device) subroutine sincospi(x, y, z) bind(c,name='__nv_sincospi')
end function
end interface

interface __fdividef
attributes(device) real function __fdividef(r,d) bind(c, name='__nv_fast_fdividef')
!dir$ ignore_tkr (d) r, (d) d
real, value :: r,d
end function
end interface

interface __sinf
attributes(device) real function __sinf(r) bind(c, name='__nv_sinf')
!dir$ ignore_tkr (d) r
Expand Down
9 changes: 9 additions & 0 deletions flang/test/Lower/CUDA/cuda-libdevice.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,12 @@ end subroutine
! CHECK: %{{.*}} = fir.call @__nv_float2uint_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32
! CHECK: %{{.*}} = fir.call @__nv_float2uint_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32
! CHECK: %{{.*}} = fir.call @__nv_float2uint_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32

attributes(global) subroutine test_fdividef()
real :: res
real :: r
res = __fdividef(r, r)
end subroutine

! CHECK-LABEL: _QPtest_fdividef
! CHECK: %{{.*}} = fir.call @__nv_fast_fdividef(%{{.*}}, %{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32, f32) -> f32