I am working on DSL framework which help to generate OpenACC codes.
I am particulary having problem in accessing a global variables inside the OpenACC kernels which are declared in other files
for example consider a scenario::
- main file: contain few global variables (some constants some may not be)
some value will be assigned to non-constants global inside main function and then some X function will be called which will contain a for loop with OpenACC loop constructs - header file: this will contain extern declarations for globals and some functions which will be called from main to assign them values. This header file will also contain include statements for files which contain OpenACC kernels (this is like a master kernel file)
- other files where functions contain loops with OpenACC constructs
earlier this used to work but recent changes resulting in compilation error for those global variables with “undefined reference error”
so what is the correct way to handle such global variables in OpenACC, any #pragma acc constructs are required
Also please explain how to handle Module variables in Fortran (both constants and variables)