Table of Contents

Struct CudaMemoryLocation

Namespace
JYPPX.CudaSharp
Assembly
JYPPX.CudaSharp.dll

Represents a validated, pointer-free CUDA managed-memory location. 表示经过校验且不包含指针的 CUDA managed memory 位置。

public readonly struct CudaMemoryLocation : IEquatable<CudaMemoryLocation>
Implements
Inherited Members

Properties

CurrentHostNuma

Gets the canonical location for the host NUMA node nearest to the current thread. 获取最接近当前线程的主机 NUMA 节点规范位置。

public static CudaMemoryLocation CurrentHostNuma { get; }

Property Value

CudaMemoryLocation

Host

Gets the canonical host-memory location. 获取规范化的主机内存位置。

public static CudaMemoryLocation Host { get; }

Property Value

CudaMemoryLocation

Id

Gets the CUDA device ordinal or host NUMA node identifier when applicable. 获取适用时的 CUDA 设备序号或主机 NUMA 节点标识。

public int Id { get; }

Property Value

int

Kind

Gets the location kind. 获取位置种类。

public CudaMemoryLocationKind Kind { get; }

Property Value

CudaMemoryLocationKind

Methods

Device(int)

Creates a CUDA device location. 创建 CUDA 设备位置。

public static CudaMemoryLocation Device(int deviceOrdinal)

Parameters

deviceOrdinal int

The CUDA device ordinal. CUDA 设备序号。

Returns

CudaMemoryLocation

Equals(CudaMemoryLocation)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(CudaMemoryLocation other)

Parameters

other CudaMemoryLocation

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

HostNuma(int)

Creates a specific host NUMA-node location. 创建指定的主机 NUMA 节点位置。

public static CudaMemoryLocation HostNuma(int numaNodeId)

Parameters

numaNodeId int

The non-negative host NUMA node identifier. 非负的主机 NUMA 节点标识。

Returns

CudaMemoryLocation

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(CudaMemoryLocation, CudaMemoryLocation)

Compares two CUDA memory locations. 比较两个 CUDA memory 位置。

public static bool operator ==(CudaMemoryLocation left, CudaMemoryLocation right)

Parameters

left CudaMemoryLocation
right CudaMemoryLocation

Returns

bool

operator !=(CudaMemoryLocation, CudaMemoryLocation)

Compares two CUDA memory locations. 比较两个 CUDA memory 位置。

public static bool operator !=(CudaMemoryLocation left, CudaMemoryLocation right)

Parameters

left CudaMemoryLocation
right CudaMemoryLocation

Returns

bool