[PATCH] D12241: [CUDA] Change initializer for CUDA device code based on CUDA documentation.
    Jingyue Wu via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Aug 21 10:03:12 PDT 2015
    
    
  
jingyue added a comment.
Looks good in general.
> According to CUDA documentation, global variable with device,
global variables
> externally initialized. For shared variable, its value might be kept
>  by GPU Memory among different kernel invocation and it is not possible
>  to initialize it. So change shared variable it to undefined value.
Just say: __shared__ variables cannot have an initialization as part of their declaration. Whether being kept across invocations is undefined.
================
Comment at: lib/CodeGen/CodeGenModule.cpp:1998
@@ +1997,3 @@
+    if (InitExpr)
+      ErrorUnsupported(D, "static initializer");
+    Init = llvm::UndefValue::get(getTypes().ConvertType(ASTTy));
----------------
Then, this should be a hard error instead of an unsupported feature, right? ErrorUnsupported sounds like we want to support it later. 
http://reviews.llvm.org/D12241
    
    
More information about the llvm-commits
mailing list