cuda.core.texture.MipmappedArray#
- class cuda.core.texture.MipmappedArray(*args, **kwargs)#
A mipmapped CUDA array for texture/surface access across levels.
Wraps
CUmipmappedArray. Each mip level is a distinct, hardware-laid-out allocation accessible only via aTextureObject(or by retrieving the level’sOpaqueArrayand binding it as aSurfaceObject). Destroying theMipmappedArraydestroys all level arrays implicitly, so theOpaqueArrayinstances returned byget_level()are non-owning and hold a strong reference back to their parent.Construct via
cuda.core.Device.create_mipmapped_array().Methods
- __init__(*args, **kwargs)#
- close(self)#
Release this object’s reference to the underlying
CUmipmappedArray.Destruction (
cuMipmappedArrayDestroy) happens via the handle’s deleter when the last reference is dropped. A levelOpaqueArrayfromget_level()holds its own reference to this mipmap’s storage, so it stays valid until both it and this object are released. Idempotent.
- get_level(self, level)#
Return a non-owning
OpaqueArrayview of the given mip level.- Parameters:
level (int) – Mip level index in
[0, num_levels).- Returns:
A non-owning
OpaqueArraywrapping the level’sCUarray. TheMipmappedArrayis kept alive for the lifetime of the returnedOpaqueArray; the underlying storage is released only when thisMipmappedArrayis destroyed.- Return type:
Attributes
- device#
The
Devicethis mipmap was allocated on.
- format#
The element
ArrayFormatType.
- handle#
The underlying
CUmipmappedArrayas an integer.
- is_surface_load_store#
True if this mipmap (and each of its levels) was created with
CUDA_ARRAY3D_SURFACE_LDSTand can back aSurfaceObject.
- num_channels#
Channels per element (1, 2, or 4).
- num_levels#
Number of mip levels.
- shape#
Base-level (level 0) allocation shape, in elements.