OpenMP: Enable declare mapper on target data directives
Extends support for OpenMP declare mapper to target enter/exit/data directives, aligning with OpenMP 5.2.
This patch expands the use of ‘declare mapper’ mappers to ‘omp target data’, ‘omp target enter data’, and ‘omp target exit data’ directives in OpenMP. It supports explicit mappings for these directives and adjusts ‘map kind decay’ to align with OpenMP 5.2 semantics, which is important for ‘exit data’ operations. The changes apply to both C and C++.
In Details
This commit extends OpenMP mapper instantiation (c-omp.cc, parser.cc, pt.cc) to handle target enter/exit/data directives. It also implements the OpenMP 5.2 'map kind decay' semantics for these mappers. Note that only explicit mappings are supported, unlike 'omp target' directives.
For Context
OpenMP is a parallel programming API that allows developers to write code that can run on multiple processors or cores simultaneously. The 'declare mapper' directive allows users to define custom data mappings between the host and the target device in OpenMP target regions. The 'target data' directive creates a data environment on the device, while 'target enter data' and 'target exit data' directives copy data to and from the device, respectively.