Table of Contents

Class KernelArgument

Namespace
DotCompute.Backends.OpenCL.Execution
Assembly
DotCompute.Backends.OpenCL.dll

Represents a single kernel argument.

public sealed class KernelArgument
Inheritance
KernelArgument
Inherited Members

Properties

BufferHandle

Gets the buffer handle (if buffer argument).

public nint BufferHandle { get; }

Property Value

nint

IsBuffer

Gets whether this is a buffer argument.

public bool IsBuffer { get; }

Property Value

bool

IsLocalMemory

Gets whether this is a local memory argument.

public bool IsLocalMemory { get; }

Property Value

bool

LocalMemorySize

Gets the local memory size (if local memory argument).

public nuint LocalMemorySize { get; }

Property Value

nuint

ScalarData

Gets the scalar data (if scalar argument).

public IReadOnlyList<byte> ScalarData { get; }

Property Value

IReadOnlyList<byte>

Size

Gets the size of the argument in bytes.

public int Size { get; }

Property Value

int

Methods

Buffer(nint)

Creates a buffer argument.

public static KernelArgument Buffer(nint handle)

Parameters

handle nint

Returns

KernelArgument

LocalMemory(nuint)

Creates a local memory argument.

public static KernelArgument LocalMemory(nuint sizeBytes)

Parameters

sizeBytes nuint

Returns

KernelArgument

Scalar<T>(T)

Creates a scalar argument.

public static KernelArgument Scalar<T>(T value) where T : unmanaged

Parameters

value T

Returns

KernelArgument

Type Parameters

T