cuda.core.texture.TextureObject#

class cuda.core.texture.TextureObject(*args, **kwargs)#

A bindless texture handle for kernel-side sampled reads.

Wraps cuTexObjectCreate. The underlying memory resource (e.g. the OpaqueArray referenced by the descriptor) is kept alive for the lifetime of this object to prevent dangling handles.

Construct via cuda.core.Device.create_texture_object(). Passes to kernels as a 64-bit handle (via the handle property).

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.

Attributes

device#
handle#

The underlying CUtexObject as an integer (64-bit kernel arg).

options#

The TextureObjectOptions this texture was built from.

Added in version 1.1.0.

resource#

The ResourceDescriptor this texture was built from.