File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 5
5
attributes(global) subroutine devsub()
6
6
implicit none
7
7
integer :: ret
8
+ real(2) :: r2
8
9
real(4) :: af
9
10
real(8) :: ad
10
11
integer(4) :: ai
@@ -83,6 +84,8 @@ attributes(global) subroutine devsub()
83
84
af = __powf(af, af)
84
85
ad = __dsqrt_rd(ad)
85
86
ad = __dsqrt_ru(ad)
87
+ r2 = __float2half_rn(af)
88
+ af = __half2float(r2)
86
89
end
87
90
88
91
! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}
153
156
! CHECK: %{{.*}} = fir.call @__nv_powf(%{{.*}}, %{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32, f32) -> f32
154
157
! CHECK: %{{.*}} = fir.call @__nv_dsqrt_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64
155
158
! CHECK: %{{.*}} = fir.call @__nv_dsqrt_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64
159
+ ! CHECK: %{{.*}} = fir.call @__nv_float2half_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f16
160
+ ! CHECK: %{{.*}} = fir.call @__nv_half2float(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f16) -> f32
156
161
157
162
subroutine host1()
158
163
integer, device :: a(32)
You can’t perform that action at this time.
0 commit comments