文件名称:myFirstKernel
-
所属分类:
- 标签属性:
- 上传时间:2017-07-07
-
文件大小:6kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
启动内核--从“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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.