diff --git a/flang/module/cudadevice.f90 b/flang/module/cudadevice.f90 index cec1147ed5b21..c026bc5b284b8 100644 --- a/flang/module/cudadevice.f90 +++ b/flang/module/cudadevice.f90 @@ -450,29 +450,29 @@ attributes(device) real(8) function sinpi(x) bind(c,name='__nv_sinpi') end function end interface - interface __double2int_rn - attributes(device) integer function __double2int_rn(r) bind(c) + interface __double2int_rd + attributes(device) integer function __double2int_rd(r) bind(c, name='__nv_double2int_rd') !dir$ ignore_tkr (d) r double precision, value :: r end function end interface - interface __double2int_rz - attributes(device) integer function __double2int_rz(r) bind(c) + interface __double2int_rn + attributes(device) integer function __double2int_rn(r) bind(c, name='__nv_double2int_rn') !dir$ ignore_tkr (d) r double precision, value :: r end function end interface interface __double2int_ru - attributes(device) integer function __double2int_ru(r) bind(c) + attributes(device) integer function __double2int_ru(r) bind(c, name='__nv_double2int_ru') !dir$ ignore_tkr (d) r double precision, value :: r end function end interface - interface __double2int_rd - attributes(device) integer function __double2int_rd(r) bind(c) + interface __double2int_rz + attributes(device) integer function __double2int_rz(r) bind(c, name='__nv_double2int_rz') !dir$ ignore_tkr (d) r double precision, value :: r end function diff --git a/flang/test/Lower/CUDA/cuda-device-proc.cuf b/flang/test/Lower/CUDA/cuda-device-proc.cuf index 4fb658ecfdaed..a01935876360a 100644 --- a/flang/test/Lower/CUDA/cuda-device-proc.cuf +++ b/flang/test/Lower/CUDA/cuda-device-proc.cuf @@ -58,6 +58,7 @@ attributes(global) subroutine devsub() res = __ffs(al) res = __brev(ai) resl = __brev(al) + res = __clz(ai) res = __clz(al) af = __cosf(af) @@ -69,6 +70,10 @@ attributes(global) subroutine devsub() af = __double2float_rz(ad) af = __double2float_ru(ad) af = __double2float_rd(ad) + ai = __double2int_rd(ad) + ai = __double2int_rn(ad) + ai = __double2int_ru(ad) + ai = __double2int_rz(ad) ai = __mul24(ai, ai) ai = __umul24(ai, ai) af = __powf(af, af) @@ -129,6 +134,10 @@ end ! CHECK: %{{.*}} = fir.call @__nv_double2float_rz(%{{.*}}) proc_attrs fastmath : (f64) -> f32 ! CHECK: %{{.*}} = fir.call @__nv_double2float_ru(%{{.*}}) proc_attrs fastmath : (f64) -> f32 ! CHECK: %{{.*}} = fir.call @__nv_double2float_rd(%{{.*}}) proc_attrs fastmath : (f64) -> f32 +! CHECK: %{{.*}} = fir.call @__nv_double2int_rd(%{{.*}}) proc_attrs fastmath : (f64) -> i32 +! CHECK: %{{.*}} = fir.call @__nv_double2int_rn(%{{.*}}) proc_attrs fastmath : (f64) -> i32 +! CHECK: %{{.*}} = fir.call @__nv_double2int_ru(%{{.*}}) proc_attrs fastmath : (f64) -> i32 +! CHECK: %{{.*}} = fir.call @__nv_double2int_rz(%{{.*}}) proc_attrs fastmath : (f64) -> i32 ! CHECK: %{{.*}} = fir.call @__nv_mul24(%{{.*}}, %{{.*}}) proc_attrs fastmath : (i32, i32) -> i32 ! CHECK: %{{.*}} = fir.call @__nv_umul24(%{{.*}}, %{{.*}}) proc_attrs fastmath : (i32, i32) -> i32 ! CHECK: %{{.*}} = fir.call @__nv_powf(%{{.*}}, %{{.*}}) proc_attrs fastmath : (f32, f32) -> f32