Hi there,
We have an application which consists of a C# GUI and an unmanaged dll containing the CUDA code. I have been experimenting with the printf statement for compute 2.0 capable cards and it works some of the time, but mostly not.
So I just wanted to know if printf is supported in kernels in dlls when said dll is used by a C# GUI in VS2008 (or something else for that matter)?
As an example, this code works in a kernel:
for(int i = 0; i < 200; i++)
{
// Calculate distance
double3 tempCenter2 = (someDataStructure[i].center);
float diffX2 = (float)(someDataStructure[i].center.x);
if(blockIdx.x == 0 && blockIdx.y == 0 && i > 0)
{
printf("Center @ %i (%3.3f, %3.3f, %3.3f)\t", i, tempCenter2.x, tempCenter2.y, tempCenter2.z);
//printf("diffX2 : %6.2lf\t", diffX2);
printf("\n");
}
}
but this does not
for(int i = 0; i < 200; i++)
{
// Calculate distance
double3 tempCenter2 = (someDataStructure[i].center);
float diffX2 = (float)(someDataStructure[i].center.x);
if(blockIdx.x == 0 && blockIdx.y == 0 && i > 0)
{
printf("Center @ %i (%3.3f, %3.3f, %3.3f)\t", i, tempCenter2.x, tempCenter2.y, tempCenter2.z);
printf("diffX2 : %6.2lf\t", diffX2);
printf("\n");
}
}
Any advice is welcome.
Thanks,
Claus