首先,他的大致流程会是:
- Host 的 texture 建立部分
- 宣告出 texture reference
- 透过 Bind Texture 的函式,将 texture reference 和现有的 device memory 上的变数(linear memory 或 CUDA array)做连结
- Device 使用
- 透过 CUDA 提供的 texture 读取函式(tex1Dfetch,
tex1D, tex2D)来读取 texture 的内容
- 透过 CUDA 提供的 texture 读取函式(tex1Dfetch,
- Host 删除 texture
- 呼叫 unbind texture 的函式,将 texture reference 的资源释放