[4/7,OpenACC,libgomp,v5,stage1] Async re-work, acc_get/set_default_async API interface parts

Message ID be9368c3-cbc0-0848-c91a-ad04b771c7d7@mentor.com
State New
Headers show
Series
  • Async re-work
Related show

Commit Message

Chung-Lin Tang Jan. 22, 2019, 2:53 p.m.
Hi Thomas,
This patch adds the OpenACC 2.5 new APIs of acc_get_default_async/acc_set_default_async,
contained are the modifications for Fortran in libgomp/openacc.f90, libgomp/openacc_lib.h.

Not much is changed since the last submission of this part, except that the libgomp.map
part is moved to be included here, since its related to the exported API additions.

Thanks,
Chung-Lin

     * openacc.h (acc_async_t): Add acc_async_default enum.
     (acc_set_default_async): Declare API function.
     (acc_get_default_async): Likewise.

     * libgomp.map (OACC_2.5): Add acc_get_default_async,
     acc_get_default_async_h_, acc_set_default_async, and
     acc_set_default_async_h_.

     * openacc.f90 (acc_async_default): Declare.
     (acc_set_default_async): Likewise.
     (acc_get_default_async): Likewise.
      * openacc_lib.h (acc_async_default): Declare.
      (acc_set_default_async): Likewise.
     (acc_get_default_async): Likewise.

Patch

Index: libgomp/openacc.h
===================================================================
--- libgomp/openacc.h	(revision 268142)
+++ libgomp/openacc.h	(working copy)
@@ -63,6 +63,7 @@  typedef enum acc_device_t {
 
 typedef enum acc_async_t {
   /* Keep in sync with include/gomp-constants.h.  */
+  acc_async_default = 0,
   acc_async_noval = -1,
   acc_async_sync  = -2
 } acc_async_t;
@@ -72,6 +73,8 @@  void acc_set_device_type (acc_device_t) __GOACC_NO
 acc_device_t acc_get_device_type (void) __GOACC_NOTHROW;
 void acc_set_device_num (int, acc_device_t) __GOACC_NOTHROW;
 int acc_get_device_num (acc_device_t) __GOACC_NOTHROW;
+void acc_set_default_async (int) __GOACC_NOTHROW;
+int acc_get_default_async (void) __GOACC_NOTHROW;
 int acc_async_test (int) __GOACC_NOTHROW;
 int acc_async_test_all (void) __GOACC_NOTHROW;
 void acc_wait (int) __GOACC_NOTHROW;
Index: libgomp/libgomp.map
===================================================================
--- libgomp/libgomp.map	(revision 268142)
+++ libgomp/libgomp.map	(working copy)
@@ -464,8 +464,12 @@  OACC_2.5 {
 	acc_delete_finalize_async_32_h_;
 	acc_delete_finalize_async_64_h_;
 	acc_delete_finalize_async_array_h_;
+	acc_get_default_async;
+	acc_get_default_async_h_;
 	acc_memcpy_from_device_async;
 	acc_memcpy_to_device_async;
+	acc_set_default_async;
+	acc_set_default_async_h_;
 	acc_update_device_async;
 	acc_update_device_async_32_h_;
 	acc_update_device_async_64_h_;
Index: libgomp/openacc.f90
===================================================================
--- libgomp/openacc.f90	(revision 268142)
+++ libgomp/openacc.f90	(working copy)
@@ -51,9 +51,10 @@  module openacc_kinds
 
   integer, parameter :: acc_handle_kind = int32
 
-  public :: acc_async_noval, acc_async_sync
+  public :: acc_async_default, acc_async_noval, acc_async_sync
 
   ! Keep in sync with include/gomp-constants.h.
+  integer (acc_handle_kind), parameter :: acc_async_default = 0
   integer (acc_handle_kind), parameter :: acc_async_noval = -1
   integer (acc_handle_kind), parameter :: acc_async_sync = -2
 
@@ -92,6 +93,16 @@  module openacc_internal
       integer (acc_device_kind) d
     end function
 
+    subroutine acc_set_default_async_h (a)
+      import
+      integer a
+    end subroutine
+
+    function acc_get_default_async_h ()
+      import
+      integer acc_get_default_async_h
+    end function
+
     function acc_async_test_h (a)
       logical acc_async_test_h
       integer a
@@ -720,6 +731,7 @@  module openacc
 
   public :: acc_get_num_devices, acc_set_device_type, acc_get_device_type
   public :: acc_set_device_num, acc_get_device_num, acc_async_test
+  public :: acc_set_default_async, acc_get_default_async
   public :: acc_async_test_all
   public :: acc_wait, acc_async_wait, acc_wait_async
   public :: acc_wait_all, acc_async_wait_all, acc_wait_all_async
@@ -752,6 +764,14 @@  module openacc
     procedure :: acc_get_device_num_h
   end interface
 
+  interface acc_set_default_async
+    procedure :: acc_set_default_async_h
+  end interface
+
+  interface acc_get_default_async
+    procedure :: acc_get_default_async_h
+  end interface
+
   interface acc_async_test
     procedure :: acc_async_test_h
   end interface
Index: libgomp/openacc_lib.h
===================================================================
--- libgomp/openacc_lib.h	(revision 268142)
+++ libgomp/openacc_lib.h	(working copy)
@@ -46,6 +46,7 @@ 
       integer, parameter :: acc_handle_kind = 4
 
 !     Keep in sync with include/gomp-constants.h.
+      integer (acc_handle_kind), parameter :: acc_async_default = 0
       integer (acc_handle_kind), parameter :: acc_async_noval = -1
       integer (acc_handle_kind), parameter :: acc_async_sync = -2
 
@@ -89,6 +90,18 @@ 
         end function
       end interface
 
+      interface acc_set_default_async
+        subroutine acc_set_default_async_h (a)
+          integer a
+        end subroutine
+      end interface
+
+      interface acc_get_default_async
+        function acc_get_default_async_h ()
+          integer acc_get_default_async_h
+        end function
+      end interface
+
       interface acc_async_test
         function acc_async_test_h (a)
           logical acc_async_test_h