CUDA-Lecture7-CUDA Runtiime Component part 2

上传人:飞****9 文档编号:132807456 上传时间:2020-05-20 格式:PDF 页数:42 大小:557.24KB
返回 下载 相关 举报
CUDA-Lecture7-CUDA Runtiime Component part 2_第1页
第1页 / 共42页
CUDA-Lecture7-CUDA Runtiime Component part 2_第2页
第2页 / 共42页
CUDA-Lecture7-CUDA Runtiime Component part 2_第3页
第3页 / 共42页
CUDA-Lecture7-CUDA Runtiime Component part 2_第4页
第4页 / 共42页
CUDA-Lecture7-CUDA Runtiime Component part 2_第5页
第5页 / 共42页
点击查看更多>>
资源描述

《CUDA-Lecture7-CUDA Runtiime Component part 2》由会员分享,可在线阅读,更多相关《CUDA-Lecture7-CUDA Runtiime Component part 2(42页珍藏版)》请在金锄头文库上搜索。

1、 Programming with Programming with CUDACUDA WS 08 09WS 08 09 Lecture 7Lecture 7 Thu 13 Nov 2008Thu 13 Nov 2008 PreviouslyPreviously CUDA Runtime ComponentCUDA Runtime Component Common ComponentCommon Component Built in vector typesBuilt in vector types Math functionsMath functions TimingTiming Textu

2、resTextures Texture fetchTexture fetch Texture referenceTexture reference Texture read modesTexture read modes Normalized texture coordinatesNormalized texture coordinates Linear texture filteringLinear texture filtering TodayToday CUDA Runtime ComponentCUDA Runtime Component Common ComponentCommon

3、Component Device ComponentDevice Component Host ComponentHost Component CUDA Runtime CUDA Runtime ComponentComponent Common ComponentCommon Component Device ComponentDevice Component Host ComponentHost Component Device Runtime Device Runtime ComponentComponent Can only be used in device codeCan only

4、 be used in device code Math functionsMath functions Faster less accurate versions of Faster less accurate versions of functions from common componentfunctions from common component log and logf log and logf Appendix B of Programming GuideAppendix B of Programming Guide Use fast math by defaultUse f

5、ast math by default Compiler option Compiler option use fast math use fast math Device Runtime Device Runtime ComponentComponent Synch function Synch function syncThreads syncThreads Synchronize threads in a blockSynchronize threads in a block Avoid read after write write after Avoid read after writ

6、e write after read write after write hazards for read write after write hazards for commonly accessed shared memorycommonly accessed shared memory Dangerous to use in conditionalsDangerous to use in conditionals Code hangs unwanted effects Code hangs unwanted effects Device Runtime Device Runtime Co

7、mponentComponent Atomic functionsAtomic functions Guaranteed to perform un interferedGuaranteed to perform un interfered Memory address is locked Memory address is locked Supported by CUDA cards 1 0Supported by CUDA cards 1 0 Mostly operate on integers onlyMostly operate on integers only Appendix C

8、of programming guideAppendix C of programming guide Device Runtime Device Runtime ComponentComponent Warp vote functionsWarp vote functions Supported by CUDA cards 1 2Supported by CUDA cards 1 2 Check a condition on all threads in a Check a condition on all threads in a warpwarp int all int predicat

9、e int all int predicate true non zero if true non zero if predicatepredicate is is true for all warp threadstrue for all warp threads int any int predicate int any int predicate true non zero if true non zero if predicatepredicate is is true for any warp threadtrue for any warp thread Device Runtime

10、 Device Runtime ComponentComponent Texture functions fetching textures Texture functions fetching textures or or texturingtexturing Texture data may be stored in Texture data may be stored in linear memorylinear memory or or CUDA arraysCUDA arrays Texturing from linear memoryTexturing from linear me

11、mory templatetemplate Type tex1Dfetch Type tex1Dfetch texture texRef texture texRef int x int x float tex1Dfetch float tex1Dfetch texture texture texRef int x texRef int x Device Runtime Device Runtime ComponentComponent Texture functions fetching textures Texture functions fetching textures or or t

12、exturingtexturing Texturing from linear memoryTexturing from linear memory TypeType can be any of the supported 1 can be any of the supported 1 2 or 4 vector types2 or 4 vector types templatetemplate Type tex1Dfetch Type tex1Dfetch texture texRef texture texRef int x int x float4 tex1Dfetch float4 t

13、ex1Dfetch texture texture texRef int x texRef int x Device Runtime Device Runtime ComponentComponent Texture functions fetching textures Texture functions fetching textures or or texturingtexturing Texturing from linear memoryTexturing from linear memory No addressing modes supportedNo addressing mo

14、des supported No texture filtering supportedNo texture filtering supported Device Runtime Device Runtime ComponentComponent Texture functions fetching textures Texture functions fetching textures or or texturingtexturing Texturing from CUDA arraysTexturing from CUDA arrays template class Type enum c

15、udaTextureReadMode templatereadMode Type tex1D texture texRef Type tex1D texture texRef float x float x template class Type enum cudaTextureReadMode templatereadMode Type tex2D texture texRef Type tex2D texture texRef float x float y float x float y template class Type enum cudaTextureReadMode templ

16、atereadMode Type tex3D texture texRef Type tex3D texture texRef float x float y float z float x float y float z Device Runtime Device Runtime ComponentComponent Texture functions fetching textures Texture functions fetching textures or or texturingtexturing Texturing from CUDA arraysTexturing from CUDA arrays Run time attributes determineRun time attributes determine Coordinate normalization Coordinate normalization Addressing mode clamp wrap Addressing mode clamp wrap Filtering Filtering CUDA R

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 医学/心理学 > 基础医学

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号