Table of Contents

Struct BinaryScalarKernelKey

Namespace
NumSharp.Backends.Kernels
Assembly
NumSharp.dll

Cache key for binary scalar operation kernels. Identifies a unique kernel by LHS type, RHS type, result type, and operation.

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

Remarks

Used to cache IL-generated Func delegates that eliminate dynamic dispatch overhead. The delegate type varies based on operand/result types, so we store as System.Delegate.

Constructors

BinaryScalarKernelKey(NPTypeCode, NPTypeCode, NPTypeCode, BinaryOp)

Cache key for binary scalar operation kernels. Identifies a unique kernel by LHS type, RHS type, result type, and operation.

public BinaryScalarKernelKey(NPTypeCode LhsType, NPTypeCode RhsType, NPTypeCode ResultType, BinaryOp Op)

Parameters

LhsType NPTypeCode
RhsType NPTypeCode
ResultType NPTypeCode
Op BinaryOp

Remarks

Used to cache IL-generated Func delegates that eliminate dynamic dispatch overhead. The delegate type varies based on operand/result types, so we store as System.Delegate.

Properties

IsSameType

Returns true if all three types are the same.

public bool IsSameType { get; }

Property Value

bool

LhsType

public NPTypeCode LhsType { get; init; }

Property Value

NPTypeCode

Op

public BinaryOp Op { get; init; }

Property Value

BinaryOp

ResultType

public NPTypeCode ResultType { get; init; }

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.