Table of Contents

Struct CudaLaunchConfig

Namespace
DotCompute.Backends.CUDA.Compilation
Assembly
DotCompute.Backends.CUDA.dll

Launch configuration for CUDA kernels

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

Constructors

CudaLaunchConfig(uint, uint, uint, uint, uint, uint, uint)

Launch configuration for CUDA kernels

public CudaLaunchConfig(uint gridX, uint gridY, uint gridZ, uint blockX, uint blockY, uint blockZ, uint sharedMemoryBytes = 0)

Parameters

gridX uint
gridY uint
gridZ uint
blockX uint
blockY uint
blockZ uint
sharedMemoryBytes uint

Properties

BlockX

Gets or sets the block x.

public uint BlockX { get; }

Property Value

uint

The block x.

BlockY

Gets or sets the block y.

public uint BlockY { get; }

Property Value

uint

The block y.

BlockZ

Gets or sets the block z.

public uint BlockZ { get; }

Property Value

uint

The block z.

GridX

Gets or sets the grid x.

public uint GridX { get; }

Property Value

uint

The grid x.

GridY

Gets or sets the grid y.

public uint GridY { get; }

Property Value

uint

The grid y.

GridZ

Gets or sets the grid z.

public uint GridZ { get; }

Property Value

uint

The grid z.

SharedMemoryBytes

Gets or sets the shared memory bytes.

public uint SharedMemoryBytes { get; }

Property Value

uint

The shared memory bytes.

Methods

Create1D(int, int)

Creates a new 1 d.

public static CudaLaunchConfig Create1D(int totalThreads, int blockSize = 256)

Parameters

totalThreads int

The total threads.

blockSize int

The block size.

Returns

CudaLaunchConfig

The created 1 d.

Create2D(int, int, int, int)

Creates a new 2 d.

public static CudaLaunchConfig Create2D(int width, int height, int blockSizeX = 16, int blockSizeY = 16)

Parameters

width int

The width.

height int

The height.

blockSizeX int

The block size X.

blockSizeY int

The block size Y.

Returns

CudaLaunchConfig

The created 2 d.

Create3D(int, int, int, int, int, int)

Creates a new 3 d.

public static CudaLaunchConfig Create3D(int width, int height, int depth, int blockSizeX = 8, int blockSizeY = 8, int blockSizeZ = 8)

Parameters

width int

The width.

height int

The height.

depth int

The depth.

blockSizeX int

The block size X.

blockSizeY int

The block size Y.

blockSizeZ int

The block size Z.

Returns

CudaLaunchConfig

The created 3 d.

Equals(CudaLaunchConfig)

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

public bool Equals(CudaLaunchConfig other)

Parameters

other CudaLaunchConfig

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.

Operators

operator ==(CudaLaunchConfig, CudaLaunchConfig)

Determines whether two specified instances of CudaLaunchConfig are equal.

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

Parameters

left CudaLaunchConfig

The first instance to compare.

right CudaLaunchConfig

The second instance to compare.

Returns

bool

true if left and right are equal; otherwise, false.

operator !=(CudaLaunchConfig, CudaLaunchConfig)

Determines whether two specified instances of CudaLaunchConfig are not equal.

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

Parameters

left CudaLaunchConfig

The first instance to compare.

right CudaLaunchConfig

The second instance to compare.

Returns

bool

true if left and right are not equal; otherwise, false.