Class CudaGraphicsInteropResourceCollection
Groupes several wrapped CUgraphicsResources together, so that the map() call to the CUDA API can be efficiently on all resources together.
Inheritance
Implements
Inherited Members
Namespace: ManagedCuda
Assembly: ManagedCuda.dll
Syntax
public class CudaGraphicsInteropResourceCollection : ICollection<ICudaGraphicsInteropResource>, IEnumerable<ICudaGraphicsInteropResource>, IEnumerable, IDisposable
Constructors
| Improve this Doc View SourceCudaGraphicsInteropResourceCollection()
Creates a new CudaGraphicsInteropResourceCollection
Declaration
public CudaGraphicsInteropResourceCollection()
Properties
| Improve this Doc View SourceCount
Returns the number of resources in the collection
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Item[Int32]
Returns the ICudaGraphicsInteropResource at index index.
Declaration
public ICudaGraphicsInteropResource this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index |
Property Value
| Type | Description |
|---|---|
| ICudaGraphicsInteropResource |
Methods
| Improve this Doc View SourceAdd(ICudaGraphicsInteropResource)
Adds a new resource to the collection
Declaration
public void Add(ICudaGraphicsInteropResource item)
Parameters
| Type | Name | Description |
|---|---|---|
| ICudaGraphicsInteropResource | item |
Clear()
Removes all resources in the collection, an disposes every element.
Declaration
public void Clear()
Contains(ICudaGraphicsInteropResource)
Returns true, if the given resource is part of the collection
Declaration
public bool Contains(ICudaGraphicsInteropResource item)
Parameters
| Type | Name | Description |
|---|---|---|
| ICudaGraphicsInteropResource | item |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Dispose()
Dispose
Declaration
public void Dispose()
Dispose(Boolean)
For IDisposable
Declaration
protected virtual void Dispose(bool fDisposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | fDisposing |
Finalize()
For dispose
Declaration
protected void Finalize()
MapAllResources()
Maps all graphics resources for access by CUDA.
The resources may be accessed by CUDA until they are 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 MapAllResources()
will complete before any subsequent CUDA work issued in stream begins.
If any of the resources is presently mapped for access by CUDA then ErrorAlreadyMapped exception is thrown.
Declaration
public void MapAllResources()
MapAllResources(CUstream)
Maps all graphics resources for access by CUDA.
The resources may be accessed by CUDA until they are 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 MapAllResources()
will complete before any subsequent CUDA work issued in stream begins.
If any of the resources is presently mapped for access by CUDA then ErrorAlreadyMapped exception is thrown.
Declaration
public void MapAllResources(CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CUstream | stream |
Remove(ICudaGraphicsInteropResource)
Removes a resource from the collection. The resource is not disposed.
Declaration
public bool Remove(ICudaGraphicsInteropResource item)
Parameters
| Type | Name | Description |
|---|---|---|
| ICudaGraphicsInteropResource | item |
Returns
| Type | Description |
|---|---|
| System.Boolean |
UnmapAllResources()
Maps all graphics resources for access by CUDA.
The resources may be accessed by CUDA until they are 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 MapAllResources()
will complete before any subsequent CUDA work issued in stream begins.
If any of the resources is presently mapped for access by CUDA then ErrorAlreadyMapped exception is thrown.
Declaration
public void UnmapAllResources()
UnmapAllResources(CUstream)
Unmaps all graphics resources.
Once unmapped, the 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 UnmapAllResources()
will complete before any subsequently issued graphics work begins.
If any of the resources are not presently mapped for access by CUDA then ErrorNotMapped exception is thrown.
Declaration
public void UnmapAllResources(CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CUstream | stream |
Explicit Interface Implementations
| Improve this Doc View SourceICollection<ICudaGraphicsInteropResource>.CopyTo(ICudaGraphicsInteropResource[], Int32)
Throws NotImplementedException.
Declaration
void ICollection<ICudaGraphicsInteropResource>.CopyTo(ICudaGraphicsInteropResource[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| ICudaGraphicsInteropResource[] | array | |
| System.Int32 | arrayIndex |
ICollection<ICudaGraphicsInteropResource>.IsReadOnly
Declaration
bool ICollection<ICudaGraphicsInteropResource>.IsReadOnly { get; }
Returns
| Type | Description |
|---|---|
| System.Boolean |
IEnumerable<ICudaGraphicsInteropResource>.GetEnumerator()
Declaration
IEnumerator<ICudaGraphicsInteropResource> IEnumerable<ICudaGraphicsInteropResource>.GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerator<ICudaGraphicsInteropResource> |
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerator |