Hi,<br>I am trying to convert a simple CUDA program to LLVM IR using clang 3.0. The program is as follows,<br>#include<stdio.h><br>#nclude<clang/test/SemaCUDA/cuda.h><br><br>__global__ void kernfunc(int *a)<br>
{<br>*a=threadIdx.x+blockIdx.x*blockDim.x;<br>
}<br><br>int main()<br>{<br>int *h_a,*d_a,n; <br> <br>n=sizeof(int);<br>h_a=(int*)malloc(n);<br>*h_a=5;<br><br>cudaMalloc((void*)&d_a,n);<br>cudaMemcpy(d_a,h_a,n,cudaMemcpyHostToDevice);<br>
kernelfunc<<<1,1>>>(d_a);<br>cudaMemcpy(h_a,d_a,n,cudaMemcpyDeviceToHost);<br><br>printf("%d",*h_a);<br>return 0;<br>}<br><br><br>What additional header files should be included? What part of the code is currently not supported by clang 3.0?<br>
Thank you:)<br><br><br><br>