cuda.core.textures.TextureObject#
- class cuda.core.textures.TextureObject(*args, **kwargs)#
A bindless texture handle for kernel-side sampled reads.
Wraps
cuTexObjectCreate. The underlying memory resource (e.g. theCUDAArrayreferenced by the descriptor) is kept alive for the lifetime of this object to prevent dangling handles.Construct via
from_descriptor(). Passes to kernels as a 64-bit handle (via thehandleproperty).Methods
- __init__(*args, **kwargs)#
- close(self)#
Release this object’s reference to the underlying
CUtexObject.Destruction (
cuTexObjectDestroy) and release of the backing resource happen via the handle’s deleter when the last reference is dropped. Idempotent.
- classmethod from_descriptor(cls, *, resource, texture_descriptor)#
Create a texture object from a resource + sampling descriptor.
- Parameters:
resource (ResourceDescriptor)
texture_descriptor (TextureDescriptor)
Attributes
- device#
- handle#
The underlying
CUtexObjectas an integer (64-bit kernel arg).
- resource#
The
ResourceDescriptorthis texture was built from.
- texture_descriptor#
The
TextureDescriptorthis texture was built from.