surf enum 三维 eno ace surface color 笔记 code
纹理内存读取函数
- /****************************************************************/
- // Texture Object API
- /****************************************************************/
- template<class T>
- T tex1Dfetch(cudaTextureObject_t texObj, int x);
- // 一维纹理,整数下标。只用于非正规化坐标,挤压模式或边界模式,不能滤波
- template<class T>
- T tex1D(cudaTextureObject_t texObj, float x);
- // 一维纹理,浮点数下标
- template<class T>
- T tex1DLod(cudaTextureObject_t texObj, float x, float level);
- // 一维纹理,基于 level-of-detail(层次细节)算法
- template<class T>
- T tex1DGrad(cudaTextureObject_t texObj, float x, float dx, float dy);
- // 一维纹理,基于 gradients(梯度)算法
- template<class T>
- T tex2D(cudaTextureObject_t texObj, float x, float y);
- // 二维纹理
- template<class T>
- tex2DLod(cudaTextureObject_t texObj, float x, float y, float level);
- // 二维纹理,基于 level-of-detail(层次细节)算法
- template<class T>
- T tex2DGrad(cudaTextureObject_t texObj, float x, float y,float2 dx, float2 dy);
- // 二维纹理,基于 gradients(梯度)算法
- template<class T>
- T tex3D(cudaTextureObject_t texObj, float x, float y, float z);
- // 三维纹理
- template<class T>
- T tex3DLod(cudaTextureObject_t texObj, float x, float y, float z, float level);
- // 三维纹理,基于 level-of-detail(层次细节)算法
- template<class T>
- T tex3DGrad(cudaTextureObject_t texObj, float x, float y, float z,float4 dx, float4 dy);
- // 三维纹理,基于 gradients(梯度)算法
- template<class T>
- T tex1DLayered(cudaTextureObject_t texObj, float x, int layer);
- // 一维分层纹理
- template<class T>
- T tex1DLayeredLod(cudaTextureObject_t texObj, float x, int layer, float level);
- // 一维分层纹理,基于 level-of-detail(层次细节)算法
- template<class T>
- T tex1DLayeredGrad(cudaTextureObject_t texObj, float x, int layer, float dx, float dy);
- // 一维分层纹理,基于 gradients(梯度)算法
- template<class T>
- T tex2DLayered(cudaTextureObject_t texObj, float x, float y, int layer);
- // 二维分层纹理
- template<class T>
- T tex2DLayeredLod(cudaTextureObject_t texObj, float x, float y, int layer, float level);
- // 二维分层纹理,基于 level-of-detail(层次细节)算法
- template<class T>
- T tex2DLayeredGrad(cudaTextureObject_t texObj, float x, float y, int layer, float2 dx, float2 dy);
- // 二维分层纹理,基于 gradients(梯度)算法
- template<class T>
- T texCubemap(cudaTextureObject_t texObj, float x, float y, float z);
- // 立方体贴图纹理
- template<class T>
- T texCubemapLod(cudaTextureObject_t texObj, float x, float, y, float z, float level);
- // 立方体贴图纹理,基于 level-of-detail(层次细节)算法
- template<class T>
- T texCubemapLayered(cudaTextureObject_t texObj, float x, float y, float z, int layer);
- // 立方体分层贴图纹理
- template<class T>
- T texCubemapLayeredLod(cudaTextureObject_t texObj, float x, float y, float z, int layer, float level);
- // 立方分层体贴图纹理,基于 level-of-detail(层次细节)算法
- template<class T>
- T tex2Dgather(cudaTextureObject_t texObj, float x, float y, int comp = 0);
- // ?
- /****************************************************************/
- // Texture Object API
- /****************************************************************/
- template<class DataType>
- Type tex1Dfetch(texture<DataType, cudaTextureType1D, cudaReadModeElementType> texRef, int x);
- float tex1Dfetch(texture<unsigned char, cudaTextureType1D, cudaReadModeNormalizedFloat> texRef, int x);
- float tex1Dfetch(texture<signed char, cudaTextureType1D, cudaReadModeNormalizedFloat> texRef, int x);
- float tex1Dfetch(texture<unsigned short, cudaTextureType1D, cudaReadModeNormalizedFloat> texRef, int x);
- float tex1Dfetch(texture<signed short, cudaTextureType1D, cudaReadModeNormalizedFloat> texRef, int x);
- // 一维纹理,整数下标。只用于非正规化坐标,挤压模式或边界模式,不能滤波
- // 2元组,4元组也可以使用这种方法,例如:
- float4 tex1Dfetch(texture<uchar2, cudaTextureType1D, cudaReadModeNormalizedFloat> texRef, int x);
- float4 tex1Dfetch(texture<uchar4, cudaTextureType1D, cudaReadModeNormalizedFloat> texRef, int x);
- // 其他函数名类似 Texture Object API
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex1D(texture<DataType, cudaTextureType1D, readMode> texRef, float x);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex1DLod(texture<DataType, cudaTextureType1D, readMode> texRef, float x, float level);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex1DGrad(texture<DataType, cudaTextureType1D, readMode> texRef, float x, float dx, float dy);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex2D(texture<DataType, cudaTextureType2D, readMode> texRef,float x, float y);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex2DLod(texture<DataType, cudaTextureType2D, readMode> texRef, float x, float y, float level);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex2DGrad(texture<DataType, cudaTextureType2D, readMode> texRef, float x, float y, float2 dx, float2 dy);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex3D(texture<DataType, cudaTextureType3D, readMode> texRef, float x, float y, float z);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex3DLod(texture<DataType, cudaTextureType3D, readMode> texRef, float x, float y, float z, float level);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex3DGrad(texture<DataType, cudaTextureType3D, readMode> texRef, float x, float y, float z, float4 dx, float4 dy);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex1DLayered(texture<DataType, cudaTextureType1DLayered, readMode> texRef, float x, int layer);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex1DLayeredLod(texture<DataType, cudaTextureType1D, readMode> texRef, float x, int layer, float level);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex1DLayeredGrad(texture<DataType, cudaTextureType1D, readMode> texRef, float x, int layer, float dx, float dy);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex2DLayered(texture<DataType, cudaTextureType2DLayered, readMode> texRef, float x, float y, int layer);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex2DLayeredLod(texture<DataType, cudaTextureType2D, readMode> texRef, float x, float y, int layer, float level);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex2DLayeredGrad(texture<DataType, cudaTextureType2D, readMode> texRef, float x, float y, int layer, float2 dx, float2 dy);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type texCubemap(texture<DataType, cudaTextureTypeCubemap, readMode> texRef, float x, float y, float z);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type texCubemapLod(texture<DataType, cudaTextureType3D, readMode> texRef, float x, float y, float z, float level);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type texCubemapLayered(texture<DataType, cudaTextureTypeCubemapLayered, readMode> texRef, float x, float y, float z, int layer);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type texCubemapLayeredLod(texture<DataType, cudaTextureType3D, readMode> texRef, float x, float y, float z, int layer, float level);
- template<class DataType, enum cudaTextureReadMode readMode>
- Type tex2Dgather(texture<DataType, cudaTextureType2D, readMode> texRef, float x, float y, int comp = 0);
表面内存读写函数
- /****************************************************************/
- // Surface Object API
- /****************************************************************/
- template<class T>
- T surf1Dread(cudaSurfaceObject_t surfObj, int x, boundaryMode = cudaBoundaryModeTrap);
- // 一维表面读取
- template<class T>
- void surf1Dwrite(T data, cudaSurfaceObject_t surfObj, int x, boundaryMode = cudaBoundaryModeTrap);
- // 一维表面写入
- template<class T>
- T surf2Dread(cudaSurfaceObject_t surfObj, int x, int y, boundaryMode = cudaBoundaryModeTrap);
- // 二维表面读取
- template<class T>
- void surf2Dread(T* data, cudaSurfaceObject_t surfObj, int x, int y, boundaryMode = cudaBoundaryModeTrap);
- // 二维表面读取
- template<class T>
- void surf2Dwrite(T data, cudaSurfaceObject_t surfObj, int x, int y, boundaryMode = cudaBoundaryModeTrap);
- // 二维表面写入
- template<class T>
- T surf3Dread(cudaSurfaceObject_t surfObj, int x, int y, int z, boundaryMode = cudaBoundaryModeTrap);
- // 三维表面读取
- template<class T>
- void surf3Dread(T* data, cudaSurfaceObject_t surfObj, int x, int y, int z, boundaryMode = cudaBoundaryModeTrap);
- // 三维表面读取
- template<class T>
- void surf3Dwrite(T data, cudaSurfaceObject_t surfObj, int x, int y, int z, boundaryMode = cudaBoundaryModeTrap);
- // 三维表面写入
- template<class T>
- T surf1DLayeredread(cudaSurfaceObject_t surfObj, int x, int layer, boundaryMode = cudaBoundaryModeTrap);
- // 一维分层表面读取
- template<class T>
- void surf1DLayeredread(T data, cudaSurfaceObject_t surfObj, int x, int layer, boundaryMode = cudaBoundaryModeTrap);
- // 一维分层表面读取
- template<class Type>
- void surf1DLayeredwrite(T data, cudaSurfaceObject_t surfObj, int x, int layer, boundaryMode = cudaBoundaryModeTrap);
- // 一维分层表面写入
- template<class T>
- T surf2DLayeredread(cudaSurfaceObject_t surfObj, int x, int y, int layer, boundaryMode = cudaBoundaryModeTrap);
- // 二维分层表面读取
- template<class T>
- void surf2DLayeredread(T data, cudaSurfaceObject_t surfObj, int x, int y, int layer, boundaryMode = cudaBoundaryModeTrap);
- // 二维分层表面读取
- template<class T>
- void surf2DLayeredwrite(T data, cudaSurfaceObject_t surfObj, int x, int y, int layer, boundaryMode = cudaBoundaryModeTrap);
- // 二维分层表面写入
- template<class T>
- T surfCubemapread(cudaSurfaceObject_t surfObj, int x, int y, int face, boundaryMode = cudaBoundaryModeTrap);
- // 立方体贴图表面读取
- template<class T>
- void surfCubemapread(T data, cudaSurfaceObject_t surfObj, int x, int y, int face, boundaryMode = cudaBoundaryModeTrap);
- // 立方体贴图表面读取
- template<class T>
- void surfCubemapwrite(T data, cudaSurfaceObject_t surfObj, int x, int y, int face, boundaryMode = cudaBoundaryModeTrap);
- // 立方体贴图表面写入
- template<class T>
- T surfCubemapLayeredread(cudaSurfaceObject_t surfObj, int x, int y, int layerFace, boundaryMode = cudaBoundaryModeTrap);
- // 立方体分层贴图表面读取
- template<class T>
- void surfCubemapLayeredread(T data, cudaSurfaceObject_t surfObj, int x, int y, int layerFace, boundaryMode = cudaBoundaryModeTrap);
- // 立方体分层贴图表面读取
- template<class T>
- void surfCubemapLayeredwrite(T data, cudaSurfaceObject_t surfObj, int x, int y, int layerFace, boundaryMode = cudaBoundaryModeTrap);
- // 立方体分层贴图表面写入
- /****************************************************************/
- // Surface Refernence API
- /****************************************************************/
- // 函数名类似 Texture Object API
- template<class Type>
- Type surf1Dread(surface<void, cudaSurfaceType1D> surfRef, int x, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf1Dread(Type data, surface<void, cudaSurfaceType1D> surfRef, int x, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf1Dwrite(Type data, surface<void, cudaSurfaceType1D> surfRef, int x, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- Type surf2Dread(surface<void, cudaSurfaceType2D> surfRef, int x, int y, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf2Dread(Type* data, surface<void, cudaSurfaceType2D> surfRef, int x, int y, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf3Dwrite(Type data, surface<void, cudaSurfaceType3D> surfRef, int x, int y, int z, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- Type surf3Dread(surface<void, cudaSurfaceType3D> surfRef, int x, int y, int z, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf3Dread(Type* data, surface<void, cudaSurfaceType3D> surfRef, int x, int y, int z, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf3Dwrite(Type data, surface<void, cudaSurfaceType3D> surfRef, int x, int y, int z, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- Type surf1DLayeredread(surface<void, cudaSurfaceType1DLayered> surfRef, int x, int layer, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf1DLayeredread(Type data, surface<void, cudaSurfaceType1DLayered> surfRef, int x, int layer, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf1DLayeredwrite(Type data, surface<void, cudaSurfaceType1DLayered> surfRef, int x, int layer, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- Type surf2DLayeredread(surface<void, cudaSurfaceType2DLayered> surfRef, int x, int y, int layer, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf2DLayeredread(Type data, surface<void, cudaSurfaceType2DLayered> surfRef, int x, int y, int layer, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surf2DLayeredwrite(Type data, surface<void, cudaSurfaceType2DLayered> surfRef, int x, int y, int layer, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- Type surfCubemapread(surface<void, cudaSurfaceTypeCubemap> surfRef, int x, int y, int face, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surfCubemapread(Type data, surface<void, cudaSurfaceTypeCubemap> surfRef, int x, int y, int face, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surfCubemapwrite(Type data, surface<void, cudaSurfaceTypeCubemap> surfRef, int x, int y, int face, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- Type surfCubemapLayeredread(surface<void, cudaSurfaceTypeCubemapLayered> surfRef, int x, int y, int layerFace, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surfCubemapLayeredread(Type data, surface<void, cudaSurfaceTypeCubemapLayered> surfRef, int x, int y, int layerFace, boundaryMode = cudaBoundaryModeTrap);
- template<class Type>
- void surfCubemapLayeredwrite(Type data, surface<void, cudaSurfaceTypeCubemapLayered> surfRef, int x, int y, int layerFace, boundaryMode = cudaBoundaryModeTrap);
CUDA C Programming Guide 在线教程学习笔记 Part 6
surf enum 三维 eno ace surface color 笔记 code
原文:http://www.cnblogs.com/cuancuancuanhao/p/7819902.html
来源: http://www.bubuko.com/infodetail-2391554.html