I would like to write an class using OpenACC directives and compile it to a shared library, then write an execute file to instantiate this class, and do parallel computing, here are some problems that i’ve met:
- I added an class named A in an already existing library -> this class use OpenACC directives while the other codes in this library don’t; This library will be used for many other codes as a link library.
=> If i understand correctly, if i want to compile this class successfully, i should add -nordc flag.
=> But i also want to define an OpenACC routine function in class A, which will be used in other codes
After the first step, i wrote another execute code file, in which class A is instantiated and used for offload computing. i compiled it
But when i ran this execution, i found that the result is not correct, a value that is copied into gpu device, and calculated by OpenACC routine function, updated to host, always equals to 0, which means that there is an unknown problem in my program
I guess this error may be caused by -nordc,
And my question is, if -nordc is used for compiling a shared library while in this library there is an acc routine function defined, can it works correctly, in other words, can i use this library in other code successfully?