Hi, This patch adds the OpenMP runtime routine "omp_get_mapped_ptr" which was introduced in OpenMP 5.1 (specification section 3.8.11): "The omp_get_mapped_ptr routine returns the device pointer that is associated with a host pointer for a given device." "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()." "A call to this routine for a pointer that is not NULL (or C_NULL_PTR, for Fortran) and does not have an associated pointer on the given device results in a NULL pointer." "The routine returns NULL (or C_NULL_PTR, for Fortran) if unsuccessful. Otherwise it returns the device pointer, which is ptr if device_num is the value returned by omp_get_initial_device()." Implementation and tests were added for C/C++ and Fortran. There is a small inconvenience considering zero-length arrays as list items of the "target map" construct: it seems that zero-length arrays are not associated correctly there, such that omp_get_mapped_ptr returns NULL instead of the associated device pointer - in contrast to the situation where a device pointer is associated with the host pointer via omp_target_associate_ptr. However, the result for omp_get_mapped_ptr is consistent with omp_target_is_present (which returns 0, i.e. "not present") in this situation. The patch was tested on x86_64-linux with nvptx and amdgcn offloading. All with no regressions. Marcel ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955