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,
) → size_t#

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 to h_tex_ref is unbound. Since the hardware enforces an alignment requirement on texture base addresses, cuTexRefSetAddress() passes back a byte offset in *byte_offset that 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 the tex1Dfetch() function. If the device memory pointer was returned from cuMemAlloc(), the offset is guaranteed to be 0 and NULL may be passed as the byte_offset parameter. The total number of elements (or texels) in the linear address range cannot exceed CU_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 using tex_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