Table of Contents

Class CudaMipmappedArray

Namespace
JYPPX.CudaSharp
Assembly
JYPPX.CudaSharp.dll

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

descriptor CudaChannelFormatDescriptor

The channel layout descriptor. 通道布局描述符。

extent CudaArrayExtent

The mip level extent. mip level 范围。

levelCount uint

The number of mip levels. mip level 数量。

flags CudaArrayCreationFlags

The 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

CudaChannelFormatDescriptor

Extent

Gets the logical extent of the base mip level. 获取基础 mip level 的逻辑范围。

public CudaArrayExtent Extent { get; }

Property Value

CudaArrayExtent

Flags

Gets the CUDA array creation flags. 获取 CUDA array 创建标志。

public CudaArrayCreationFlags Flags { get; }

Property Value

CudaArrayCreationFlags

LevelCount

Gets the number of mip levels in the allocation. 获取该分配中的 mip level 数量。

public uint LevelCount { get; }

Property Value

uint

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

level uint

The 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

device int

The 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

device int

The CUDA device ordinal. CUDA 设备序号。

requirements CudaArrayMemoryRequirements

The returned memory requirements on success. 成功时返回的内存需求。

diagnostic string

The diagnostic message on failure. 失败时的诊断消息。

Returns

bool

true on success. 成功时返回 true

TryGetSparseProperties(out CudaArraySparseProperties, out string)

Tries to query sparse-allocation properties without throwing. 尝试在不抛异常的情况下查询稀疏分配属性。

public bool TryGetSparseProperties(out CudaArraySparseProperties properties, out string diagnostic)

Parameters

properties CudaArraySparseProperties

The returned sparse properties on success. 成功时返回的稀疏属性。

diagnostic string

The diagnostic message on failure. 失败时的诊断消息。

Returns

bool

true on success. 成功时返回 true