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 55attributes(global) subroutine devsub()
66 implicit none
77 integer :: ret
8+ real(2) :: r2
89 real(4) :: af
910 real(8) :: ad
1011 integer(4) :: ai
@@ -83,6 +84,8 @@ attributes(global) subroutine devsub()
8384 af = __powf(af, af)
8485 ad = __dsqrt_rd(ad)
8586 ad = __dsqrt_ru(ad)
87+ r2 = __float2half_rn(af)
88+ af = __half2float(r2)
8689end
8790
8891! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}
153156! CHECK: %{{.*}} = fir.call @__nv_powf(%{{.*}}, %{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32, f32) -> f32
154157! CHECK: %{{.*}} = fir.call @__nv_dsqrt_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64
155158! 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
156161
157162subroutine host1()
158163 integer, device :: a(32)
You can’t perform that action at this time.
0 commit comments