# CUDA1: Introduction to cuda programming model
###### tags: `CUDA` `Multithread`

**gid = tid + blockIdx.x * blockDim.x**
## Memory transfer between host and device


Due to memory is seperated phisically, you have to transfer memory to times when using cuda.
### How?
#### 1. Memory Copy
```c++=
cudaMemCpy (destination ptr, sourse ptr,
size in byte, direction )
```
Direction
Host to device – cudamemcpyhtod
Device to host – cudamemcpydtoh
Device to device - cudamemcpydtod
#### 2. Memory management

## Important concept: