Page 1 of 1

mapped for the extent of the region

Posted: Wed Aug 05, 2015 3:41 pm
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