Table of Contents

Struct CudaExtent

Namespace
DotCompute.Backends.CUDA.Types
Assembly
DotCompute.Backends.CUDA.dll

Represents the extent (dimensions) of a CUDA array or texture.

public struct CudaExtent : IEquatable<CudaExtent>
Implements
Inherited Members

Remarks

Initializes a new instance of the CudaExtent struct.

Constructors

CudaExtent(ulong, ulong, ulong)

Represents the extent (dimensions) of a CUDA array or texture.

public CudaExtent(ulong width, ulong height = 0, ulong depth = 0)

Parameters

width ulong

The width in elements.

height ulong

The height in elements.

depth ulong

The depth in elements.

Remarks

Initializes a new instance of the CudaExtent struct.

Properties

Depth

Gets or sets the depth in elements.

public ulong Depth { readonly get; set; }

Property Value

ulong

Dimensions

Gets the number of dimensions (1, 2, or 3).

public int Dimensions { get; }

Property Value

int

Height

Gets or sets the height in elements.

public ulong Height { readonly get; set; }

Property Value

ulong

TotalElements

Gets the total number of elements.

public ulong TotalElements { get; }

Property Value

ulong

Width

Gets or sets the width in elements.

public ulong Width { readonly get; set; }

Property Value

ulong

Methods

Equals(CudaExtent)

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

public bool Equals(CudaExtent other)

Parameters

other CudaExtent

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.

Make1D(ulong)

Creates a 1D extent.

public static CudaExtent Make1D(ulong width)

Parameters

width ulong

The width in elements.

Returns

CudaExtent

A new CudaExtent.

Make2D(ulong, ulong)

Creates a 2D extent.

public static CudaExtent Make2D(ulong width, ulong height)

Parameters

width ulong

The width in elements.

height ulong

The height in elements.

Returns

CudaExtent

A new CudaExtent.

Make3D(ulong, ulong, ulong)

Creates a 3D extent.

public static CudaExtent Make3D(ulong width, ulong height, ulong depth)

Parameters

width ulong

The width in elements.

height ulong

The height in elements.

depth ulong

The depth in elements.

Returns

CudaExtent

A new CudaExtent.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(CudaExtent, CudaExtent)

Determines whether two CudaExtent instances are equal.

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

Parameters

left CudaExtent
right CudaExtent

Returns

bool

operator !=(CudaExtent, CudaExtent)

Determines whether two CudaExtent instances are not equal.

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

Parameters

left CudaExtent
right CudaExtent

Returns

bool