This is the first time I use texture, I read the “Programming_guide” from 1.0 to now 2.0 beta2.
but I can not found any answer for my question is
“what is the difference between low-level and high-level texture runtime API”.
if anyone knows, please tell me.
thank for advance. :)
when I read the example code in the programming guide
the different between high-level and low-level in texture is
In low-level we can configure detail of the texture, but in high-level we can not.
for example bind a texture reference to linear memory in low-level
texture<float, 1, cudaReadModeElementType> texRef;
textureReference* texRefPtr;
cudaGetTextureReference(&texRefPtr, “texRefâ€);
cudaChannelFormatDesc channelDesc =
cudaCreateChannelDesc<float>();
cudaBindTexture(0, texRefPtr, devPtr, &channelDesc, size);
for example bind a texture reference to linear memory in high-level
texture<float, 1, cudaReadModeElementType> texRef;
cudaBindTexture(0, texRef, devPtr, size);
I don’t think that is is the unique different. External Image
does anybody help me.
The high level API simply automatically uses the textures channel descriptor. You can see the code for yourself at line 261 of cuda_runtime.h
template<class T, int dim, enum cudaTextureReadMode readMode>
__inline__ __host__ cudaError_t cudaBindTexture(
size_t *offset,
const struct texture<T, dim, readMode> &tex,
const void *devPtr,
size_t size = UINT_MAX
)
{
return cudaBindTexture(offset, tex, devPtr, tex.channelDesc, size);
}
Thank for your advice. :D
I am trying to understand it clearly.