[flang][cuda] Add bind names for __double2ll_rX interfaces (#153660)

This commit is contained in:
Valentin Clement (バレンタイン クレメン) 2025-08-14 13:34:25 -07:00 committed by GitHub
parent 52c9489d1d
commit bad3df4764
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 7 deletions

View File

@ -625,29 +625,29 @@ implicit none
end function
end interface
interface __double2ll_rn
attributes(device) integer(8) function __double2ll_rn(r) bind(c)
interface __double2ll_rd
attributes(device) integer(8) function __double2ll_rd(r) bind(c, name='__nv_double2ll_rd')
!dir$ ignore_tkr (d) r
double precision, value :: r
end function
end interface
interface __double2ll_rz
attributes(device) integer(8) function __double2ll_rz(r) bind(c)
interface __double2ll_rn
attributes(device) integer(8) function __double2ll_rn(r) bind(c, name='__nv_double2ll_rn')
!dir$ ignore_tkr (d) r
double precision, value :: r
end function
end interface
interface __double2ll_ru
attributes(device) integer(8) function __double2ll_ru(r) bind(c)
attributes(device) integer(8) function __double2ll_ru(r) bind(c, name='__nv_double2ll_ru')
!dir$ ignore_tkr (d) r
double precision, value :: r
end function
end interface
interface __double2ll_rd
attributes(device) integer(8) function __double2ll_rd(r) bind(c)
interface __double2ll_rz
attributes(device) integer(8) function __double2ll_rz(r) bind(c, name='__nv_double2ll_rz')
!dir$ ignore_tkr (d) r
double precision, value :: r
end function

View File

@ -100,3 +100,18 @@ end subroutine
! CHECK-LABEL: _QPtest_exp
! CHECK: %{{.*}} = fir.call @__nv_expf(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32
! CHECK: %{{.*}} = fir.call @__nv_exp10f(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32
attributes(global) subroutine test_double2ll_rX()
integer(8) :: res
double precision :: r
res = __double2ll_rd(r)
res = __double2ll_rn(r)
res = __double2ll_ru(r)
res = __double2ll_rz(r)
end subroutine
! CHECK-LABEL: _QPtest_double2ll_rx
! CHECK: %{{.*}} = fir.call @__nv_double2ll_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64
! CHECK: %{{.*}} = fir.call @__nv_double2ll_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64
! CHECK: %{{.*}} = fir.call @__nv_double2ll_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64
! CHECK: %{{.*}} = fir.call @__nv_double2ll_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64