This project is read-only.

is this a bug?

Aug 28, 2012 at 9:21 AM
Edited Aug 28, 2012 at 9:38 AM

Debug.WriteLine("New Thread   tid:  %i,%i,%i", thread.threadIdx.x, thread.threadIdx.y, thread.threadIdx.z);

Debug.WriteLine("             bid:  %i,%i,%i", thread.blockIdx.x, thread.blockIdx.y, thread.blockIdx.z);

Debug.WriteLine("            gdim:  %i,%i,%i", thread.gridDim.x, thread.gridDim.y, thread.gridDim.z);

Debug.WriteLine("            bdim:  %i,%i,%i", thread.blockDim.x, thread.blockDim.y, thread.blockDim.z);

Debug.WriteLine("            warp:   %i", thread.warpSize);  //CudafyCompileException 'thread' doesn't exist



this is the exception:


Compilation error: CUDAFYSOURCETEMP.cuZ:/Projects/cudafytest1/cudafytest1/bin/Debug/ error: identifier "thread" is undefined
1 error detected in the compilation of "C:/Users/Matt/AppData/Local/Temp/tmpxft_00002070_00000000-6_CUDAFYSOURCETEMP.cpp4.ii".


this is the generated code:

printf("New Thread   tid:  %i,%i,%i\n",threadIdx.x, threadIdx.y, threadIdx.z);

printf("             bid:  %i,%i,%i\n",blockIdx.x, blockIdx.y, blockIdx.z); 

printf("            gdim:  %i,%i,%i\n",gridDim.x, gridDim.y, gridDim.z); 

printf("            bdim:  %i,%i,%i\n",blockDim.x, blockDim.y, blockDim.z); 

printf("            warp:   %i\n",thread.warpSize);


am i doing something wrong?   how do i get the warpsize as in GThread.warpSize


i'm using revision 10931

Aug 28, 2012 at 11:55 AM

Yes that is a unfortunately bug. A fix has been committed to the sources and later next month when CUDA 5 is officially released the fix will be in the next version of CUDAfy. As a work around you can check the warp size in the device properties and pass this into your kernel. 

Aug 28, 2012 at 10:29 PM
Edited Aug 28, 2012 at 10:46 PM

Glad I could help!  Thanks for the fix!  

I might have found another bug.  When I reference v1.90  my app works, but if i switch to v1.10beta then during the Cudafy() call, it just sits there consuming cpu cycles indefinitely.  If you like I can set you up with a desktop share so you can see what I'm doing to reproduce it?

Aug 29, 2012 at 8:35 AM

Thanks again. Some issues migrating to CUDA 5. V1.10 has been replaced with a fixed version.