cuda中,cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind)第三个参数有什么用呢?下面是代码:
1 #define DATA_SIZE 1048576 2 int data[DATA_SIZE]; 3 int* gpudata; 4 cudaMalloc((void**) &gpudata, sizeof(int) * DATA_SIZE); 5 cudaMemcpy(gpudata, data, sizeof(int) * DATA_SIZE, 6 cudaMemcpyHostToDevice);