[llvm] r194760 - Add addrspacecast instruction.

Jeroen Ketema j.ketema at imperial.ac.uk
Tue Nov 26 15:56:25 PST 2013


Hi Michele,

I think the code I give below is actually illegal. Quoting from the CUDA C programming guide (v5.5), section E.2.4.1:

"__shared__ variables cannot have an initialization as part of their declaration."

Hence, I should have written:

__shared__ int* p;
p = A;

If I make this change I no longer get an assertion failure.

Still I would expect the compiler not to raise an assertion, but give an error.

Regards,

 Jeroen

On Nov 26, 2013, at 11:38 AM, Jeroen Ketema <j.ketema at imperial.ac.uk> wrote:

> 
> Hi Michele,
> 
>> I removed the illegal example and fixed the problem still present.
>> Let me know if the new version of the patch has other issues.
> 
> 
> All of my test cases now pass except for one CUDA test case:
> 
> __device__ int* bar(int* p) {
>  return p;
> }
> 
> __global__ void foo() {
>  __shared__ int A[10];
>  __shared__ int* p = A;
>  bar(p);
> }
> 
> Regards,
> 
> Jeroen
> 





More information about the llvm-commits mailing list