Code: Select all
void foo(int* a){
#pragma omp target map(a)
{
a++;
}
}
Does this mapping mean mapping the value of a pointer - address 'a', mapping value pointed by 'a' or something different?
C/C++ examples only pass pointers together with array section but there is no explicit requirement that pointers need to be mapped with array sections.
The same problem occurs when mapping arrays as pointers:
Code: Select all
void foo(int* a){
#pragma omp target map(a)
{
//Can we write 'a[0] = 1' and expect assignment of 1 to the first element of tab?
//Can we write a++ and expect 'a' to point to the second element after exiting target region?
}
}
void bar(){
int tab[100];
foo(tab);
}