HOME
| OPENMP API Specification: Version 5.1 November 2020

3.8.10  omp_target_disassociate_ptr

Summary The omp_target_disassociate_ptr removes the associated pointer for a given device from a host pointer.

Format

SVG-Viewer needed.

 

 
int omp_target_disassociate_ptr(const void *ptr, int device_num);  

SVG-Viewer needed.

SVG-Viewer needed.

 

 
integer(c_int) function omp_target_disassociate_ptr(ptr, & 
  device_num) bind(c) 
use, intrinsic :: iso_c_binding, only : c_ptr, c_int 
type(c_ptr), value :: ptr 
integer(c_int), value :: device_num  

SVG-Viewer needed.

Constraints on Arguments The device_num argument must be greater than or equal to zero and less than or equal to the result of omp_get_num_devices().

Binding The binding task set for an omp_target_disassociate_ptr region is the generating task, which is the target task generated by the call to the omp_target_disassociate_ptr routine.

Effect The omp_target_disassociate_ptr removes the associated device data on device device_num from the presence table for host pointer ptr. A call to this routine on a pointer that is not NULL (or C_NULL_PTR, for Fortran) and does not have associated data on the given device results in unspecified behavior. The reference count of the mapping is reduced to zero, regardless of its current value.

The omp_target_disassociate_ptr routine executes as if part of a target task that is generated by the call to the routine and that is an included task.

The routine returns zero if successful. Otherwise it returns a non-zero value.

After a call to omp_target_disassociate_ptr, the contents of the device buffer are invalidated.

SVG-Viewer needed.

The omp_target_disassociate_ptr routine requires an explicit interface and so might not be provided in omp_lib.h.

SVG-Viewer needed.

Execution Model Events The target-data-disassociate event occurs before a thread initiates a device pointer disassociation on a target device.

Tool Callbacks A thread dispatches a registered ompt_callback_target_data_op callback, or a registered ompt_callback_target_data_op_emi callback with ompt_scope_beginend as its endpoint argument for each occurrence of a target-data-disassociate event in that thread. These callbacks have type signature ompt_callback_target_data_op_t or ompt_callback_target_data_op_emi_t, respectively.

Restrictions Restrictions to the omp_target_disassociate_ptr routine are as follows.

Cross References