Texture memory-tex2D basics

后端 未结 2 1690
庸人自扰
庸人自扰 2020-12-14 11:51

While using texture memory I have come across the following code:-

uint f = (blockIdx.x * blockDim.x) + threadIdx.x;
uint c = (blockIdx.y * blockDim.y) + thr         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 12:47

    Depending on the texture properties, the value returned by tex2D may be linearly interpolated. In that case, the "indices" f and c should not be integers, but continuous values between the limits of each dimension.

    What is a bit odd in this example is that the return value is an integer, which will make any linear interpolant piecewise constant anyway.

    For more detailed information, see Section 3.2.10 of the CUDA Programming Guide.

提交回复
热议问题