[flang][cuda] Add interfaces for __ll2float_rX (#153694)

This commit is contained in:
Valentin Clement (バレンタイン クレメン) 2025-08-14 15:35:02 -07:00 committed by GitHub
parent fc4df2c917
commit ca9ddd54b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 43 additions and 0 deletions

View File

@ -681,6 +681,34 @@ implicit none
end function
end interface
interface __ll2float_rd
attributes(device) real function __ll2float_rd(i) bind(c, name='__nv_ll2float_rd')
!dir$ ignore_tkr (d) i
integer(8), value :: i
end function
end interface
interface __ll2float_rn
attributes(device) real function __ll2float_rn(i) bind(c, name='__nv_ll2float_rn')
!dir$ ignore_tkr (d) i
integer(8), value :: i
end function
end interface
interface __ll2float_ru
attributes(device) real function __ll2float_ru(i) bind(c, name='__nv_ll2float_ru')
!dir$ ignore_tkr (d) i
integer(8), value :: i
end function
end interface
interface __ll2float_rz
attributes(device) real function __ll2float_rz(i) bind(c, name='__nv_ll2float_rz')
!dir$ ignore_tkr (d) i
integer(8), value :: i
end function
end interface
interface __ll2double_rd
attributes(device) double precision function __ll2double_rd(i) bind(c, name='__nv_ll2double_rd')
!dir$ ignore_tkr (d) i

View File

@ -161,3 +161,18 @@ end subroutine
! CHECK: %{{.*}} = fir.call @__nv_double2ull_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64
! CHECK: %{{.*}} = fir.call @__nv_double2ull_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64
! CHECK: %{{.*}} = fir.call @__nv_double2ull_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64
attributes(global) subroutine test_ll2float_rX()
real :: res
integer(8) :: i
res = __ll2float_rd(i)
res = __ll2float_rn(i)
res = __ll2float_ru(i)
res = __ll2float_rz(i)
end subroutine
! CHECK-LABEL: _QPtest_ll2float_rx
! CHECK: %{{.*}} = fir.call @__nv_ll2float_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32
! CHECK: %{{.*}} = fir.call @__nv_ll2float_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32
! CHECK: %{{.*}} = fir.call @__nv_ll2float_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32
! CHECK: %{{.*}} = fir.call @__nv_ll2float_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32