- Hands-On GPU:Accelerated Computer Vision with OpenCV and CUDA
- Bhaumik Vaidya
- 207字
- 2021-08-13 15:48:22
General device properties
cudaDeviceProp provides several properties that can be used to identify the device and the versions being used. It provides the name property that returns the name of the device as a string. We can also get a version of the driver and the runtime engine the device is using by querying cudaDriverGetVersion and cudaRuntimeGetVersion properties. Sometimes, if you have more than one device, you want to use the device that has more multiprocessors. The multiProcessorCount property returns the count of the number of multiprocessors on the device. The speed of the GPU in terms of clock rate can be fetched by using the clockRate property. It returns clock rate in Khz. The following code snippet shows how to use these properties from the CUDA program:
cudaDeviceProp device_Property;
cudaGetDeviceProperties(&device_Property, device);
printf("\nDevice %d: \"%s\"\n", device, device_Property.name);
cudaDriverGetVersion(&driver_Version);
cudaRuntimeGetVersion(&runtime_Version);
printf(" CUDA Driver Version / Runtime Version %d.%d / %d.%d\n", driver_Version / 1000, (driver_Version % 100) / 10, runtime_Version / 1000, (runtime_Version % 100) / 10);
printf( " Total amount of global memory: %.0f MBytes (%llu bytes)\n",
(float)device_Property.totalGlobalMem / 1048576.0f, (unsigned long long) device_Property.totalGlobalMem);
printf(" (%2d) Multiprocessors", device_Property.multiProcessorCount );
printf(" GPU Max Clock rate: %.0f MHz (%0.2f GHz)\n", device_Property.clockRate * 1e-3f, device_Property.clockRate * 1e-6f);
- Spring 5企業(yè)級開發(fā)實戰(zhàn)
- Objective-C應用開發(fā)全程實錄
- JavaScript 從入門到項目實踐(超值版)
- SQL Server 2016從入門到精通(視頻教學超值版)
- JavaScript Unlocked
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- Python編程從0到1(視頻教學版)
- C和C++游戲趣味編程
- NGINX Cookbook
- C#開發(fā)案例精粹
- 遠方:兩位持續(xù)創(chuàng)業(yè)者的點滴思考
- Scratch從入門到精通
- MySQL數(shù)據(jù)庫應用實戰(zhàn)教程(慕課版)
- AutoCAD基礎教程
- SQL Server 2012 數(shù)據(jù)庫應用教程(第3版)