《《Using_Inline_PTX_Assembly_In_CUDA》.pdf

  1. 1、本文档共9页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
《《Using_Inline_PTX_Assembly_In_CUDA》.pdf

USING INLINE PTX ASSEMBLY IN CUDA DA-05713-001_v01 | February 2011 Application Note DOCUMENT CHANGE HISTORY DA-05713-001_v01 Version Date Authors Description of Change 01 February 14, 2011 CUDA Initial release Using Inline PTX Assembly in CUDA DA-05713-001_v01 | ii TABLE OF CONTENTS Using Inline PTX Assembly in CUDA 4 Assembler (ASM) Statements 4 Parameters 4 Constraints 6 Pitfalls 7 Namespace Conflicts 7 Memory Space Conflicts 7 Incorrect Optimization 7 Incorrect PTX 8 Error Checking 8 Using Inline PTX Assembly in CUDA DA-05713-001_v01 | iii USING INLINE PTX ASSEMBLY IN CUDA The NVIDIA® CUDA™ programming environment provides a parallel thread execution (PTX) instruction set architecture (ISA) for using the GPU as a data-parallel computing device. For more information on the PTX ISA, refer to the latest version of the PTX ISA reference document ptx_isa_[version].pdf in the CUDA Toolkit doc folder. This application note describes how to inline PTX assembly language statements into CUDA code. ASSEMBLER (ASM) STATEMENTS Assembler statements, asm(), provide a way to insert arbitrary PTX code into your CUDA program. A simple example is: asm(membar.gl;); This inserts a PTX membar.gl into your generated PTX code at the point of the asm() statement. Parameters An asm() statement becomes more complicated, and more useful, when we pass values in and out of the asm. The basic syntax is as follows: asm(template-string : constraint(output) : constraint(input)); where you can have multiple input or output operands separated by commas. The template string contains PTX

文档评论(0)

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

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

1亿VIP精品文档

相关文档