[CUDA] Device Properties 디바이스 정보 확인
Computer Vision 2026. 4. 29. 14:26 |반응형
CUDA 디바이스 정보를 확인해 보자.
helper_cuda.h
0.03MB
helper_string.h
0.01MB
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include "helper_cuda.h"
#define _1MB (1024 * 1024)
int main()
{
int ngpus;
cudaGetDeviceCount(&ngpus);
for (int i = 0; i < ngpus; i++) {
cudaDeviceProp prop;
cudaGetDeviceProperties(&prop, i);
size_t a;
printf("GPU %d: %s\n", i, prop.name);
printf("\tCompute capability: %d.%d\n", prop.major, prop.minor);
printf("\tNumber of multiprocessors: %d\n", prop.multiProcessorCount);
printf("\tNumber of CUDA cores: %d\n", prop.multiProcessorCount * _ConvertSMVer2Cores(prop.major, prop.minor));
printf("\tGlobal memory: %llu MB\n", prop.totalGlobalMem / _1MB);
printf("\tShared memory per block: %llu KB\n", prop.sharedMemPerBlock / 1024);
printf("\tRegisters per block: %d\n", prop.regsPerBlock);
printf("\tWarp size: %d\n", prop.warpSize);
printf("\tMax threads per block: %d\n", prop.maxThreadsPerBlock);
printf("\tMax threads per multiprocessor: %d\n", prop.maxThreadsPerMultiProcessor);
}
return 0;
}

반응형
'Computer Vision' 카테고리의 다른 글
| [CUDA] C++ with CUDA (0) | 2026.04.28 |
|---|---|
| [OpenCV] OpenCV and memcpy (feat.CUDA) (0) | 2026.04.27 |
| [OpenCV] CPU, GPU Image Processing Comparison 이미지 처리 속도 비교 (0) | 2026.04.26 |
| [OpenCV] OpenCV with CUDA Build (0) | 2026.04.26 |
| [OpenCV] Image Resize 영상 리사이즈 (feat.LogLevel) (0) | 2026.04.23 |
