File: acc-interface.patch

package info (click to toggle)
atlas-ecmwf 0.43.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,108 kB
  • sloc: cpp: 140,552; f90: 17,572; sh: 1,194; python: 379; makefile: 65
file content (53 lines) | stat: -rw-r--r-- 1,557 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Description: Add interfaces missing  in gfortran 13
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2024-11-19
Forwarded: no


--- a/src/atlas_acc_support/atlas_acc.F90
+++ b/src/atlas_acc_support/atlas_acc.F90
@@ -1,6 +1,7 @@
 module atlas_acc
 use openacc
 implicit none
+
 private
 
 public :: atlas_acc_get_num_devices
@@ -10,7 +11,28 @@
 public :: atlas_acc_get_device_type
 public :: atlas_acc_deviceptr
 
+! These should be coming from openacc but some issue with gfortran 13
+
+interface
+   type(c_ptr) function acc_deviceptr (data_arg) bind(C)
+     use iso_c_binding, only: c_ptr
+     type(*), dimension(*) :: data_arg
+   end function acc_deviceptr
+
+   subroutine acc_map_data (data_arg, data_dev, bytes) bind(C)
+     use iso_c_binding, only: c_ptr, c_size_t
+     type(*), dimension(*) :: data_arg
+     type(c_ptr), value :: data_dev
+     integer(c_size_t), value :: bytes
+   end subroutine acc_map_data
+
+   subroutine acc_unmap_data (data_arg) bind(C)
+     type(*), dimension(*) :: data_arg
+   end subroutine acc_unmap_data
+end interface
+
 contains
+  
 
 function atlas_acc_compiler_id() bind(C,name="atlas_acc_compiler_id") result(compiler_id)
   use, intrinsic :: iso_c_binding, only : c_int
@@ -61,6 +83,7 @@
 
 function atlas_acc_deviceptr(data_arg) bind(C,name="atlas_acc_deviceptr") result(deviceptr)
   use, intrinsic :: iso_c_binding, only : c_ptr
+  ! use openacc, only : acc_deviceptr not in openacc
   type(*), dimension(*) :: data_arg
   type(c_ptr):: deviceptr
   deviceptr = acc_deviceptr(data_arg)