Commit cd864897 authored by David Rohr's avatar David Rohr

improve debug messages

parent 25d2e7dc
...@@ -288,7 +288,6 @@ int bioem_cuda::selectCudaDevice() ...@@ -288,7 +288,6 @@ int bioem_cuda::selectCudaDevice()
} }
for (int i = 0;i < count;i++) for (int i = 0;i < count;i++)
{ {
printf("CUDA device %d\n", i);
#if CUDA_VERSION > 3010 #if CUDA_VERSION > 3010
size_t free, total; size_t free, total;
#else #else
...@@ -301,11 +300,9 @@ int bioem_cuda::selectCudaDevice() ...@@ -301,11 +300,9 @@ int bioem_cuda::selectCudaDevice()
cuCtxCreate(&tmpContext, 0, tmpDevice); cuCtxCreate(&tmpContext, 0, tmpDevice);
if(cuMemGetInfo(&free, &total)) exit(1); if(cuMemGetInfo(&free, &total)) exit(1);
cuCtxDestroy(tmpContext); cuCtxDestroy(tmpContext);
if (DebugOutput >= 1) printf("Obtained current memory usage for device %d\n", i);
checkCudaErrors(cudaGetDeviceProperties(&deviceProp, i)); checkCudaErrors(cudaGetDeviceProperties(&deviceProp, i));
if (DebugOutput >= 1) printf("Obtained device properties for device %d\n", i);
if (DebugOutput >= 1) printf("%2d: %s (Rev: %d.%d - Mem Avail %lld / %lld)", i, deviceProp.name, deviceProp.major, deviceProp.minor, (long long int) free, (long long int) deviceProp.totalGlobalMem); if (DebugOutput >= 1) printf("CUDA Device %2d: %s (Rev: %d.%d - Mem Avail %lld / %lld)\n", i, deviceProp.name, deviceProp.major, deviceProp.minor, (long long int) free, (long long int) deviceProp.totalGlobalMem);
long long int deviceSpeed = (long long int) deviceProp.multiProcessorCount * (long long int) deviceProp.clockRate * (long long int) deviceProp.warpSize; long long int deviceSpeed = (long long int) deviceProp.multiProcessorCount * (long long int) deviceProp.clockRate * (long long int) deviceProp.warpSize;
if (deviceSpeed > bestDeviceSpeed) if (deviceSpeed > bestDeviceSpeed)
{ {
...@@ -316,24 +313,24 @@ int bioem_cuda::selectCudaDevice() ...@@ -316,24 +313,24 @@ int bioem_cuda::selectCudaDevice()
cudaGetDeviceProperties(&deviceProp ,bestDevice); cudaGetDeviceProperties(&deviceProp ,bestDevice);
if (DebugOutput >= 1) if (DebugOutput >= 2)
{ {
printf("Using CUDA Device %s with Properties:", deviceProp.name); printf("Using CUDA Device %s with Properties:\n", deviceProp.name);
printf("totalGlobalMem = %lld", (unsigned long long int) deviceProp.totalGlobalMem); printf("totalGlobalMem = %lld\n", (unsigned long long int) deviceProp.totalGlobalMem);
printf("sharedMemPerBlock = %lld", (unsigned long long int) deviceProp.sharedMemPerBlock); printf("sharedMemPerBlock = %lld\n", (unsigned long long int) deviceProp.sharedMemPerBlock);
printf("regsPerBlock = %d", deviceProp.regsPerBlock); printf("regsPerBlock = %d\n", deviceProp.regsPerBlock);
printf("warpSize = %d", deviceProp.warpSize); printf("warpSize = %d\n", deviceProp.warpSize);
printf("memPitch = %lld", (unsigned long long int) deviceProp.memPitch); printf("memPitch = %lld\n", (unsigned long long int) deviceProp.memPitch);
printf("maxThreadsPerBlock = %d", deviceProp.maxThreadsPerBlock); printf("maxThreadsPerBlock = %d\n", deviceProp.maxThreadsPerBlock);
printf("maxThreadsDim = %d %d %d", deviceProp.maxThreadsDim[0], deviceProp.maxThreadsDim[1], deviceProp.maxThreadsDim[2]); printf("maxThreadsDim = %d %d %d\n", deviceProp.maxThreadsDim[0], deviceProp.maxThreadsDim[1], deviceProp.maxThreadsDim[2]);
printf("maxGridSize = %d %d %d", deviceProp.maxGridSize[0], deviceProp.maxGridSize[1], deviceProp.maxGridSize[2]); printf("maxGridSize = %d %d %d\n", deviceProp.maxGridSize[0], deviceProp.maxGridSize[1], deviceProp.maxGridSize[2]);
printf("totalConstMem = %lld", (unsigned long long int) deviceProp.totalConstMem); printf("totalConstMem = %lld\n", (unsigned long long int) deviceProp.totalConstMem);
printf("major = %d", deviceProp.major); printf("major = %d\n", deviceProp.major);
printf("minor = %d", deviceProp.minor); printf("minor = %d\n", deviceProp.minor);
printf("clockRate = %d", deviceProp.clockRate); printf("clockRate = %d\n", deviceProp.clockRate);
printf("memoryClockRate = %d", deviceProp.memoryClockRate); printf("memoryClockRate = %d\n", deviceProp.memoryClockRate);
printf("multiProcessorCount = %d", deviceProp.multiProcessorCount); printf("multiProcessorCount = %d\n", deviceProp.multiProcessorCount);
printf("textureAlignment = %lld", (unsigned long long int) deviceProp.textureAlignment); printf("textureAlignment = %lld\n", (unsigned long long int) deviceProp.textureAlignment);
} }
if (DebugOutput >= 1) if (DebugOutput >= 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment