Valentin Clement (バレンタイン クレメン)
3720d8b52d
[flang][cuda] Update some bind name to fast version and add __sincosf ( #153744 )
...
Use the fast version in the bind name and reorder these fast math
functions. Add missing __sincosf interface.
2025-08-15 11:07:15 -07:00
Valentin Clement (バレンタイン クレメン)
115f816069
[flang][cuda] Add missing bind name for __int2double_rn ( #153720 )
2025-08-15 10:27:19 -07:00
Valentin Clement (バレンタイン クレメン)
0e4af726cb
[flang][cuda] Add interface for __fdividef ( #153742 )
2025-08-15 10:26:40 -07:00
Valentin Clement (バレンタイン クレメン)
0e8c964c21
[flang][cuda] Add interfaces for double_as_longlong and longlong_as_double ( #153719 )
2025-08-15 17:26:11 +00:00
Valentin Clement (バレンタイン クレメン)
fd3f052aeb
[flang][cuda] Add interfaces for int_as_float and float_as_int ( #153716 )
2025-08-15 10:00:53 -07:00
Valentin Clement (バレンタイン クレメン)
583499a8cf
[flang][cuda] Add missing bind name for __hiloint2double, __double2loint and __double2hiint ( #153713 )
2025-08-15 09:32:59 -07:00
Valentin Clement (バレンタイン クレメン)
3bc4d66082
[flang][cuda] Add interfaces for __int2float_rX ( #153708 )
2025-08-14 16:45:44 -07:00
Valentin Clement (バレンタイン クレメン)
ffe4870472
[flang][cuda] Add interfaces for __float2int_rX and __float2unit_rX ( #153691 )
2025-08-14 23:11:45 +00:00
Valentin Clement (バレンタイン クレメン)
602f308d4f
[flang][cuda] Add interface for __saturatef ( #153705 )
2025-08-14 15:55:17 -07:00
Valentin Clement (バレンタイン クレメン)
2775c79c4f
[flang][cuda] Add interfaces for __float2ll_rX ( #153702 )
2025-08-14 15:44:52 -07:00
Valentin Clement (バレンタイン クレメン)
ca9ddd54b7
[flang][cuda] Add interfaces for __ll2float_rX ( #153694 )
2025-08-14 15:35:02 -07:00
Valentin Clement (バレンタイン クレメン)
df15c0d716
[flang][cuda] Add interfaces for __dsqrt_rn and __dsqrt_rz ( #153624 )
2025-08-14 22:08:33 +00:00
Valentin Clement (バレンタイン クレメン)
b989c7c2e0
[flang][cuda] Add interfaces for __drcp_rX ( #153681 )
2025-08-14 21:44:47 +00:00
Valentin Clement (バレンタイン クレメン)
06590444f5
[flang][cuda] Add bind names for __double2ull_rX interfaces ( #153678 )
2025-08-14 21:10:20 +00:00
Valentin Clement (バレンタイン クレメン)
bad3df4764
[flang][cuda] Add bind names for __double2ll_rX interfaces ( #153660 )
2025-08-14 13:34:25 -07:00
Valentin Clement (バレンタイン クレメン)
20a829937c
[flang][cuda] Add interfaces for __expf and __exp10f ( #153633 )
2025-08-14 11:36:55 -07:00
Valentin Clement (バレンタイン クレメン)
e27e4f3a99
[flang][cuda] Add interfaces for __uint2float_rX functions ( #153620 )
...
Also add bind name for __uint2double_rn
2025-08-14 18:05:37 +00:00
Valentin Clement (バレンタイン クレメン)
efce767a88
[flang][cuda] Add interfaces for __ull2float_rX functions ( #153613 )
2025-08-14 10:28:17 -07:00
Valentin Clement (バレンタイン クレメン)
a8f1f1b41f
[flang][cuda] Add interfaces for __logf, __log2f and __log10f ( #153611 )
2025-08-14 17:17:52 +00:00
Valentin Clement (バレンタイン クレメン)
6961139ce9
[flang][cuda] Add interfaces for __sinf and __tanf ( #153609 )
2025-08-14 09:50:03 -07:00
Valentin Clement (バレンタイン クレメン)
8d0668c38a
[flang][cuda] Add bind name for __ll2double_rX interfaces ( #153462 )
2025-08-13 22:15:57 +00:00
Valentin Clement (バレンタイン クレメン)
0425cc95bd
[flang][cuda] Add bind name for __ull2double_rX interfaces ( #153465 )
2025-08-13 21:42:57 +00:00
Valentin Clement (バレンタイン クレメン)
088b8ffca1
[flang][cuda] Add interfaces for __usad and __sad ( #153470 )
2025-08-13 12:31:55 -07:00
Valentin Clement (バレンタイン クレメン)
b6df17ff07
[flang][cuda] Add bind name for __double2uint_XX interfaces ( #153285 )
...
Also reorder the interfaces so they appear in alphabetical order
2025-08-13 19:10:21 +00:00
Valentin Clement (バレンタイン クレメン)
5c401331d7
[flang][cuda] Add bind name for __dsqrt_rd and __dsqrt_ru interfaces ( #153290 )
2025-08-13 18:38:31 +00:00
Valentin Clement (バレンタイン クレメン)
b811d4d2f0
[flang][cuda] Add bind name for __double2int_XX interfaces ( #153279 )
...
Also reorder the interfaces to be in alphabetical order
2025-08-13 18:14:07 +00:00
Valentin Clement (バレンタイン クレメン)
6ae6c4fa4b
[flang][cuda] Add bind name for __double2float_XX interfaces ( #153275 )
2025-08-13 10:49:32 -07:00
Valentin Clement (バレンタイン クレメン)
2ae4e95dda
[flang][cuda] Add bind name for __ddiv_XX interfaces ( #153271 )
2025-08-12 23:30:43 -07:00
Valentin Clement (バレンタイン クレメン)
60170f92a3
[flang][cuda] Add missing interface for __powf ( #153294 )
...
`__powf` is defined in the CUDA Fortran programming guide but it's
missing from our cudadevice module. Add the interface and bind name to
`__nv_powf`
https://docs.nvidia.com/hpc-sdk/compilers/cuda-fortran-prog-guide/index.html#fortran-device-modules
https://docs.nvidia.com/cuda/libdevice-users-guide/__nv_powf.html#__nv_powf
2025-08-12 23:08:41 -07:00
Valentin Clement (バレンタイン クレメン)
136c5586bd
[flang][cuda] Add bind name for __clz interface ( #153268 )
2025-08-12 22:28:20 -07:00
Valentin Clement (バレンタイン クレメン)
587b6ce6b9
[flang][cuda] Add bind name for __mul24 and __umul24 ( #153307 )
2025-08-12 22:02:11 -07:00
Valentin Clement (バレンタイン クレメン)
12400a9ebb
[flang][cuda] Add bind name for __brev interface ( #152806 )
2025-08-11 20:44:00 -07:00
Valentin Clement (バレンタイン クレメン)
6b09e95542
[flang][cuda] Add bind name for __fss interface ( #152803 )
2025-08-11 19:32:52 -07:00
Valentin Clement (バレンタイン クレメン)
1acb1018d2
[flang][cuda] Set correct bind(c) name for __popc ( #152795 )
2025-08-08 16:49:45 -07:00
Valentin Clement (バレンタイン クレメン)
4cf7670b01
[flang][cuda] Lower clock() to NNVM op ( #149228 )
...
Also use a same gen function for all NVVM time ops.
2025-07-16 17:24:17 -07:00
Valentin Clement (バレンタイン クレメン)
210cf010c3
[flang][cuda] Lower globaltimer to NVVM op ( #149217 )
2025-07-16 17:02:43 -07:00
Peter Klausler
52a46dc57f
[flang] Allow -fdefault-integer-8 with defined I/O ( #148927 )
...
Defined I/O subroutines have UNIT= and IOSTAT= dummy arguments that are
required to have type INTEGER with its default kind. When that default
kind is modified via -fdefault-integer-8, calls to defined I/O
subroutines from the runtime don't work.
Add a flag to the two data structures shared between the compiler and
the runtime support library to indicate that a defined I/O subroutine
was compiled under -fdefault-integer-8. This has been done in a
compatible manner, so that existing binaries are compatible with the new
library and new binaries are compatible with the old library, unless of
course -fdefault-integer-8 is used.
Fixes https://github.com/llvm/llvm-project/issues/148638 .
2025-07-16 09:09:49 -07:00
Valentin Clement (バレンタイン クレメン)
75175e7230
[flang][cuda] Inline this_thread_block() calls ( #146144 )
2025-06-27 14:59:29 -07:00
Valentin Clement (バレンタイン クレメン)
b2f504ff15
[flang][cuda] Inline this_warp() calls ( #146134 )
2025-06-27 14:12:17 -07:00
Valentin Clement (バレンタイン クレメン)
2b2bd51f3b
[flang][cuda] Inline this_grid call for cooperative groups ( #145796 )
2025-06-25 16:40:47 -07:00
Peter Klausler
2bf3ccabfa
[flang] Restructure runtime to avoid recursion (relanding) ( #143993 )
...
Recursion, both direct and indirect, prevents accurate stack size
calculation at link time for GPU device code. Restructure these
recursive (often mutually so) routines in the Fortran runtime with new
implementations based on an iterative work queue with
suspendable/resumable work tickets: Assign, Initialize, initializeClone,
Finalize, and Destroy.
Default derived type I/O is also recursive, but already disabled. It can
be added to this new framework later if the overall approach succeeds.
Note that derived type FINAL subroutine calls, defined assignments, and
defined I/O procedures all perform callbacks into user code, which may
well reenter the runtime library. This kind of recursion is not handled
by this change, although it may be possible to do so in the future using
thread-local work queues.
(Relanding this patch after reverting initial attempt due to some test
failures that needed some time to analyze and fix.)
Fixes https://github.com/llvm/llvm-project/issues/142481 .
2025-06-16 14:37:01 -07:00
Peter Klausler
10f512f7bb
Revert runtime work queue patch, it breaks some tests that need investigation ( #143713 )
...
Revert "[flang][runtime] Another try to fix build failure"
This reverts commit 13869cac2b5051e453aa96ad71220d9d33404620.
Revert "[flang][runtime] Fix build bot flang-runtime-cuda-gcc errors
(#143650 )"
This reverts commit d75e28477af0baa063a4d4cc7b3cf657cfadd758.
Revert "[flang][runtime] Replace recursion with iterative work queue
(#137727 )"
This reverts commit 163c67ad3d1bf7af6590930d8f18700d65ad4564.
2025-06-11 07:55:06 -07:00
Peter Klausler
163c67ad3d
[flang][runtime] Replace recursion with iterative work queue ( #137727 )
...
Recursion, both direct and indirect, prevents accurate stack size
calculation at link time for GPU device code. Restructure these
recursive (often mutually so) routines in the Fortran runtime with new
implementations based on an iterative work queue with
suspendable/resumable work tickets: Assign, Initialize, initializeClone,
Finalize, and Destroy.
Default derived type I/O is also recursive, but already disabled. It can
be added to this new framework later if the overall approach succeeds.
Note that derived type FINAL subroutine calls, defined assignments, and
defined I/O procedures all perform callbacks into user code, which may
well reenter the runtime library. This kind of recursion is not handled
by this change, although it may be possible to do so in the future using
thread-local work queues.
The effects of this restructuring on CPU performance are yet to be
measured.
2025-06-10 14:44:19 -07:00
Valentin Clement (バレンタイン クレメン)
1a7cd92c86
[flang][cuda] Update syncthreads interface ( #138023 )
2025-05-07 21:56:11 +02:00
Eugene Epshteyn
db53dfce41
[flang] Change c_intmax_t to 64 bit to correspond to intmax_t in C ( #137208 )
...
gcc, clang, and other C compiles define intmax_t to be 64 bit. Change
flang's definition of c_intmax_t to be compatible.
Fixes #128609
2025-04-25 10:25:14 -04:00
Valentin Clement (バレンタイン クレメン)
3f4e4e0a12
[flang][cuda] Add on_device interface to cudadevice ( #134747 )
2025-04-07 18:21:07 -07:00
Valentin Clement (バレンタイン クレメン)
db21ae7803
[flang][cuda] Support any_sync and ballot_sync ( #134135 )
2025-04-02 14:26:09 -07:00
Valentin Clement (バレンタイン クレメン)
ae8dd63681
[flang][cuda] Add interface and lowering for all_sync ( #134001 )
2025-04-01 17:59:11 -07:00
Valentin Clement (バレンタイン クレメン)
20feca47c1
[flang][cuda] Allow ieee_arithmetic on the device ( #131930 )
...
- Allow ieee_arithmetic on the device
- Add ignore_tkr(d) to ieee_is_finite
2025-03-19 07:20:06 -07:00
Valentin Clement (バレンタイン クレメン)
5668c7bb90
[flang][cuda] Add more interfaces for __ldca, __ldcs, __ldlu and __ldcv ( #130218 )
2025-03-07 10:19:20 -08:00