Show / Hide Table of Contents

    Class CudaPitchedDeviceVariable<T>

    A variable located in CUDA device memory. The data is aligned following Pitch

    Inheritance
    System.Object
    CudaPitchedDeviceVariable<T>
    Implements
    System.IDisposable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: ManagedCuda
    Assembly: ManagedCuda.dll
    Syntax
    public class CudaPitchedDeviceVariable<T> : IDisposable where T : struct
    Type Parameters
    Name Description
    T

    variable base type

    Constructors

    | Improve this Doc View Source

    CudaPitchedDeviceVariable(CUdeviceptr, SizeT, SizeT, SizeT)

    Creates a new CudaPitchedDeviceVariable from an existing CUdeviceptr The CUdeviceptr won't be freed when disposing.

    Declaration
    public CudaPitchedDeviceVariable(CUdeviceptr devPtr, SizeT width, SizeT height, SizeT pitch)
    Parameters
    Type Name Description
    CUdeviceptr devPtr
    SizeT width

    In elements

    SizeT height

    In elements

    SizeT pitch

    In bytes

    | Improve this Doc View Source

    CudaPitchedDeviceVariable(CUdeviceptr, SizeT, SizeT, SizeT, Boolean)

    Creates a new CudaPitchedDeviceVariable from an existing CUdeviceptr

    Declaration
    public CudaPitchedDeviceVariable(CUdeviceptr devPtr, SizeT width, SizeT height, SizeT pitch, bool isOwner)
    Parameters
    Type Name Description
    CUdeviceptr devPtr
    SizeT width

    In elements

    SizeT height

    In elements

    SizeT pitch

    In bytes

    System.Boolean isOwner

    The CUdeviceptr will be freed while disposing if the CudaPitchedDeviceVariable is the owner

    | Improve this Doc View Source

    CudaPitchedDeviceVariable(SizeT, SizeT)

    Creates a new CudaPitchedDeviceVariable and allocates the memory on the device

    Declaration
    public CudaPitchedDeviceVariable(SizeT width, SizeT height)
    Parameters
    Type Name Description
    SizeT width

    In elements

    SizeT height

    In elements

    | Improve this Doc View Source

    CudaPitchedDeviceVariable(SizeT, SizeT, SizeT)

    Creates a new CudaPitchedDeviceVariable and allocates the memory on the device

    Declaration
    public CudaPitchedDeviceVariable(SizeT width, SizeT height, SizeT pack)
    Parameters
    Type Name Description
    SizeT width

    In elements

    SizeT height

    In elements

    SizeT pack

    Group pack elements as one type. E.g. 4 floats in host code to one float4 in device code

    Properties

    | Improve this Doc View Source

    DevicePointer

    Device pointer

    Declaration
    public CUdeviceptr DevicePointer { get; }
    Property Value
    Type Description
    CUdeviceptr
    | Improve this Doc View Source

    Height

    Height in elements

    Declaration
    public SizeT Height { get; }
    Property Value
    Type Description
    SizeT
    | Improve this Doc View Source

    Item[SizeT, SizeT]

    Access array elements directly from host.

    Each single access invokes a device to host or host to device copy. Access is therefor rather slow.

    Declaration
    public T this[SizeT x, SizeT y] { get; set; }
    Parameters
    Type Name Description
    SizeT x

    X-index in elements

    SizeT y

    Y-index in elements

    Property Value
    Type Description
    T
    | Improve this Doc View Source

    Pitch

    Pitch in bytes

    Declaration
    public SizeT Pitch { get; }
    Property Value
    Type Description
    SizeT
    | Improve this Doc View Source

    TotalSizeInBytes

    Total size in bytes (Pitch * Height)

    Declaration
    public SizeT TotalSizeInBytes { get; }
    Property Value
    Type Description
    SizeT
    | Improve this Doc View Source

    Width

    Width in elements

    Declaration
    public SizeT Width { get; }
    Property Value
    Type Description
    SizeT
    | Improve this Doc View Source

    WidthInBytes

    Width in bytes

    Declaration
    public SizeT WidthInBytes { get; }
    Property Value
    Type Description
    SizeT

    Methods

    | Improve this Doc View Source

    AsyncCopyToDevice(CUdeviceptr, CUstream)

    Async Copy data from device to device memory

    Declaration
    public void AsyncCopyToDevice(CUdeviceptr source, CUstream stream)
    Parameters
    Type Name Description
    CUdeviceptr source

    Source pointer to device memory

    CUstream stream
    | Improve this Doc View Source

    AsyncCopyToDevice(CUdeviceptr, CudaStream)

    Async Copy data from device to device memory (1D Copy, copies destination pitch * height bytes data)

    Declaration
    public void AsyncCopyToDevice(CUdeviceptr source, CudaStream stream)
    Parameters
    Type Name Description
    CUdeviceptr source

    Source pointer to device memory

    CudaStream stream
    | Improve this Doc View Source

    AsyncCopyToDevice(CudaDeviceVariable<T>, CUstream)

    Async Copy data from device to device memory

    Declaration
    public void AsyncCopyToDevice(CudaDeviceVariable<T> source, CUstream stream)
    Parameters
    Type Name Description
    CudaDeviceVariable<T> source

    Source

    CUstream stream
    | Improve this Doc View Source

    AsyncCopyToDevice(CudaDeviceVariable<T>, CudaStream)

    Async Copy data from device to device memory (1D Copy, copies destination pitch * height bytes data)

    Declaration
    public void AsyncCopyToDevice(CudaDeviceVariable<T> source, CudaStream stream)
    Parameters
    Type Name Description
    CudaDeviceVariable<T> source

    Source

    CudaStream stream
    | Improve this Doc View Source

    AsyncCopyToDevice(CudaPitchedDeviceVariable<T>, CUstream)

    Async Copy from device to device memory

    Declaration
    public void AsyncCopyToDevice(CudaPitchedDeviceVariable<T> deviceSrc, CUstream stream)
    Parameters
    Type Name Description
    CudaPitchedDeviceVariable<T> deviceSrc

    Source

    CUstream stream
    | Improve this Doc View Source

    AsyncCopyToDevice(CudaPitchedDeviceVariable<T>, CudaStream)

    Async Copy from device to device memory

    Declaration
    public void AsyncCopyToDevice(CudaPitchedDeviceVariable<T> deviceSrc, CudaStream stream)
    Parameters
    Type Name Description
    CudaPitchedDeviceVariable<T> deviceSrc

    Source

    CudaStream stream
    | Improve this Doc View Source

    CopyToDevice(T[])

    Copy from Host to device memory

    Declaration
    public void CopyToDevice(T[] hostSrc)
    Parameters
    Type Name Description
    T[] hostSrc

    Source

    | Improve this Doc View Source

    CopyToDevice(T[], SizeT, SizeT)

    Copy from Host to device memory

    Declaration
    public void CopyToDevice(T[] hostSrc, SizeT width, SizeT height)
    Parameters
    Type Name Description
    T[] hostSrc

    Source

    SizeT width

    Width in elements

    SizeT height

    Height in elements

    | Improve this Doc View Source

    CopyToDevice(T[], SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT)

    Copy from host to device memory

    Declaration
    public void CopyToDevice(T[] hostSrc, SizeT SrcXInBytes, SizeT SrcY, SizeT DestXInBytes, SizeT DestY, SizeT widthInBytes, SizeT height, SizeT SrcPitch, SizeT DestPitch)
    Parameters
    Type Name Description
    T[] hostSrc

    Source

    SizeT SrcXInBytes

    Source X in bytes

    SizeT SrcY

    Source Y

    SizeT DestXInBytes

    Destination X in bytes

    SizeT DestY

    Destination Y

    SizeT widthInBytes

    Width in bytes

    SizeT height

    Height in elements

    SizeT SrcPitch

    Source pitch

    SizeT DestPitch

    Destination pitch

    | Improve this Doc View Source

    CopyToDevice(T[,])

    Copy from Host to device memory. Assumes that aHostDest has no additional line padding.

    Declaration
    public void CopyToDevice(T[, ] hostSrc)
    Parameters
    Type Name Description
    T[,] hostSrc

    Source

    | Improve this Doc View Source

    CopyToDevice(T[,], SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT)

    Copy from host to device memory

    Declaration
    public void CopyToDevice(T[, ] hostSrc, SizeT SrcXInBytes, SizeT SrcY, SizeT DestXInBytes, SizeT DestY, SizeT widthInBytes, SizeT height, SizeT SrcPitch, SizeT DestPitch)
    Parameters
    Type Name Description
    T[,] hostSrc

    Source

    SizeT SrcXInBytes

    Source X in bytes

    SizeT SrcY

    Source Y

    SizeT DestXInBytes

    Destination X in bytes

    SizeT DestY

    Destination Y

    SizeT widthInBytes

    Width in bytes

    SizeT height

    Height in elements

    SizeT SrcPitch

    Source pitch

    SizeT DestPitch

    Destination pitch

    | Improve this Doc View Source

    CopyToDevice(CUdeviceptr)

    Copy from device to device memory

    Declaration
    public void CopyToDevice(CUdeviceptr deviceSrc)
    Parameters
    Type Name Description
    CUdeviceptr deviceSrc

    Source

    | Improve this Doc View Source

    CopyToDevice(CUdeviceptr, SizeT)

    Copy from device to device memory

    Declaration
    public void CopyToDevice(CUdeviceptr deviceSrc, SizeT pitchSrc)
    Parameters
    Type Name Description
    CUdeviceptr deviceSrc

    Source

    SizeT pitchSrc

    Source pitch

    | Improve this Doc View Source

    CopyToDevice(CUdeviceptr, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT)

    Copy from device to device memory

    Declaration
    public void CopyToDevice(CUdeviceptr deviceSrc, SizeT SrcXInBytes, SizeT SrcY, SizeT DestXInBytes, SizeT DestY, SizeT widthInBytes, SizeT height, SizeT SrcPitch, SizeT DestPitch)
    Parameters
    Type Name Description
    CUdeviceptr deviceSrc

    Source

    SizeT SrcXInBytes

    Source X in bytes

    SizeT SrcY

    Source Y

    SizeT DestXInBytes

    Destination X in bytes

    SizeT DestY

    Destination Y

    SizeT widthInBytes

    Width in bytes

    SizeT height

    Height in elements

    SizeT SrcPitch

    Source pitch

    SizeT DestPitch

    Destination pitch

    | Improve this Doc View Source

    CopyToDevice(CudaDeviceVariable<T>)

    Copy from device to device memory

    Declaration
    public void CopyToDevice(CudaDeviceVariable<T> deviceSrc)
    Parameters
    Type Name Description
    CudaDeviceVariable<T> deviceSrc

    Source

    | Improve this Doc View Source

    CopyToDevice(CudaDeviceVariable<T>, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT)

    Copy from device to device memory

    Declaration
    public void CopyToDevice(CudaDeviceVariable<T> deviceSrc, SizeT SrcXInBytes, SizeT SrcY, SizeT DestXInBytes, SizeT DestY, SizeT widthInBytes, SizeT height, SizeT SrcPitch, SizeT DestPitch)
    Parameters
    Type Name Description
    CudaDeviceVariable<T> deviceSrc

    Source

    SizeT SrcXInBytes

    Source X in bytes

    SizeT SrcY

    Source Y

    SizeT DestXInBytes

    Destination X in bytes

    SizeT DestY

    Destination Y

    SizeT widthInBytes

    Width in bytes

    SizeT height

    Height in elements

    SizeT SrcPitch

    Source pitch

    SizeT DestPitch

    Destination pitch

    | Improve this Doc View Source

    CopyToDevice(CudaPitchedDeviceVariable<T>)

    Copy from device to device memory

    Declaration
    public void CopyToDevice(CudaPitchedDeviceVariable<T> deviceSrc)
    Parameters
    Type Name Description
    CudaPitchedDeviceVariable<T> deviceSrc

    Source

    | Improve this Doc View Source

    CopyToDevice(CudaPitchedDeviceVariable<T>, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT)

    Copy from device to device memory

    Declaration
    public void CopyToDevice(CudaPitchedDeviceVariable<T> deviceSrc, SizeT SrcXInBytes, SizeT SrcY, SizeT DestXInBytes, SizeT DestY, SizeT widthInBytes, SizeT height, SizeT SrcPitch, SizeT DestPitch)
    Parameters
    Type Name Description
    CudaPitchedDeviceVariable<T> deviceSrc

    Source

    SizeT SrcXInBytes

    Source X in bytes

    SizeT SrcY

    Source Y

    SizeT DestXInBytes

    Destination X in bytes

    SizeT DestY

    Destination Y

    SizeT widthInBytes

    Width in bytes

    SizeT height

    Height in elements

    SizeT SrcPitch

    Source pitch

    SizeT DestPitch

    Destination pitch

    | Improve this Doc View Source

    CopyToDevice(IntPtr)

    Copy from Host to device memory

    Declaration
    public void CopyToDevice(IntPtr hostSrc)
    Parameters
    Type Name Description
    System.IntPtr hostSrc

    Source

    | Improve this Doc View Source

    CopyToDevice(IntPtr, SizeT, SizeT)

    Copy from Host to device memory

    Declaration
    public void CopyToDevice(IntPtr hostSrc, SizeT width, SizeT height)
    Parameters
    Type Name Description
    System.IntPtr hostSrc

    Source

    SizeT width

    Width in bytes

    SizeT height

    Height in elements

    | Improve this Doc View Source

    CopyToDevice(IntPtr, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT)

    Copy from host to device memory

    Declaration
    public void CopyToDevice(IntPtr hostSrc, SizeT SrcXInBytes, SizeT SrcY, SizeT DestXInBytes, SizeT DestY, SizeT widthInBytes, SizeT height, SizeT SrcPitch, SizeT DestPitch)
    Parameters
    Type Name Description
    System.IntPtr hostSrc

    Source

    SizeT SrcXInBytes

    Source X in bytes

    SizeT SrcY

    Source Y

    SizeT DestXInBytes

    Destination X in bytes

    SizeT DestY

    Destination Y

    SizeT widthInBytes

    Width in bytes

    SizeT height

    Height in elements

    SizeT SrcPitch

    Source pitch

    SizeT DestPitch

    Destination pitch

    | Improve this Doc View Source

    CopyToHost(T[])

    Copy data from device to host memory

    Declaration
    public void CopyToHost(T[] aHostDest)
    Parameters
    Type Name Description
    T[] aHostDest

    Destination

    | Improve this Doc View Source

    CopyToHost(T[], SizeT, SizeT)

    Copy data from this device to host memory

    Declaration
    public void CopyToHost(T[] hostDest, SizeT width, SizeT height)
    Parameters
    Type Name Description
    T[] hostDest

    Destination

    SizeT width

    Width in elements

    SizeT height

    Height in elements

    | Improve this Doc View Source

    CopyToHost(T[], SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT)

    Copy data from device to host memory

    Declaration
    public void CopyToHost(T[] hostDest, SizeT DestXInBytes, SizeT DestY, SizeT SrcXInBytes, SizeT SrcY, SizeT widthInBytes, SizeT height, SizeT DestPitch, SizeT SrcPitch)
    Parameters
    Type Name Description
    T[] hostDest

    Destination

    SizeT DestXInBytes

    Destination X in bytes

    SizeT DestY

    Destination Y

    SizeT SrcXInBytes

    Source X in bytes

    SizeT SrcY

    Source Y

    SizeT widthInBytes

    Width in bytes

    SizeT height

    Height in elements

    SizeT DestPitch

    Destination pitch

    SizeT SrcPitch

    Source pitch

    | Improve this Doc View Source

    CopyToHost(T[,])

    Copy data from device to host memory. Assumes that aHostDest has no additional line padding.

    Declaration
    public void CopyToHost(T[, ] aHostDest)
    Parameters
    Type Name Description
    T[,] aHostDest

    Destination

    | Improve this Doc View Source

    CopyToHost(T[,], SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT)

    Copy data from device to host memory

    Declaration
    public void CopyToHost(T[, ] hostDest, SizeT DestXInBytes, SizeT DestY, SizeT SrcXInBytes, SizeT SrcY, SizeT widthInBytes, SizeT height, SizeT DestPitch, SizeT SrcPitch)
    Parameters
    Type Name Description
    T[,] hostDest

    Destination

    SizeT DestXInBytes

    Destination X in bytes

    SizeT DestY

    Destination Y

    SizeT SrcXInBytes

    Source X in bytes

    SizeT SrcY

    Source Y

    SizeT widthInBytes

    Width in bytes

    SizeT height

    Height in elements

    SizeT DestPitch

    Destination pitch

    SizeT SrcPitch

    Source pitch

    | Improve this Doc View Source

    CopyToHost(IntPtr)

    Copy data from device to host memory

    Declaration
    public void CopyToHost(IntPtr hostDest)
    Parameters
    Type Name Description
    System.IntPtr hostDest

    IntPtr to destination in host memory

    | Improve this Doc View Source

    CopyToHost(IntPtr, SizeT, SizeT)

    Copy data from device to host memory

    Declaration
    public void CopyToHost(IntPtr hostDest, SizeT width, SizeT height)
    Parameters
    Type Name Description
    System.IntPtr hostDest

    IntPtr to destination in host memory

    SizeT width

    Width in bytes

    SizeT height

    Height in elements

    | Improve this Doc View Source

    CopyToHost(IntPtr, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT, SizeT)

    Copy data from device to host memory

    Declaration
    public void CopyToHost(IntPtr hostDest, SizeT DestXInBytes, SizeT DestY, SizeT SrcXInBytes, SizeT SrcY, SizeT widthInBytes, SizeT height, SizeT DestPitch, SizeT SrcPitch)
    Parameters
    Type Name Description
    System.IntPtr hostDest

    Destination

    SizeT DestXInBytes

    Destination X in bytes

    SizeT DestY

    Destination Y

    SizeT SrcXInBytes

    Source X in bytes

    SizeT SrcY

    Source Y

    SizeT widthInBytes

    Width in bytes

    SizeT height

    Height in elements

    SizeT DestPitch

    Destination pitch

    SizeT SrcPitch

    Source pitch

    | Improve this Doc View Source

    Dispose()

    Dispose

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    For IDisposable

    Declaration
    protected virtual void Dispose(bool fDisposing)
    Parameters
    Type Name Description
    System.Boolean fDisposing
    | Improve this Doc View Source

    Finalize()

    For dispose

    Declaration
    protected void Finalize()
    | Improve this Doc View Source

    Memset(Byte)

    Memset

    Declaration
    public void Memset(byte aValue)
    Parameters
    Type Name Description
    System.Byte aValue
    | Improve this Doc View Source

    Memset(UInt16)

    Memset

    Declaration
    public void Memset(ushort aValue)
    Parameters
    Type Name Description
    System.UInt16 aValue
    | Improve this Doc View Source

    Memset(UInt32)

    Memset

    Declaration
    public void Memset(uint aValue)
    Parameters
    Type Name Description
    System.UInt32 aValue
    | Improve this Doc View Source

    MemsetAsync(Byte, CUstream)

    Memset

    Declaration
    public void MemsetAsync(byte aValue, CUstream stream)
    Parameters
    Type Name Description
    System.Byte aValue
    CUstream stream
    | Improve this Doc View Source

    MemsetAsync(UInt16, CUstream)

    Memset

    Declaration
    public void MemsetAsync(ushort aValue, CUstream stream)
    Parameters
    Type Name Description
    System.UInt16 aValue
    CUstream stream
    | Improve this Doc View Source

    MemsetAsync(UInt32, CUstream)

    Memset

    Declaration
    public void MemsetAsync(uint aValue, CUstream stream)
    Parameters
    Type Name Description
    System.UInt32 aValue
    CUstream stream
    | Improve this Doc View Source

    PeerCopyToDevice(CudaContext, CUdeviceptr, CudaContext)

    Copies from device memory in one context to device memory in another context

    Declaration
    public void PeerCopyToDevice(CudaContext destCtx, CUdeviceptr source, CudaContext sourceCtx)
    Parameters
    Type Name Description
    CudaContext destCtx

    Destination context

    CUdeviceptr source

    Source pointer to device memory

    CudaContext sourceCtx

    Source context

    | Improve this Doc View Source

    PeerCopyToDevice(CudaContext, CUdeviceptr, CudaContext, CUstream)

    Async-Copies from device memory in one context to device memory in another context

    Declaration
    public void PeerCopyToDevice(CudaContext destCtx, CUdeviceptr source, CudaContext sourceCtx, CUstream stream)
    Parameters
    Type Name Description
    CudaContext destCtx

    Destination context

    CUdeviceptr source

    Source pointer to device memory

    CudaContext sourceCtx

    Source context

    CUstream stream
    | Improve this Doc View Source

    PeerCopyToDevice(CudaContext, CudaDeviceVariable<T>, CudaContext)

    Copies from device memory in one context to device memory in another context

    Declaration
    public void PeerCopyToDevice(CudaContext destCtx, CudaDeviceVariable<T> source, CudaContext sourceCtx)
    Parameters
    Type Name Description
    CudaContext destCtx

    Destination context

    CudaDeviceVariable<T> source

    Source pointer to device memory

    CudaContext sourceCtx

    Source context

    | Improve this Doc View Source

    PeerCopyToDevice(CudaContext, CudaDeviceVariable<T>, CudaContext, CUstream)

    Async-Copies from device memory in one context to device memory in another context

    Declaration
    public void PeerCopyToDevice(CudaContext destCtx, CudaDeviceVariable<T> source, CudaContext sourceCtx, CUstream stream)
    Parameters
    Type Name Description
    CudaContext destCtx

    Destination context

    CudaDeviceVariable<T> source

    Source pointer to device memory

    CudaContext sourceCtx

    Source context

    CUstream stream

    Operators

    | Improve this Doc View Source

    Implicit(CudaPitchedDeviceVariable<T> to T[])

    Converts a device variable to a host array

    Declaration
    public static implicit operator T[](CudaPitchedDeviceVariable<T> d)
    Parameters
    Type Name Description
    CudaPitchedDeviceVariable<T> d

    device variable

    Returns
    Type Description
    T[]

    newly allocated host array with values from device memory

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX