Table of Contents

Struct ComparisonKernelKey

Namespace
NumSharp.Backends.Kernels
Assembly
NumSharp.dll

Cache key for comparison operation kernels. Identifies a unique kernel by LHS type, RHS type, operation, and execution path. Result type is always bool (NPTypeCode.Boolean).

public readonly record struct ComparisonKernelKey : IEquatable<ComparisonKernelKey>
Implements
Inherited Members
Extension Methods

Remarks

Supports up to 4,320 unique kernels: 12 × 12 × 6 × 5 = 4,320 (12 LHS types × 12 RHS types × 6 comparison ops × 5 paths)

Constructors

ComparisonKernelKey(NPTypeCode, NPTypeCode, ComparisonOp, ExecutionPath)

Cache key for comparison operation kernels. Identifies a unique kernel by LHS type, RHS type, operation, and execution path. Result type is always bool (NPTypeCode.Boolean).

public ComparisonKernelKey(NPTypeCode LhsType, NPTypeCode RhsType, ComparisonOp Op, ExecutionPath Path)

Parameters

LhsType NPTypeCode
RhsType NPTypeCode
Op ComparisonOp
Path ExecutionPath

Remarks

Supports up to 4,320 unique kernels: 12 × 12 × 6 × 5 = 4,320 (12 LHS types × 12 RHS types × 6 comparison ops × 5 paths)

Properties

ComparisonType

Get the common type for comparison (promote both operands to this type).

public NPTypeCode ComparisonType { get; }

Property Value

NPTypeCode

IsSameType

Returns true if both input types are the same (no conversion needed for comparison).

public bool IsSameType { get; }

Property Value

bool

LhsType

public NPTypeCode LhsType { get; init; }

Property Value

NPTypeCode

Op

public ComparisonOp Op { get; init; }

Property Value

ComparisonOp

Path

public ExecutionPath Path { get; init; }

Property Value

ExecutionPath

ResultType

Result type is always bool for comparisons.

public NPTypeCode ResultType { get; }

Property Value

NPTypeCode

RhsType

public NPTypeCode RhsType { get; init; }

Property Value

NPTypeCode

Methods

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.