Class CudaMipmappedArray
Managed wrapper around a CUDA mipmapped array allocation. CUDA mipmapped array 分配的托管封装。
public sealed class CudaMipmappedArray : IDisposable
- Inheritance
-
CudaMipmappedArray
- Implements
- Inherited Members
Constructors
CudaMipmappedArray(CudaChannelFormatDescriptor, CudaArrayExtent, uint, CudaArrayCreationFlags)
Allocates a CUDA mipmapped array. 分配一个 CUDA mipmapped array。
public CudaMipmappedArray(CudaChannelFormatDescriptor descriptor, CudaArrayExtent extent, uint levelCount, CudaArrayCreationFlags flags = CudaArrayCreationFlags.Default)
Parameters
descriptorCudaChannelFormatDescriptorThe channel layout descriptor. 通道布局描述符。
extentCudaArrayExtentThe mip level extent. mip level 范围。
levelCountuintThe number of mip levels. mip level 数量。
flagsCudaArrayCreationFlagsThe CUDA array creation flags. CUDA array 创建标志。
Properties
Descriptor
Gets the channel-format descriptor for each mip level. 获取每个 mip level 的通道格式描述符。
public CudaChannelFormatDescriptor Descriptor { get; }
Property Value
Extent
Gets the logical extent of the base mip level. 获取基础 mip level 的逻辑范围。
public CudaArrayExtent Extent { get; }
Property Value
Flags
Gets the CUDA array creation flags. 获取 CUDA array 创建标志。
public CudaArrayCreationFlags Flags { get; }
Property Value
LevelCount
Gets the number of mip levels in the allocation. 获取该分配中的 mip level 数量。
public uint LevelCount { get; }
Property Value
Methods
Dispose()
Releases the mipmapped-array handle. 释放 mipmapped array 句柄。
public void Dispose()
GetLevelInfo(uint)
Gets metadata for a specific mip level. 获取指定 mip level 的元数据。
public CudaArrayInfo GetLevelInfo(uint level)
Parameters
leveluintThe zero-based mip level. 从零开始的 mip level。
Returns
- CudaArrayInfo
The mip-level metadata. mip level 元数据。
GetMemoryRequirements(int)
Queries device memory requirements for this mipmapped array. 查询当前 mipmapped array 的设备内存需求。
public CudaArrayMemoryRequirements GetMemoryRequirements(int device)
Parameters
deviceintThe CUDA device ordinal. CUDA 设备序号。
Returns
- CudaArrayMemoryRequirements
The memory requirements for the requested device. 指定设备对应的内存需求。
GetSparseProperties()
Gets sparse-allocation properties for this mipmapped array. 获取当前 mipmapped array 的稀疏分配属性。
public CudaArraySparseProperties GetSparseProperties()
Returns
- CudaArraySparseProperties
The sparse-array properties. 稀疏 array 属性。
TryGetMemoryRequirements(int, out CudaArrayMemoryRequirements, out string)
Tries to query device memory requirements without throwing. 尝试在不抛异常的情况下查询设备内存需求。
public bool TryGetMemoryRequirements(int device, out CudaArrayMemoryRequirements requirements, out string diagnostic)
Parameters
deviceintThe CUDA device ordinal. CUDA 设备序号。
requirementsCudaArrayMemoryRequirementsThe returned memory requirements on success. 成功时返回的内存需求。
diagnosticstringThe diagnostic message on failure. 失败时的诊断消息。
Returns
TryGetSparseProperties(out CudaArraySparseProperties, out string)
Tries to query sparse-allocation properties without throwing. 尝试在不抛异常的情况下查询稀疏分配属性。
public bool TryGetSparseProperties(out CudaArraySparseProperties properties, out string diagnostic)
Parameters
propertiesCudaArraySparsePropertiesThe returned sparse properties on success. 成功时返回的稀疏属性。
diagnosticstringThe diagnostic message on failure. 失败时的诊断消息。