Skip to content

Commit 62f4840

Browse files
committed
[flang][cuda] Add bind name for __ull2double_rX interfaces
1 parent baae949 commit 62f4840

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

flang/module/cudadevice.f90

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -667,29 +667,29 @@ attributes(device) real(8) function sinpi(x) bind(c,name='__nv_sinpi')
667667
end function
668668
end interface
669669

670-
interface __ull2double_rn
671-
attributes(device) double precision function __ull2double_rn(i) bind(c)
670+
interface __ull2double_rd
671+
attributes(device) double precision function __ull2double_rd(i) bind(c, name='__nv_ull2double_rd')
672672
!dir$ ignore_tkr (d) i
673673
integer(8), value :: i
674674
end function
675675
end interface
676676

677-
interface __ull2double_rz
678-
attributes(device) double precision function __ull2double_rz(i) bind(c)
677+
interface __ull2double_rn
678+
attributes(device) double precision function __ull2double_rn(i) bind(c, name='__nv_ull2double_rn')
679679
!dir$ ignore_tkr (d) i
680680
integer(8), value :: i
681681
end function
682682
end interface
683683

684684
interface __ull2double_ru
685-
attributes(device) double precision function __ull2double_ru(i) bind(c)
685+
attributes(device) double precision function __ull2double_ru(i) bind(c, name='__nv_ull2double_ru')
686686
!dir$ ignore_tkr (d) i
687687
integer(8), value :: i
688688
end function
689689
end interface
690690

691-
interface __ull2double_rd
692-
attributes(device) double precision function __ull2double_rd(i) bind(c)
691+
interface __ull2double_rz
692+
attributes(device) double precision function __ull2double_rz(i) bind(c, name='__nv_ull2double_rz')
693693
!dir$ ignore_tkr (d) i
694694
integer(8), value :: i
695695
end function

flang/test/Lower/CUDA/cuda-device-proc.cuf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ attributes(global) subroutine devsub()
8383
af = __powf(af, af)
8484
ad = __dsqrt_rd(ad)
8585
ad = __dsqrt_ru(ad)
86+
ad = __ull2double_rd(al)
87+
ad = __ull2double_rn(al)
88+
ad = __ull2double_ru(al)
89+
ad = __ull2double_rz(al)
8690
end
8791

8892
! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}

0 commit comments

Comments
 (0)