https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100059
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
With GCN it does work:
i=5: A=5, B=6, C=7
i=5: A=6, B=8, C=10
i=5: A=7, B=10, C=13
And the follow testcase prints:
* with nvptx:
42, 5, 0, 0
* with amdgcn:
5, 42, 43, 44
This something must be reversed ...
//-----------------------------------------------
int i = 0, a[3];
void update () {
i = 5; a[0] = 42; a[1] = 43; a[2] = 44;
}
#pragma omp declare target link(i,a)
#pragma omp declare target to(update)
int main () {
#pragma omp target map(from: i, a)
update();
__builtin_printf("%d, %d, %d, %d\n", i,a[0],a[1],a[2]);
return 0;
}