http://llvm.org/bugs/show_bug.cgi?id=20886

            Bug ID: 20886
           Summary: Clang CUDA - doesn't enforce target matching for
                    method calls
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

$ cat method-target-mismatch.cu 
struct S {
  void method() {}
};

__attribute__((device)) void foo() {
  S s;
  s.method();
}

When compiled with nvcc:

$ /usr/local/cuda/bin/nvcc --verbose  -I/usr/local/cuda/include -m64
--gpu-architecture=compute_35 -c method-target-mismatch.cu
...

method-target-mismatch.cu(7): error: calling a __host__ function("S::method")
from a __device__ function("foo") is not allowed


When compiled with Clang (trunk):

$ $LLVMSVN/clang -cc1  -x cuda   method-target-mismatch.cu
$

No error generated.

Clang *does* generate an error when the mismatch is for a function (not
method), or a special method like default constructor.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to