Skip to content

Commit 115f816

Browse files
authored
[flang][cuda] Add missing bind name for __int2double_rn (#153720)
1 parent 0e4af72 commit 115f816

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

flang/module/cudadevice.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ attributes(device) real(8) function sinpi(x) bind(c,name='__nv_sinpi')
738738
end interface
739739

740740
interface __int2double_rn
741-
attributes(device) double precision function __int2double_rn(i) bind(c)
741+
attributes(device) double precision function __int2double_rn(i) bind(c, name='__nv_int2double_rn')
742742
!dir$ ignore_tkr (d) i
743743
integer, value :: i
744744
end function

flang/test/Lower/CUDA/cuda-libdevice.cuf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,15 @@ end subroutine
245245
! CHECK: %{{.*}} = fir.call @__nv_float2uint_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32
246246
! CHECK: %{{.*}} = fir.call @__nv_float2uint_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32
247247

248+
attributes(global) subroutine test_int2double_rn()
249+
double precision :: res
250+
integer :: r
251+
res = __int2double_rn(r)
252+
end subroutine
253+
254+
! CHECK-LABEL: _QPtest_int2double_rn
255+
! CHECK: %{{.*}} = fir.call @__nv_int2double_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32) -> f64
256+
248257
attributes(global) subroutine test_fdividef()
249258
real :: res
250259
real :: r

0 commit comments

Comments
 (0)