Skip to content

[flang][cuda] Add bind name for __ull2double_rX interfaces #153465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 13, 2025

Conversation

clementval
Copy link
Contributor

No description provided.

@clementval clementval requested a review from wangzpgi August 13, 2025 18:36
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir labels Aug 13, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 13, 2025

@llvm/pr-subscribers-flang-fir-hlfir

Author: Valentin Clement (バレンタイン クレメン) (clementval)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/153465.diff

2 Files Affected:

  • (modified) flang/module/cudadevice.f90 (+7-7)
  • (modified) flang/test/Lower/CUDA/cuda-device-proc.cuf (+4)
diff --git a/flang/module/cudadevice.f90 b/flang/module/cudadevice.f90
index cec1147ed5b21..0f63c2ee4bbc0 100644
--- a/flang/module/cudadevice.f90
+++ b/flang/module/cudadevice.f90
@@ -653,29 +653,29 @@ attributes(device) real(8) function sinpi(x) bind(c,name='__nv_sinpi')
     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 4fb658ecfdaed..ed406c329797f 100644
--- a/flang/test/Lower/CUDA/cuda-device-proc.cuf
+++ b/flang/test/Lower/CUDA/cuda-device-proc.cuf
@@ -72,6 +72,10 @@ attributes(global) subroutine devsub()
   ai = __mul24(ai, ai)
   ai = __umul24(ai, ai)
   af = __powf(af, af)
+  ad = __ull2double_rd(al)
+  ad = __ull2double_rn(al)
+  ad = __ull2double_ru(al)
+  ad = __ull2double_rz(al)
 end
 
 ! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}

@clementval clementval force-pushed the cuf___ull2double_rX branch from d2cabb2 to c28cc26 Compare August 13, 2025 21:20
@clementval clementval enabled auto-merge (squash) August 13, 2025 21:21
@clementval clementval merged commit 0425cc9 into llvm:main Aug 13, 2025
9 checks passed
@clementval clementval deleted the cuf___ull2double_rX branch August 13, 2025 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:fir-hlfir flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants