网站大量收购独家精品文档,联系QQ:2885784924

超大规模并行程序设计.ppt

  1. 1、本文档共67页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Second Generation Parallel Thread Execution ISA 64-bit memory address space - with ECC Unified address space with full C++ support Optimized execution of OpenCL and DirectCompute Full IEEE 754-2008 single and double precision floating point numbers NVIDIA GigaThreadTM Engine Multi-kernel execution 10x faster application context switching Concurrent kernel execution Out-of order thread block execution Two streaming transfer engines Work in a pipelined, overlapped manner Each could saturate the PCIe interface Performance 参考书目 NVIDIA, CUDA Programming Guide, NVidia, 2008, 2009. 张舒、褚艳利、 赵开勇、张钰勃, GPU高性能运算之CUDA, 2009. /. T. Mattson, et al., Patterns for Parallel Programming, Addison Wesley, 2005. 参考文献 Special issues on GPU computing IEEE, Proceedings of IEEE, Vol. 96, No. 5, May, 2008. ACM, Queue, Vol. 6, No. 2, March/April, 2008. Elsevier, Journal of Parallel and Distributed Computing, Vol. 68, No. 10, October, 2008. * CUDA函数定义 __global__ 定义kernel函数 必须返回void __device__ 函数 不能用运算符取地址, 不支持递归调用, 不支持静态变量(static variable), 不支持可变长度参数函数调用 Executed on the: Only callable from the: __device__ float DeviceFunc() device device __global__ void KernelFunc() device host __host__ float HostFunc() host host CUDA数学函数 pow, sqrt, cbrt, hypot, exp, exp2, expm1, log, log2, log10, log1p, sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, asinh, acosh, atanh, ceil, floor, trunc, round, etc. 只支持标量运算 许多函数有一个快速、较不精确的对应版本 以”__”为前缀,如__sin() 编译开关-use_fast_math强制生成该版本的目标码 实例2: 矩阵相乘 矩阵数据类型 – 不属于CUDA! 单精度浮点数 width ? height个元素 矩阵元素在elements中 1-D数组存放矩阵数据 Row-major storage typedef struct { int width; int height; float* elements; } Matrix; A B C WM.width = N.heightI M.height M.width N.width 实例2: 矩阵相乘 C = A ? B of size WIDTH x WIDTH 一个线程处理一个矩阵元素 简化: 假定 WIDTH x WIDTH 512 只需要一个thread block 线程载入A的一行和B的一列 A和B的一对相应元素作一次乘法和一次加法 A B C WIDTH WIDTH WIDTH WIDTH CUDA Implementation – Host Side // Matrix multiplication on the device void Mul(const Matrix A, const Matrix B, Matri

文档评论(0)

nnh91 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档