diff --git a/flang/module/cudadevice.f90 b/flang/module/cudadevice.f90 index a2bec3f633c5a..f7b7d856ecb90 100644 --- a/flang/module/cudadevice.f90 +++ b/flang/module/cudadevice.f90 @@ -770,6 +770,13 @@ attributes(device) real(8) function sinpi(x) bind(c,name='__nv_sinpi') end function end interface + interface + attributes(device) real(4) function __powf(x,y) bind(c, name='__nv_powf') + !dir$ ignore_tkr (d) x, y + real(4), value :: x, y + end function + end interface + interface __brev attributes(device) integer function __brev(i) bind(c, name='__nv_brev') !dir$ ignore_tkr (d) i diff --git a/flang/test/Lower/CUDA/cuda-device-proc.cuf b/flang/test/Lower/CUDA/cuda-device-proc.cuf index 2fea9a0ccbc96..6c56f8616c404 100644 --- a/flang/test/Lower/CUDA/cuda-device-proc.cuf +++ b/flang/test/Lower/CUDA/cuda-device-proc.cuf @@ -63,6 +63,7 @@ attributes(global) subroutine devsub() af = __cosf(af) ai = __mul24(ai, ai) ai = __umul24(ai, ai) + af = __powf(af, af) end ! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc} @@ -114,6 +115,7 @@ end ! CHECK: %{{.*}} = fir.call @__nv_cosf(%{{.*}}) proc_attrs fastmath : (f32) -> f32 ! 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 subroutine host1() integer, device :: a(32)