cuda.bindings._v2.driver.tex_ref_set_address_v2#
- cuda.bindings._v2.driver.tex_ref_set_address_v2(
- intptr_t h_tex_ref,
- uint64_t dptr,
- size_t bytes,
Binds an address as a texture reference.
[Deprecated]. Binds a linear address range to the texture reference
h_tex_ref. Any previous address or CUDA array state associated with the texture reference is superseded by this function. Any memory previously bound toh_tex_refis unbound. Since the hardware enforces an alignment requirement on texture base addresses,cuTexRefSetAddress()passes back a byte offset in*byte_offsetthat must be applied to texture fetches in order to read from the desired memory. This offset must be divided by the texel size and passed to kernels that read from the texture so they can be applied to thetex1Dfetch()function. If the device memory pointer was returned fromcuMemAlloc(), the offset is guaranteed to be 0 and NULL may be passed as thebyte_offsetparameter. The total number of elements (or texels) in the linear address range cannot exceedCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH. The number of elements is computed as (numbytes/ bytesPerElement), where bytesPerElement is determined from the data format and number of components set usingtex_ref_set_format().- Parameters:
h_tex_ref (intptr_t) – Texture reference to bind.
dptr (uint64_t) – Device pointer to bind.
bytes (size_t) – Size of memory to bind in bytes.
- Returns:
Returned byte offset.
- Return type:
size_t
See also
cuTexRefSetAddress_v2