CUDA-CODE3-查询GPU设备属性

#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;
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值