On Thu, Apr 6, 2017, at 02:58 PM, 'SANJAY SRIVALLABH SINGAPURAM' via
Polly Development wrote:
> Hello,
>
> Polly-ACC uses the NVPTX back-end to enable GPU offload, which is to be
> to
> be initialised before being used.
>
> Currently, the onus is on the front-end to initialise the NVPTX passes
> for
> Polly. This would create challenges when Polly's being extended to
> front-ends that don't initialise GPU backends. e.g Julia
> <
https://github.com/JuliaLang/julia/pull/21142>.
>
> I'm looking at bringing this action into Polly and not depend on the
> front-end and have the following questions,
>
> 1. How to tell if backend's already initialised ?
> - Unconditional LLVMInitializeNVPTX*() calls are redundant if the
> back-end is being reinitialised and detrimental if the front-end is
> compile-time sensitive e.g. JIT capable languages like Julia.
> - TargetRegistry::lookupTarget seems to be a possible way.
Did you measure the overhead. I would assume it is close to zero.
> 2. Which LLVMInitiliazeNVPTXTarget*() functions are necessary for
> Polly's usage of the backend ?
Not sure.
> 3. How can Polly access these functions ?
> - These functions are defined and declared at
> <llvm_src>/lib/Target/NVPTX and hence cannot be accessed by
> #including
> header files.
> - A *dirty* workaround would be to #include
> "llvm/../../lib/Target/NVPTX/file.h"
What I am mostly concerned about is what happens if the NVPTX backend is
not linked into LLVM. Does LLVM have a function 'initialize all
targets'?
Best,
Tobias
>
> Please share your thoughts.
>
> Thank You,
> Sanjay
>
> --
> You received this message because you are subscribed to the Google Groups
> "Polly Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
polly-dev+...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.