CUDA
Main-Features
- C/C++ with extensions
- Heterogeneous programming model
- Host(CPU) => Device(GPU) Cuda kernel function
- Parallel kernel
CUDA Device and Threads
- Device(GPU)
- Has access to DRAM (device memory)
- Runs many threads in parallel
- GPU threads are extremely lightweight
- GPU needs 1000s of threads for full efficiency
Grid, Block, Thread
1 Kernel = 1 Grid
- C Language Extention
- <<<BlocksPerGrid, threadsPerBlock>>>
- dim3 blcoksPerGrid(65535, 65535, 1)
- dim3 threadsPerBlock(1024, 1,1)
- <<<blocksPerGrid, ThreadsPerBlock>>>>
Codes
- Device pointers point to GPU memory
- Host pointers point to CPU memroy
- cudaMalloc(), cudaFree(), cudaMemcpy()
'프로그래밍' 카테고리의 다른 글
Cygwin에서 C Drive 찾기 (0) | 2020.06.11 |
---|---|
C Matrix multiplication with dynamic size(메트릭스 연산) (0) | 2020.06.10 |
Cygwin에서 패키지 다운 받기(gcc, ...) (0) | 2020.06.10 |
[알고리즘] 어린왕자 10004 파이썬 풀이 (0) | 2020.05.16 |
[알고리즘] 톱니바퀴 14891 파이썬 풀이 (0) | 2020.05.10 |