cuda.core.texture.SurfaceObject#

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

A bindless surface handle for kernel-side typed load/store.

Wraps cuSurfObjectCreate. Unlike a TextureObject, a surface has no sampling state (no filtering, no addressing modes, no normalization); kernels read and write through it using integer pixel coordinates.

The backing OpaqueArray must have been created with is_surface_load_store=True and is kept alive for the lifetime of this object to prevent dangling handles.

Construct via cuda.core.Device.create_surface_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 CUsurfObject.

Destruction (cuSurfObjectDestroy) and release of the backing array happen via the handle’s deleter when the last reference is dropped. Idempotent.

Attributes

device#
handle#

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

resource#

The ResourceDescriptor this surface was built from.