This patch adds: // New functions to set/get the current default async queue void acc_set_default_async (int); int acc_get_default_async (void); and _async versions of a few existing API functions: void acc_copyin_async (void *, size_t, int); void acc_create_async (void *, size_t, int); void acc_copyout_async (void *, size_t, int); void acc_delete_async (void *, size_t, int); void acc_update_device_async (void *, size_t, int); void acc_update_self_async (void *, size_t, int); void acc_memcpy_to_device_async (void *, void *, size_t, int); void acc_memcpy_from_device_async (void *, void *, size_t, int); These implement part of the additional requirements for OpenACC 2.5 Tested and committed to gomp-4_0-branch. Chung-Lin 2017-02-13 Chung-Lin Tang libgomp/ * oacc-async.c (acc_get_default_async): New API function. (acc_set_default_async): Likewise. * oacc-init.c (): * oacc-int.h (struct goacc_thread): Add default_async field. * oacc-mem.c (memcpy_tofrom_device): New function, combined from acc_memcpy_to/from_device functions, now with async parameter. (acc_memcpy_to_device): Modify to use memcpy_tofrom_device. (acc_memcpy_from_device): Likewise. (acc_memcpy_to_device_async): New API function. (acc_memcpy_from_device_async): Likewise. (present_create_copy): Add async parameter. (acc_create): Adjust present_create_copy call. (acc_copyin): Likewise. (acc_present_or_create): Likewise. (acc_present_or_copyin): Likewise. (acc_create_async): New API function. (acc_copyin_async): New API function. (delete_copyout): Add async parameter. (acc_delete): Adjust delete_copyout call. (acc_copyout): Likewise. (acc_delete_async): New API function. (acc_copyout_async): Likewise. (update_dev_host): Add async parameter. (acc_update_device): Adjust update_dev_host call. (acc_update_self): Likewise. (acc_update_device_async): New API function. (acc_update_self_async): Likewise. * oacc-plugin.c (GOMP_PLUGIN_acc_thread_default_async): New function. * oacc-plugin.h (GOMP_PLUGIN_acc_thread_default_async): Declare. * 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. * testsuite/libgomp.oacc-c-c++-common/asyncwait-2.c: New test. * testsuite/libgomp.oacc-c-c++-common/lib-94.c: New test. * testsuite/libgomp.oacc-c-c++-common/lib-95.c: New test. * testsuite/libgomp.oacc-fortran/lib-16.f90: New test. include/ * gomp-constants.h (GOMP_ASYNC_DEFAULT): Define.