[PATCH] D17877: [OpenMP] Base support for target directive codegen on NVPTX device.

Arpith Jacob via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 4 14:02:52 PST 2016


arpith-jacob marked 15 inline comments as done.

================
Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:348
@@ +347,2 @@
+  initializeEnvironment();
+}
----------------
This function will also handle global variables from the 'declare target' construct in the future.

void CGOpenMPRuntimeNVPTX::createOffloadEntry(llvm::Constant *ID,
                                              llvm::Constant *Addr,
                                              uint64_t Size) {
  auto *F = dyn_cast<llvm::Function>(Addr);
  // TODO: Add support for global variables on the device after declare target
  // support.
  if (!F)
    return;

================
Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:348
@@ +347,2 @@
+  initializeEnvironment();
+}
----------------
arpith-jacob wrote:
> This function will also handle global variables from the 'declare target' construct in the future.
> 
> void CGOpenMPRuntimeNVPTX::createOffloadEntry(llvm::Constant *ID,
>                                               llvm::Constant *Addr,
>                                               uint64_t Size) {
>   auto *F = dyn_cast<llvm::Function>(Addr);
>   // TODO: Add support for global variables on the device after declare target
>   // support.
>   if (!F)
>     return;
> What about exceptions? Do you plan to support them? If yes, add tests for classes with constructors/destructors and exceptions

This backend does not support exceptions.  We plan to send a separate patch that will selectively deactivate exceptions in target regions generated for the GPU. 


http://reviews.llvm.org/D17877





More information about the cfe-commits mailing list