[Openmp-commits] [PATCH] D14031: [OpenMP] Initial implementation of OpenMP offloading library - libomptarget.
Jonas Hahnfeld via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jan 6 23:53:26 PST 2016
Hahnfeld added a comment.
In http://reviews.llvm.org/D14031#320528, @RaviNarayanaswamy wrote:
> OpenMP says : " If the corresponding list item is not present in the device data environment then no assignment occurs to or from the original list item."
>
> Device.IsInit being false can be one's implementation as the list item not present in the device data environment.
>
> Ravi
Sorry for not directly posting the code in question that I had in mind:
#include <stdio.h>
#pragma omp declare target
int a = 1;
#pragma omp end declare target
int main(int argc, char* argv[]) {
a = 2;
#pragma omp target update to(a)
#pragma omp target
{
printf("a = %d\n", a);
}
return 0;
}
What would the expected result be? However I just noticed that yesterday's simple `init()` didn't change it to `2` because the code and global variables are still only mapped in the first `omp target`...
http://reviews.llvm.org/D14031
More information about the Openmp-commits
mailing list