12.07.2015 Views

CUDA TIPS and FAQ

CUDA TIPS and FAQ

CUDA TIPS and FAQ

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Topic 4: 並 列 化 (loop)__global__void loopMemcpyKernel(int *dDst, const int *dSrc,size_t size, size_t loopCount) {/* Global IDを 算 出 */int globalID = blockDim.x * blockIdx.x + threadIdx.x;unsigned int begin = gid * loopCount;unsigned int end = min((gid + 1) * loopCount, size);}for (unsigned int index = begin; index < end; ++index) {dDst[index] = dSrc[index];}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!