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
widthulongThe width in elements.
heightulongThe height in elements.
depthulongThe 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
Dimensions
Gets the number of dimensions (1, 2, or 3).
public int Dimensions { get; }
Property Value
Height
Gets or sets the height in elements.
public ulong Height { readonly get; set; }
Property Value
TotalElements
Gets the total number of elements.
public ulong TotalElements { get; }
Property Value
Width
Gets or sets the width in elements.
public ulong Width { readonly get; set; }
Property Value
Methods
Equals(CudaExtent)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(CudaExtent other)
Parameters
otherCudaExtentAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
widthulongThe width in elements.
Returns
- CudaExtent
A new CudaExtent.
Make2D(ulong, ulong)
Creates a 2D extent.
public static CudaExtent Make2D(ulong width, ulong height)
Parameters
Returns
- CudaExtent
A new CudaExtent.
Make3D(ulong, ulong, ulong)
Creates a 3D extent.
public static CudaExtent Make3D(ulong width, ulong height, ulong depth)
Parameters
widthulongThe width in elements.
heightulongThe height in elements.
depthulongThe 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
leftCudaExtentrightCudaExtent
Returns
operator !=(CudaExtent, CudaExtent)
Determines whether two CudaExtent instances are not equal.
public static bool operator !=(CudaExtent left, CudaExtent right)
Parameters
leftCudaExtentrightCudaExtent