[flang][cuda] Add interface for __saturatef (#153705)
This commit is contained in:
parent
a629119c75
commit
602f308d4f
@ -325,6 +325,13 @@ implicit none
|
||||
end function
|
||||
end interface
|
||||
|
||||
interface saturate
|
||||
attributes(device) real function __saturatef(r) bind(c, name='__nv_saturatef')
|
||||
!dir$ ignore_tkr (d) r
|
||||
real, value :: r
|
||||
end function
|
||||
end interface
|
||||
|
||||
interface __sad
|
||||
attributes(device) integer function __sad(i,j,k) bind(c, name='__nv_sad')
|
||||
!dir$ ignore_tkr (d) i, (d) j, (d) k
|
||||
|
||||
@ -162,6 +162,15 @@ end subroutine
|
||||
! 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_saturatef()
|
||||
real :: res
|
||||
real :: r
|
||||
res = __saturatef(r)
|
||||
end subroutine
|
||||
|
||||
! CHECK-LABEL: _QPtest_saturatef
|
||||
! CHECK: %{{.*}} = fir.call @__nv_saturatef(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32
|
||||
|
||||
attributes(global) subroutine test_float2ll_rX()
|
||||
integer(8) :: res
|
||||
real :: r
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user