diff options
| author | Valentin Clement (バレンタイン クレメン) <clementval@gmail.com> | 2025-08-13 14:42:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-13 21:42:57 +0000 |
| commit | 0425cc95bd5b76db4c6924dcf6e93edc33ea850a (patch) | |
| tree | a8a6d100587d6972c73bb462be3666e844a3075c | |
| parent | 022bd53b889e9e113f7ec73cb60b1978845fa474 (diff) | |
| download | llvm-0425cc95bd5b76db4c6924dcf6e93edc33ea850a.zip llvm-0425cc95bd5b76db4c6924dcf6e93edc33ea850a.tar.gz llvm-0425cc95bd5b76db4c6924dcf6e93edc33ea850a.tar.bz2 | |
[flang][cuda] Add bind name for __ull2double_rX interfaces (#153465)
| -rw-r--r-- | flang/module/cudadevice.f90 | 14 | ||||
| -rw-r--r-- | flang/test/Lower/CUDA/cuda-device-proc.cuf | 8 |
2 files changed, 15 insertions, 7 deletions
diff --git a/flang/module/cudadevice.f90 b/flang/module/cudadevice.f90 index 6cc18f4..03860e2 100644 --- a/flang/module/cudadevice.f90 +++ b/flang/module/cudadevice.f90 @@ -667,29 +667,29 @@ implicit none end function end interface - interface __ull2double_rn - attributes(device) double precision function __ull2double_rn(i) bind(c) + interface __ull2double_rd + attributes(device) double precision function __ull2double_rd(i) bind(c, name='__nv_ull2double_rd') !dir$ ignore_tkr (d) i integer(8), value :: i end function end interface - interface __ull2double_rz - attributes(device) double precision function __ull2double_rz(i) bind(c) + interface __ull2double_rn + attributes(device) double precision function __ull2double_rn(i) bind(c, name='__nv_ull2double_rn') !dir$ ignore_tkr (d) i integer(8), value :: i end function end interface interface __ull2double_ru - attributes(device) double precision function __ull2double_ru(i) bind(c) + attributes(device) double precision function __ull2double_ru(i) bind(c, name='__nv_ull2double_ru') !dir$ ignore_tkr (d) i integer(8), value :: i end function end interface - interface __ull2double_rd - attributes(device) double precision function __ull2double_rd(i) bind(c) + interface __ull2double_rz + attributes(device) double precision function __ull2double_rz(i) bind(c, name='__nv_ull2double_rz') !dir$ ignore_tkr (d) i integer(8), value :: i end function diff --git a/flang/test/Lower/CUDA/cuda-device-proc.cuf b/flang/test/Lower/CUDA/cuda-device-proc.cuf index 7957e8b..b146f81 100644 --- a/flang/test/Lower/CUDA/cuda-device-proc.cuf +++ b/flang/test/Lower/CUDA/cuda-device-proc.cuf @@ -84,6 +84,10 @@ attributes(global) subroutine devsub() af = __powf(af, af) ad = __dsqrt_rd(ad) ad = __dsqrt_ru(ad) + ad = __ull2double_rd(al) + ad = __ull2double_rn(al) + ad = __ull2double_ru(al) + ad = __ull2double_rz(al) r2 = __float2half_rn(af) af = __half2float(r2) end @@ -156,6 +160,10 @@ end ! CHECK: %{{.*}} = fir.call @__nv_powf(%{{.*}}, %{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32, f32) -> f32 ! CHECK: %{{.*}} = fir.call @__nv_dsqrt_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 ! CHECK: %{{.*}} = fir.call @__nv_dsqrt_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 +! CHECK: %{{.*}} = fir.call @__nv_ull2double_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f64 +! CHECK: %{{.*}} = fir.call @__nv_ull2double_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f64 +! CHECK: %{{.*}} = fir.call @__nv_ull2double_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f64 +! CHECK: %{{.*}} = fir.call @__nv_ull2double_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f64 ! CHECK: %{{.*}} = fir.call @__nv_float2half_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f16 ! CHECK: %{{.*}} = fir.call @__nv_half2float(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f16) -> f32 |
