正在加载图片...
Page8 OpenMPAPI5.0 Runtime Library Routines (continued) nae6eaaa e a teams reeion. d by omp eet wtime integer function omp_get_num_teams doublepredionfunciol o get team num [3.2391 [3.2.33] rt OpenMP event objects,which int omp.gct team_num (void): omp_ful event see217.12的the spe Destroy lock void omp_fulfill_event (omp_event_handle_t event): omp is initial device() Device memory routines int ompinitiadevice(oid); integer nitial_device( void omp_(omp_ok d omp_set_nest lock (omp_nest_lock_ omp. omp get max task priority ( omp_pause_resource [.24] mp_p 7 void omp_unset_ock (omp_ck) id omp_unset_nest_lock (omp_nest_lock_t*lock): e8oppnad ompauour inlok。 ens ona pause_resource_kind)kind ice nu int omp test nest lock (omp nest lock t"lock oeeteseootha ock routines t(hind-md sions,int dst device num Timing routines double precision function omp get_wtime ( 20190 penMP ARB OMP0519-01-OMPS Page 8 OpenMP API 5.0 © 2019 OpenMP ARB OMP0519-01-OMP5 Runtime Library Routines (continued) omp_get_num_teams [3.2.38] [3.2.32] Returns the number of teams in the current teams region, or 1 if called from outside a teams region. C/C++ int omp_get_num_teams (void); For integer function omp_get_num_teams () omp_get_team_num [3.2.39] [3.2.33] Returns the team number of the calling thread. The team number is an integer between 0 and one less than the value returned by omp_get_num_teams, inclusive. C/C++ int omp_get_team_num (void); For integer function omp_get_team_num () omp_is_initial_device [3.2.40] [3.2.34] Returns true if the current task is executing on the host device; otherwise, it returns false. C/C++ int omp_is_initial_device (void); For integer function omp_is_initial_device () omp_get_initial_device [3.2.41] [3.2.35] Returns a device number representing the host device. C/C++ int omp_get_initial_device (void); For integer function omp_get_initial_device() omp_get_max_task_priority [3.2.42] [3.2.36] Returns the maximum value that can be specified in the priority clause. C/C++ int omp_get_max_task_priority (void); For integer function omp_get_max_task_priority () omp_pause_resource [3.2.43] omp_pause_resource_all [3.2.44] Allows the runtime to relinquish resources used by OpenMP on the specified device. Valid kind values include omp_pause_soft and omp_pause_hard. C/C++ int omp_pause_resource ( omp_pause_resource_t kind, int device_num); int omp_pause_resource_all ( omp_pause_resource_t kind); For integer function omp_pause_resource ( kind, device_num) integer (kind=omp_pause_resource_kind) kind integer device_num integer function omp_pause_resource_all (kind) integer (kind=omp_pause_resource_kind) kind Lock routines General-purpose lock routines. Two types of locks are supported: simple locks and nestable locks. A nestable lock can be set multiple times by the same task before being unset; a simple lock cannot be set if it is already owned by the task trying to set it. Initialize lock [3.3.1] [3.3.1] Initialize an OpenMP lock. C/C++ void omp_init_lock (omp_lock_t *lock); void omp_init_nest_lock (omp_nest_lock_t *lock); For subroutine omp_init_lock (svar) integer (kind=omp_lock_kind) svar subroutine omp_init_nest_lock (nvar) integer (kind=omp_nest_lock_kind) nvar Initialize lock with hint [3.3.2] [3.3.2] Initialize an OpenMP lock with a hint. C/C++ void omp_init_lock_with_hint ( omp_lock_t *lock, omp_sync_hint_t hint); void omp_init_nest_lock_with_hint ( omp_nest_lock_t *lock, omp_sync_hint_t hint); For subroutine omp_init_lock_with_hint (svar, hint) integer (kind=omp_lock_kind) svar integer (kind=omp_sync_hint_kind) hint subroutine omp_init_nest_lock_with_hint (nvar, hint) integer (kind=omp_nest_lock_kind) nvar integer (kind=omp_sync_hint_kind) hint hint: [see 2.17.12 in the specification] Destroy lock [3.3.3] [3.3.3] Ensure that the OpenMP lock is uninitialized. C/C++ void omp_destroy_lock (omp_lock_t *lock); void omp_destroy_nest_lock (omp_nest_lock_t *lock); For subroutine omp_destroy_lock (svar) integer (kind=omp_lock_kind) svar subroutine omp_destroy_nest_lock (nvar) integer (kind=omp_nest_lock_kind) nvar Set lock [3.3.4] [3.3.4] Sets an OpenMP lock. The calling task region is suspended until the lock is set. C/C++ void omp_set_lock (omp_lock_t *lock); void omp_set_nest_lock (omp_nest_lock_t *lock); For subroutine omp_set_lock (svar) integer (kind=omp_lock_kind) svar subroutine omp_set_nest_lock (nvar) integer (kind=omp_nest_lock_kind) nvar Unset lock [3.3.5] [3.3.5] Unsets an OpenMP lock. C/C++ void omp_unset_lock (omp_lock_t *lock); void omp_unset_nest_lock (omp_nest_lock_t *lock); For subroutine omp_unset_lock (svar) integer (kind=omp_lock_kind) svar subroutine omp_unset_nest_lock (nvar) integer (kind=omp_nest_lock_kind) nvar Test lock [3.3.6] [3.3.6] Attempt to set an OpenMP lock but do not suspend execution of the task executing the routine. C/C++ int omp_test_lock (omp_lock_t *lock); int omp_test_nest_lock (omp_nest_lock_t *lock); For logical function omp_test_lock (svar) integer (kind=omp_lock_kind) svar integer function omp_test_nest_lock (nvar) integer (kind=omp_nest_lock_kind) nvar Timing routines Timing routines support a portable wall clock timer. These record elapsed time per-thread and are not guaranteed to be globally consistent across all the threads participating in an application. omp_get_wtime [3.4.1] [3.4.1] Returns elapsed wall clock time in seconds. C/C++ double omp_get_wtime (void); For double precision function omp_get_wtime () omp_get_wtick [3.4.2] [3.4.2] Returns the precision of the timer (seconds between ticks) used by omp_get_wtime. C/C++ double omp_get_wtick (void); For double precision function omp_get_wtick () Event routine Event routines support OpenMP event objects, which must be accessed through the routines described in this section or through the detach clause of the task construct. omp_fulfill_event [3.5.1] Fulfills and destroys an OpenMP event. C/C++ void omp_fulfill_event (omp_event_handle_t event); For subroutine omp_fulfill_event (event) integer (kind=omp_event_handle_kind) event Device memory routines These routines support allocation and management of pointers in the data environments of target devices. omp_target_alloc [3.6.1] [3.5.1] Allocates memory in a device data environment. C/C++ void *omp_target_alloc (size_t size, int device_num); omp_target_free [3.6.2] [3.5.2] Frees the device memory allocated by the omp_target_alloc routine. C/C++void omp_target_free (void *device_ptr, int device_num); omp_target_is_present [3.6.3] [3.5.3] Validates whether a host pointer has an associated device buffer on a given device. C/C++int omp_target_is_present (const void *ptr, int device_num); omp_target_memcpy [3.6.4] [3.5.4] Copies memory between any combination of host and device pointers. C/C++ int omp_target_memcpy (void *dst, const void *src, size_t length, size_t dst_offset, size_t src_offset, int dst_device_num, int src_device_num); omp_target_memcpy_rect [3.6.5] [3.5.5] Copies a rectangular subvolume from a multi-dimensional array to another multi-dimensional array. C/C++ int omp_target_memcpy_rect (void * dst, const void * src, size_t element_size, int num_dims, const size_t* volume, const size_t* dst_offsets, const size_t* src_offsets, const size_t* dst_dimensions, const size_t* src_dimensions, int dst_device_num, int src_device_num); omp_target_associate_ptr [3.6.6] [3.5.6] Maps storage to which a device pointer points to storage to which a host pointer points. The device pointer may be the result of a call to omp_target_alloc or have been obtained from implementation-defined runtime routines. C/C++ int omp_target_associate_ptr (const void * host_ptr, const void * device_ptr, size_t size, size_t device_offset, int device_num); omp_target_disassociate_ptr [3.6.7] [3.5.7] Removes the association between a host pointer and a device address on a given device. C/C++ int omp_target_disassociate_ptr (const void * ptr, int device_num); Continued4
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有