Hi, This patch adds the OpenMP runtime routine "omp_target_is_accessible" which was introduced in OpenMP 5.1 (specification section 3.8.4): "The omp_target_is_accessible routine tests whether host memory is accessible from a given device." "This routine returns true if the storage of size bytes starting at the address given by ptr is accessible from device device_num. Otherwise, it returns false." "The value of ptr must be a valid host pointer or NULL (or C_NULL_PTR, for Fortran). 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()." "When called from within a target region the effect is unspecified." Currently, the only way of accessing host memory on a non-host device is via shared memory. This will change with unified shared memory (usm) that was recently submitted but not yet approved/committed. A follow-up patch for omp_target_is_accessible is planned considering usm when available. The current patch handles the basic implementation for C/C++ and Fortran and includes comments pointing to usm. Although not explicitly specified in the OpenMP 5.1 standard, the implemented function returns "true" if the given device_num is equal to "omp_get_num_devices" (i.e. the host) as it is expected that host memory can be accessed from the host device. The patch was tested on x86_64-linux and PowerPC, both with nvptx 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