[flang-commits] [flang] [CUF] Moving __fadd_rd and __fadd_ru to cudadevice.f90 as they are symbol already known upstream. (PR #123127)
Renaud Kauffmann via flang-commits
flang-commits at lists.llvm.org
Wed Jan 15 14:21:09 PST 2025
https://github.com/Renaud-K updated https://github.com/llvm/llvm-project/pull/123127
>From acd95ec0be0fec73e78f257f3b9ee7dfdf270931 Mon Sep 17 00:00:00 2001
From: Renaud-K <rkauffmann at nvidia.com>
Date: Wed, 15 Jan 2025 14:14:08 -0800
Subject: [PATCH 1/2] Moving __fadd_rd and __fadd_ru to cudadevice.f90 as they
are upstream symbols.
---
flang/module/__cuda_device.f90 | 15 ---------------
flang/module/cudadevice.f90 | 16 ++++++++++++++++
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/flang/module/__cuda_device.f90 b/flang/module/__cuda_device.f90
index 81b1f5aa334bbf..73f3d19c98a317 100644
--- a/flang/module/__cuda_device.f90
+++ b/flang/module/__cuda_device.f90
@@ -14,19 +14,4 @@
! Set PRIVATE by default to explicitly only export what is meant
! to be exported by this MODULE.
- interface
- attributes(device) function __fadd_rd(x, y) bind(c, name='__nv_fadd_rd')
- real, intent(in), value :: x, y
- real :: __fadd_rd
- end function
- end interface
- public :: __fadd_rd
-
- interface
- attributes(device) function __fadd_ru(x, y) bind(c, name='__nv_fadd_ru')
- real, intent(in), value :: x, y
- real :: __fadd_ru
- end function
- end interface
- public :: __fadd_ru
end module
diff --git a/flang/module/cudadevice.f90 b/flang/module/cudadevice.f90
index b07f82be6a7243..549263abc19b80 100644
--- a/flang/module/cudadevice.f90
+++ b/flang/module/cudadevice.f90
@@ -72,4 +72,20 @@ attributes(device) subroutine threadfence_system()
end interface
public :: threadfence_system
+ interface
+ attributes(device) function __fadd_rd(x, y) bind(c, name='__nv_fadd_rd')
+ real, intent(in), value :: x, y
+ real :: __fadd_rd
+ end function
+ end interface
+ public :: __fadd_rd
+
+ interface
+ attributes(device) function __fadd_ru(x, y) bind(c, name='__nv_fadd_ru')
+ real, intent(in), value :: x, y
+ real :: __fadd_ru
+ end function
+ end interface
+ public :: __fadd_ru
+
end module
>From 6c9b730f3dee5ea5adfe787efab1c210fbbea444 Mon Sep 17 00:00:00 2001
From: Renaud-K <rkauffmann at nvidia.com>
Date: Wed, 15 Jan 2025 14:20:48 -0800
Subject: [PATCH 2/2] Fixing unneeded use statement
---
flang/module/cudadevice.f90 | 1 -
1 file changed, 1 deletion(-)
diff --git a/flang/module/cudadevice.f90 b/flang/module/cudadevice.f90
index 549263abc19b80..6bb56eb299821c 100644
--- a/flang/module/cudadevice.f90
+++ b/flang/module/cudadevice.f90
@@ -9,7 +9,6 @@
! CUDA Fortran procedures available in device subprogram
module cudadevice
- use __cuda_device, only: __fadd_rd, __fadd_ru
implicit none
! Set PRIVATE by default to explicitly only export what is meant
More information about the flang-commits
mailing list