mapped for the extent of the region

Comments and discussion of the 4.1 OpenMP Draft specifications. Comment period ends September 30, 2015. See to download the specifications. (Read Only)
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help:
Posts: 73
Joined: Mon Jul 27, 2015 4:50 pm

mapped for the extent of the region

Post by fewl9012 »

section 2.10.1, target data construct, p95:4, "Variables are mapped for the extent of the region, according to any data-mapping clause, ..."
This is a newly-added line, and while this was true in 4.0, it is not true in 4.1.

Code: Select all

// ... assume 'a' is not present in the device data environment
#pragma omp target data map(to:a[0:100])
{   // new 'a' created in device data environment
    // reference count = 1
    // device 'a' assigned from host 'a'
    #pragma omp target exit data map(from:a[0:100])
    // reference count decremented to zero
    // host 'a' assigned from device 'a'
    // 'a' removed from device data environment
    // at this point, 'a' is NOT mapped, but it's still within the extent of the region
}// since 'a' is not present, nothing happens here