前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >DAY45:阅读Surface Object API

DAY45:阅读Surface Object API

作者头像
GPUS Lady
发布2018-08-01 14:50:41
5920
发布2018-08-01 14:50:41
举报
文章被收录于专栏:GPUS开发者GPUS开发者
我们正带领大家开始阅读英文的《CUDA C Programming Guide》,今天是第45天,我们正在讲解CUDA C语法,希望在接下来的56天里,您可以学习到原汁原味的CUDA,同时能养成英文阅读的习惯。

B.9. Surface Functions

Surface functions are only supported by devices of compute capability 2.0 and higher.

Surface objects are described in described in Surface Object API

Surface references are described in Surface Reference API.

In the sections below, boundaryMode specifies the boundary mode, that is how out-of-range surface coordinates are handled; it is equal to either cudaBoundaryModeClamp, in which case out-of-range coordinates are clamped to the valid range, or cudaBoundaryModeZero, in which case out-of-range reads return zero and out-of-range writes are ignored, or cudaBoundaryModeTrap, in which case out-of-range accesses cause the kernel execution to fail.

B.9.1. Surface Object API

B.9.1.1. surf1Dread()

reads the CUDA array specified by the one-dimensional surface object surfObj using coordinate x.

B.9.1.2. surf1Dwrite

代码语言:javascript
复制

writes value data to the CUDA array specified by the one-dimensional surface object surfObj at coordinate x.

B.9.1.3. surf2Dread()

代码语言:javascript
复制

reads the CUDA array specified by the two-dimensional surface object surfObj using coordinates x and y.

B.9.1.4. surf2Dwrite()

代码语言:javascript
复制

writes value data to the CUDA array specified by the two-dimensional surface object surfObj at coordinate x and y.

B.9.1.5. surf3Dread()

reads the CUDA array specified by the three-dimensional surface object surfObj using coordinates x, y, and z.

B.9.1.6. surf3Dwrite()

writes value data to the CUDA array specified by the three-dimensional object surfObj at coordinate x, y, and z.

B.9.1.7. surf1DLayeredread()

reads the CUDA array specified by the one-dimensional layered surface object surfObj using coordinate x and index layer.

B.9.1.8. surf1DLayeredwrite()

writes value data to the CUDA array specified by the two-dimensional layered surface object surfObj at coordinate x and index layer.

B.9.1.9. surf2DLayeredread()

reads the CUDA array specified by the two-dimensional layered surface object surfObj using coordinate x and y, and index layer.

B.9.1.10. surf2DLayeredwrite()

writes value data to the CUDA array specified by the one-dimensional layered surface object surfObj at coordinate x and y, and index layer.

B.9.1.11. surfCubemapread()

reads the CUDA array specified by the cubemap surface object surfObj using coordinate x and y, and face index face.

B.9.1.12. surfCubemapwrite()

writes value data to the CUDA array specified by the cubemap object surfObj at coordinate x and y, and face index face.

B.9.1.13. surfCubemapLayeredread()

reads the CUDA array specified by the cubemap layered surface object surfObj using coordinate x and y, and index layerFace.

B.9.1.14. surfCubemapLayeredwrite()

writes value data to the CUDA array specified by the cubemap layered object surfObj at coordinate x and y, and index layerFace.

本文备注/经验分享:

surface也像texture那样, 分为surface reference和object, 我们今天先看Surface Object API,等明天看完reference部分,我们再一起来讲解。

有不明白的地方,请在本文后留言

或者在我们的技术论坛bbs.gpuworld.cn上发帖

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-07-10,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 GPUS开发者 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • B.9. Surface Functions
  • B.9.1. Surface Object API
  • B.9.1.1. surf1Dread()
  • B.9.1.2. surf1Dwrite
  • B.9.1.3. surf2Dread()
  • B.9.1.4. surf2Dwrite()
  • B.9.1.5. surf3Dread()
  • B.9.1.6. surf3Dwrite()
  • B.9.1.7. surf1DLayeredread()
  • B.9.1.8. surf1DLayeredwrite()
  • B.9.1.9. surf2DLayeredread()
  • B.9.1.10. surf2DLayeredwrite()
  • B.9.1.11. surfCubemapread()
  • B.9.1.12. surfCubemapwrite()
  • B.9.1.13. surfCubemapLayeredread()
  • B.9.1.14. surfCubemapLayeredwrite()
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档