文件名称:myFirstKernel
- 所属分类:
- 并行运算
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2017-07-07
- 文件大小:
- 6kb
- 下载次数:
- 0次
- 提 供 者:
- p-y****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
启动内核--从“myFirstKernel”模板开始。
Part1:使用指针d_a为内核的结果分配设备内存。
Part2:使用1-D的1-D网格来配置和启动内核
线程块。
Part3:让每个线程设置一个d_a的元素,如下所示:
idx = blockIdx.x * blockDim.x + threadIdx.x d_a [idx] = 1000 * blockIdx.x + threadIdx.x
Part4:将d_a中的结果复制回主机指针h_a。
Part5:验证结果是否正确。(Start the kernel -- start with the myFirstKernel template.
Part1: use pointer d_a to allocate device memory for the results of the kernel.
Part2: use the 1-D 1-D grid to configure and start the kernel
Thread block.
Part3: let each thread set an element of d_a, as shown below:
IDX = blockIdx.x * blockDim.x + threadIdx.x d_a = [idx] = 1000 * blockIdx.x + threadIdx.x
Part4: copy the results from d_a back to the host pointer h_a.
Part5: is the validation correct?.)
Part1:使用指针d_a为内核的结果分配设备内存。
Part2:使用1-D的1-D网格来配置和启动内核
线程块。
Part3:让每个线程设置一个d_a的元素,如下所示:
idx = blockIdx.x * blockDim.x + threadIdx.x d_a [idx] = 1000 * blockIdx.x + threadIdx.x
Part4:将d_a中的结果复制回主机指针h_a。
Part5:验证结果是否正确。(Start the kernel -- start with the myFirstKernel template.
Part1: use pointer d_a to allocate device memory for the results of the kernel.
Part2: use the 1-D 1-D grid to configure and start the kernel
Thread block.
Part3: let each thread set an element of d_a, as shown below:
IDX = blockIdx.x * blockDim.x + threadIdx.x d_a = [idx] = 1000 * blockIdx.x + threadIdx.x
Part4: copy the results from d_a back to the host pointer h_a.
Part5: is the validation correct?.)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
myFirstKernel
myFirstKernel\myFirstKernel.cu
myFirstKernel\myFirstKernel.sln
myFirstKernel\myFirstKernel.vcproj
myFirstKernel\solution
myFirstKernel\solution\myFirstKernel.cu
myFirstKernel\myFirstKernel.cu
myFirstKernel\myFirstKernel.sln
myFirstKernel\myFirstKernel.vcproj
myFirstKernel\solution
myFirstKernel\solution\myFirstKernel.cu