#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
#include <iostream>
int main()
{
int count;
cudaDeviceProp info;
cudaGetDeviceCount( &count );
cudaGetDeviceProperties(&info, 0);//因为我知道count=1了:D,注意ID从0开始,如果大于 一,用个循环
printf("gpu count = %d\n",count);
printf("my device's info:\n");
printf("asyncEngineCount = %d\n ",info.asyncEngineCount);
printf( " canMapHostMemory = %d\n", info.canMapHostMemory);
printf( " clockRate = %d\n", info.clockRate);
printf( " computeMode = %d\n", info.computeMode);
printf( " concurrentKernels = %d\n", info.concurrentKernels);
printf( " concurrentManagedAccess = %d\n", info.concurrentManagedAccess);
printf( " deviceOverlap = %d\n", info.deviceOverlap);
printf( " globalL1CacheSupported = %d\n", info.globalL1CacheSupported);
printf( " isMultiGpuBoard = %d\n", info.isMultiGpuBoard);
printf( " l2CacheSize = %d\n", info.l2CacheSize);
printf( " maxGridSize = %d\n", info.maxGridSize);
printf( " maxSurface1D = %d\n", info.maxSurface1D);
printf( " maxSurface1DLayered = %d\n", info.maxSurface1DLayered);
printf( " maxSurface2D = %d\n", info.maxSurface2D);
printf( " maxSurface2DLayered = %d\n", info.maxSurface2DLayered);
printf( " maxSurface3D = %d\n", info.maxSurface3D);
printf( " maxSurfaceCubemap = %d\n", info.maxSurfaceCubemap);
printf( " maxSurfaceCubemapLayered = %d\n", info.maxSurfaceCubemapLayered);
printf( " maxTexture1D = %d\n", info.maxTexture1D);
printf( " maxThreadsPerBlock = %d\n", info.maxThreadsPerBlock);
printf( " warpSize = %d\n", info.warpSize);
getchar();
return 0;
}
CUDA-CODE3-查询GPU设备属性
最新推荐文章于 2023-11-19 20:08:09 发布