Show / Hide Table of Contents

    Class CudaDirectXInteropResource

    Wrapper for a CUgraphicsResource (directX)

    Inheritance
    System.Object
    CudaDirectXInteropResource
    Implements
    ICudaGraphicsInteropResource
    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 CudaDirectXInteropResource : ICudaGraphicsInteropResource, IDisposable

    Constructors

    | Improve this Doc View Source

    CudaDirectXInteropResource(IntPtr, CUGraphicsRegisterFlags, CudaContext.DirectXVersion)

    Registers a new graphics interop resource for interop with DirectX

    Declaration
    public CudaDirectXInteropResource(IntPtr d3dResource, CUGraphicsRegisterFlags flags, CudaContext.DirectXVersion version)
    Parameters
    Type Name Description
    System.IntPtr d3dResource

    DirectX resource to register

    CUGraphicsRegisterFlags flags

    register Flags

    CudaContext.DirectXVersion version

    DirectX version

    | Improve this Doc View Source

    CudaDirectXInteropResource(IntPtr, CUGraphicsRegisterFlags, CudaContext.DirectXVersion, CUGraphicsMapResourceFlags)

    Registers a new graphics interop resource for interop with DirectX

    Declaration
    public CudaDirectXInteropResource(IntPtr d3dResource, CUGraphicsRegisterFlags flags, CudaContext.DirectXVersion version, CUGraphicsMapResourceFlags mapFlags)
    Parameters
    Type Name Description
    System.IntPtr d3dResource

    DirectX resource to register

    CUGraphicsRegisterFlags flags

    register Flags

    CudaContext.DirectXVersion version

    DirectX version

    CUGraphicsMapResourceFlags mapFlags

    resource mapping flags

    Properties

    | Improve this Doc View Source

    CUgraphicsResource

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

    IsMapped

    Declaration
    public bool IsMapped { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsRegistered

    Declaration
    public bool IsRegistered { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | 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

    GetCUgraphicsResource()

    Declaration
    public CUgraphicsResource GetCUgraphicsResource()
    Returns
    Type Description
    CUgraphicsResource
    | Improve this Doc View Source

    GetMappedArray1D(UInt32, UInt32)

    Returns a CudaArray1D through which the subresource of the mapped graphics resource resource which corresponds to array index arrayIndex and mipmap level mipLevel may be accessed. The pointer value in CudaArray1D may change every time that resource is mapped.

    If the resource is not a texture then it cannot be accessed via an array and ErrorNotMappedAsArray exception is thrwon. If arrayIndex is not a valid array index for the resource then ErrorInvalidValue exception is thrwon. If mipLevel is not a valid mipmap level for the resource then ErrorInvalidValue exception is thrwon. If the resource is not mapped then ErrorNotMapped exception is thrwon.

    Declaration
    public CudaArray1D GetMappedArray1D(uint arrayIndex, uint mipLevel)
    Parameters
    Type Name Description
    System.UInt32 arrayIndex
    System.UInt32 mipLevel
    Returns
    Type Description
    CudaArray1D
    | Improve this Doc View Source

    GetMappedArray2D(UInt32, UInt32)

    Returns a CudaArray2D through which the subresource of the mapped graphics resource resource which corresponds to array index arrayIndex and mipmap level mipLevel may be accessed. The pointer value in CudaArray2D may change every time that resource is mapped.

    If the resource is not a texture then it cannot be accessed via an array and ErrorNotMappedAsArray exception is thrwon. If arrayIndex is not a valid array index for the resource then ErrorInvalidValue exception is thrwon. If mipLevel is not a valid mipmap level for the resource then ErrorInvalidValue exception is thrwon. If the resource is not mapped then ErrorNotMapped exception is thrwon.

    Declaration
    public CudaArray2D GetMappedArray2D(uint arrayIndex, uint mipLevel)
    Parameters
    Type Name Description
    System.UInt32 arrayIndex
    System.UInt32 mipLevel
    Returns
    Type Description
    CudaArray2D
    | Improve this Doc View Source

    GetMappedArray3D(UInt32, UInt32)

    Returns a CudaArray3D through which the subresource of the mapped graphics resource resource which corresponds to array index arrayIndex and mipmap level mipLevel may be accessed. The pointer value in CudaArray3D may change every time that resource is mapped.

    If the resource is not a texture then it cannot be accessed via an array and ErrorNotMappedAsArray exception is thrwon. If arrayIndex is not a valid array index for the resource then ErrorInvalidValue exception is thrwon. If mipLevel is not a valid mipmap level for the resource then ErrorInvalidValue exception is thrwon. If the resource is not mapped then ErrorNotMapped exception is thrwon.

    Declaration
    public CudaArray3D GetMappedArray3D(uint arrayIndex, uint mipLevel)
    Parameters
    Type Name Description
    System.UInt32 arrayIndex
    System.UInt32 mipLevel
    Returns
    Type Description
    CudaArray3D
    | Improve this Doc View Source

    GetMappedCUArray(UInt32, UInt32)

    Returns a CUarray handle through which the subresource of the mapped graphics resource resource which corresponds to array index arrayIndex and mipmap level mipLevel may be accessed. The pointer value in CUarray may change every time that resource is mapped.

    If the resource is not a texture then it cannot be accessed via an array and ErrorNotMappedAsArray exception is thrwon. If arrayIndex is not a valid array index for the resource then ErrorInvalidValue exception is thrwon. If mipLevel is not a valid mipmap level for the resource then ErrorInvalidValue exception is thrwon. If the resource is not mapped then ErrorNotMapped exception is thrwon.

    Declaration
    public CUarray GetMappedCUArray(uint arrayIndex, uint mipLevel)
    Parameters
    Type Name Description
    System.UInt32 arrayIndex
    System.UInt32 mipLevel
    Returns
    Type Description
    CUarray
    | Improve this Doc View Source

    GetMappedCUMipmappedArray()

    Returns a CUmipmappedArray handle through which the subresource of the mapped graphics resource resource which corresponds to array index arrayIndex and mipmap level mipLevel may be accessed. The pointer value in CUmipmappedArray may change every time that resource is mapped.

    If the resource is not a texture then it cannot be accessed via an array and ErrorNotMappedAsArray exception is thrwon. If arrayIndex is not a valid array index for the resource then ErrorInvalidValue exception is thrwon. If mipLevel is not a valid mipmap level for the resource then ErrorInvalidValue exception is thrwon. If the resource is not mapped then ErrorNotMapped exception is thrwon.

    Declaration
    public CUmipmappedArray GetMappedCUMipmappedArray()
    Returns
    Type Description
    CUmipmappedArray
    | Improve this Doc View Source

    GetMappedMipmappedArray(CUArrayFormat, CudaMipmappedArrayNumChannels)

    Returns a CudaMipmappedArray through which the subresource of the mapped graphics resource resource which corresponds to array index arrayIndex and mipmap level mipLevel may be accessed. The pointer value in CudaMipmappedArray may change every time that resource is mapped.

    If the resource is not a texture then it cannot be accessed via an array and ErrorNotMappedAsArray exception is thrwon. If arrayIndex is not a valid array index for the resource then ErrorInvalidValue exception is thrwon. If mipLevel is not a valid mipmap level for the resource then ErrorInvalidValue exception is thrwon. If the resource is not mapped then ErrorNotMapped exception is thrwon.

    Declaration
    public CudaMipmappedArray GetMappedMipmappedArray(CUArrayFormat format, CudaMipmappedArrayNumChannels numChannels)
    Parameters
    Type Name Description
    CUArrayFormat format
    CudaMipmappedArrayNumChannels numChannels
    Returns
    Type Description
    CudaMipmappedArray
    | Improve this Doc View Source

    GetMappedPointer()

    Returns a CUdeviceptr, a device pointer through which the mapped graphics resource may be accessed. The value set in devicePtr may change every time that the resource is mapped.

    If the resource is not a buffer then it cannot be accessed via a pointer and ErrorNotMappedAsPointer exception is thrown. If the resource is not mapped then ErrorNotMapped exception is thrown.

    Declaration
    public CUdeviceptr GetMappedPointer()
    Returns
    Type Description
    CUdeviceptr
    | Improve this Doc View Source

    GetMappedPointer(out CUdeviceptr, out SizeT)

    Returns in devicePtr a pointer through which the mapped graphics resource may be accessed. Returns in size the size of the memory in bytes which may be accessed from that pointer. The value set in devicePtr may change every time that the resource is mapped.

    If the resource is not a buffer then it cannot be accessed via a pointer and ErrorNotMappedAsPointer exception is thrown. If the resource is not mapped then ErrorNotMapped exception is thrown.

    Declaration
    public void GetMappedPointer(out CUdeviceptr devicePtr, out SizeT size)
    Parameters
    Type Name Description
    CUdeviceptr devicePtr
    SizeT size
    | Improve this Doc View Source

    GetMappedPointer<T>()

    Returns device variable through which the mapped graphics resource may be accessed.

    The pointer value in the device variable may change every time that the resource is mapped.

    If the resource is not a buffer then it cannot be accessed via a pointer and ErrorNotMappedAsPointer exception is thrown. If the resource is not mapped then ErrorNotMapped exception is thrown.

    Declaration
    public CudaDeviceVariable<T> GetMappedPointer<T>()
        where T : struct
    Returns
    Type Description
    CudaDeviceVariable<T>
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Map()

    Maps the graphics resource for access by CUDA.

    The resource may be accessed by CUDA until it is unmapped. The graphics API from which the resource was registered should not access any resources while they are mapped by CUDA. If an application does so, the results are undefined.

    This function provides the synchronization guarantee that any graphics calls issued before Map() will complete before any subsequent CUDA work issued in stream begins.

    If the resource is presently mapped for access by CUDA then ErrorAlreadyMapped exception is thrown.

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

    Map(CUstream)

    Maps the graphics resource for access by CUDA.

    The resource may be accessed by CUDA until it is unmapped. The graphics API from which the resource was registered should not access any resources while they are mapped by CUDA. If an application does so, the results are undefined.

    This function provides the synchronization guarantee that any graphics calls issued before Map() will complete before any subsequent CUDA work issued in stream begins.

    If the resource is presently mapped for access by CUDA then ErrorAlreadyMapped exception is thrown.

    Declaration
    public void Map(CUstream stream)
    Parameters
    Type Name Description
    CUstream stream
    | Improve this Doc View Source

    SetIsMapped()

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

    SetIsUnmapped()

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

    SetMapFlags(CUGraphicsMapResourceFlags)

    Set flags for mapping the graphics resource.

    Changes to flags will take effect the next time resource is mapped. See CUGraphicsMapResourceFlags.

    If resource is presently mapped for access by CUDA then ErrorAlreadyMapped exception is thrown.

    Declaration
    public void SetMapFlags(CUGraphicsMapResourceFlags flags)
    Parameters
    Type Name Description
    CUGraphicsMapResourceFlags flags
    | Improve this Doc View Source

    UnMap()

    Unmaps the graphics resource.

    Once unmapped, the resources in resources may not be accessed by CUDA until they are mapped again.

    This function provides the synchronization guarantee that any CUDA work issued in stream before UnMap() will complete before any subsequently issued graphics work begins.

    If the resource is not presently mapped for access by CUDA then ErrorNotMapped exception is thrown.

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

    UnMap(CUstream)

    Unmaps the graphics resource.

    Once unmapped, the resource may not be accessed by CUDA until they are mapped again.

    This function provides the synchronization guarantee that any CUDA work issued in stream before UnMap() will complete before any subsequently issued graphics work begins.

    If the resource is not presently mapped for access by CUDA then ErrorNotMapped exception is thrown.

    Declaration
    public void UnMap(CUstream stream)
    Parameters
    Type Name Description
    CUstream stream
    | Improve this Doc View Source

    Unregister()

    Unregisters the wrapped resource. Better use Dispose(), as the wrapper of the unregistered resource is of no use after unregistering.

    Declaration
    public void Unregister()

    Implements

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