Print limits on CUDA devices

[ROCm/hip commit: 43635f51dc]
这个提交包含在:
Ben Sander
2016-12-16 08:55:11 -06:00
父节点 70f125f2a8
当前提交 fcdaa05a4d
@@ -63,6 +63,14 @@ double bytesToGB(size_t s)
return (double)s / (1024.0*1024.0*1024.0); return (double)s / (1024.0*1024.0*1024.0);
} }
#define printLimit(w1, limit, units) \
{\
size_t val;\
cudaDeviceGetLimit(&val, limit);\
std::cout << setw(w1) << #limit": " << val << " " << units << std::endl;\
}
void printDeviceProp (int deviceId) void printDeviceProp (int deviceId)
{ {
using namespace std; using namespace std;
@@ -144,6 +152,17 @@ void printDeviceProp (int deviceId)
cout << endl; cout << endl;
#ifdef __HIP_PLATFORM_NVCC__
// Limits:
cout << endl;
printLimit(w1, cudaLimitStackSize, "bytes/thread");
printLimit(w1, cudaLimitPrintfFifoSize, "bytes/device");
printLimit(w1, cudaLimitMallocHeapSize, "bytes/device");
printLimit(w1, cudaLimitDevRuntimeSyncDepth, "grids");
printLimit(w1, cudaLimitDevRuntimePendingLaunchCount, "launches");
#endif
cout << endl; cout << endl;