Class CudaRegisteredHostMemory_float1
A variable located in page locked (pinned) host memory. Use this type of variabe for asynchronous memcpy.
cuMemHostRegister doesn't work with managed memory (e.g. normal C# arrays). But you can use cuMemHostRegister for natively allocated memory (Marshal.AllocHGlobal, or a native dll).
Type: float1
Inheritance
Implements
Inherited Members
Namespace: ManagedCuda
Assembly: ManagedCuda.dll
Syntax
public class CudaRegisteredHostMemory_float1 : IDisposable
Constructors
| Improve this Doc View SourceCudaRegisteredHostMemory_float1(IntPtr, SizeT)
Creates a new CudaRegisteredHostMemory_float1 from an existing IntPtr. IntPtr must be page size aligned (4KBytes)!
Declaration
public CudaRegisteredHostMemory_float1(IntPtr hostPointer, SizeT size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | hostPointer | must be page size aligned (4KBytes) |
| SizeT | size | In elements |
Properties
| Improve this Doc View SourceIsRegisterd
Returns register status
Declaration
public bool IsRegisterd { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Item[SizeT]
Access array per element.
Declaration
public float1 this[SizeT index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| SizeT | index | index in elements |
Property Value
| Type | Description |
|---|---|
| float1 |
PinnedHostPointer
Pointer to pinned host memory.
Declaration
public IntPtr PinnedHostPointer { get; }
Property Value
| Type | Description |
|---|---|
| System.IntPtr |
Size
Size in elements
Declaration
public SizeT Size { get; }
Property Value
| Type | Description |
|---|---|
| SizeT |
SizeInBytes
Size in bytes
Declaration
public SizeT SizeInBytes { get; }
Property Value
| Type | Description |
|---|---|
| SizeT |
Methods
| Improve this Doc View SourceAsyncCopyFromArray1D(CUarray, CUstream)
Asynchron copy 1D Array to host
Declaration
public void AsyncCopyFromArray1D(CUarray deviceArray, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CUarray | deviceArray | |
| CUstream | stream |
AsyncCopyFromArray1D(CUarray, CUstream, SizeT)
Asynchron copy 1D Array to host
Declaration
public void AsyncCopyFromArray1D(CUarray deviceArray, CUstream stream, SizeT offset)
Parameters
| Type | Name | Description |
|---|---|---|
| CUarray | deviceArray | |
| CUstream | stream | |
| SizeT | offset |
AsyncCopyFromArray1D(CudaArray1D, CUstream)
Asynchron copy 1D Array to host
Declaration
public void AsyncCopyFromArray1D(CudaArray1D array, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaArray1D | array | |
| CUstream | stream |
AsyncCopyFromArray1D(CudaArray1D, CUstream, SizeT)
Asynchron copy 1D Array to host
Declaration
public void AsyncCopyFromArray1D(CudaArray1D array, CUstream stream, SizeT offset)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaArray1D | array | |
| CUstream | stream | |
| SizeT | offset |
AsyncCopyFromDevice(CUdeviceptr, CUstream)
Asynchron copy device to host
Declaration
public void AsyncCopyFromDevice(CUdeviceptr devicePtr, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CUdeviceptr | devicePtr | |
| CUstream | stream |
AsyncCopyFromDevice(CudaDeviceVariable<float1>, CUstream)
Asynchron copy device to host
Declaration
public void AsyncCopyFromDevice(CudaDeviceVariable<float1> deviceVar, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaDeviceVariable<float1> | deviceVar | |
| CUstream | stream |
AsyncCopyToArray1D(CUarray, CUstream)
Asynchron copy host to 1D Array
Declaration
public void AsyncCopyToArray1D(CUarray deviceArray, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CUarray | deviceArray | |
| CUstream | stream |
AsyncCopyToArray1D(CUarray, CUstream, SizeT)
Asynchron copy host to 1D Array
Declaration
public void AsyncCopyToArray1D(CUarray deviceArray, CUstream stream, SizeT offset)
Parameters
| Type | Name | Description |
|---|---|---|
| CUarray | deviceArray | |
| CUstream | stream | |
| SizeT | offset |
AsyncCopyToArray1D(CudaArray1D, CUstream)
Asynchron copy host to 1D Array
Declaration
public void AsyncCopyToArray1D(CudaArray1D array, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaArray1D | array | |
| CUstream | stream |
AsyncCopyToArray1D(CudaArray1D, CUstream, SizeT)
Asynchron copy host to 1D Array
Declaration
public void AsyncCopyToArray1D(CudaArray1D array, CUstream stream, SizeT offset)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaArray1D | array | |
| CUstream | stream | |
| SizeT | offset |
AsyncCopyToDevice(CUdeviceptr, CUstream)
Asynchron Copy host to device
Declaration
public void AsyncCopyToDevice(CUdeviceptr devicePtr, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CUdeviceptr | devicePtr | |
| CUstream | stream |
AsyncCopyToDevice(CudaDeviceVariable<float1>, CUstream)
Asynchron Copy host to device
Declaration
public void AsyncCopyToDevice(CudaDeviceVariable<float1> deviceVar, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaDeviceVariable<float1> | deviceVar | |
| CUstream | stream |
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()
GetDevicePointer()
Returns the CUdeviceptr for pinned host memory mapped to device memory space. Only valid if context is created with flag MapHost
Declaration
public CUdeviceptr GetDevicePointer()
Returns
| Type | Description |
|---|---|
| CUdeviceptr | Device Pointer |
Register(CUMemHostRegisterFlags)
Page-locks the memory range specified by p and bytesize and maps it
for the device(s) as specified by Flags. This memory range also is added
to the same tracking mechanism as ::cuMemHostAlloc to automatically accelerate
calls to functions such as cuMemcpyHtoD_v2(CUdeviceptr, dim3[], SizeT). Since the memory can be accessed
directly by the device, it can be read or written with much higher bandwidth
than pageable memory that has not been registered. Page-locking excessive
amounts of memory may degrade system performance, since it reduces the amount
of memory available to the system for paging. As a result, this function is
best used sparingly to register staging areas for data exchange between
host and device.
The pointer p and size bytesize must be aligned to the host page size (4 KB).
The memory page-locked by this function must be unregistered with Unregister()
Declaration
public void Register(CUMemHostRegisterFlags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| CUMemHostRegisterFlags | flags |
SynchronCopyFromArray1D(CUarray)
Synchron copy 1D Array to host
Declaration
public void SynchronCopyFromArray1D(CUarray deviceArray)
Parameters
| Type | Name | Description |
|---|---|---|
| CUarray | deviceArray |
SynchronCopyFromArray1D(CUarray, SizeT)
Synchron copy 1D Array to host
Declaration
public void SynchronCopyFromArray1D(CUarray deviceArray, SizeT offset)
Parameters
| Type | Name | Description |
|---|---|---|
| CUarray | deviceArray | |
| SizeT | offset |
SynchronCopyFromArray1D(CudaArray1D)
Synchron copy 1D Array to host
Declaration
public void SynchronCopyFromArray1D(CudaArray1D array)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaArray1D | array |
SynchronCopyFromArray1D(CudaArray1D, SizeT)
Synchron copy 1D Array to host
Declaration
public void SynchronCopyFromArray1D(CudaArray1D array, SizeT offset)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaArray1D | array | |
| SizeT | offset |
SynchronCopyToArray1D(CUarray)
Synchron copy host to 1D Array
Declaration
public void SynchronCopyToArray1D(CUarray deviceArray)
Parameters
| Type | Name | Description |
|---|---|---|
| CUarray | deviceArray |
SynchronCopyToArray1D(CUarray, SizeT)
Synchron copy host to 1D Array
Declaration
public void SynchronCopyToArray1D(CUarray deviceArray, SizeT offset)
Parameters
| Type | Name | Description |
|---|---|---|
| CUarray | deviceArray | |
| SizeT | offset |
SynchronCopyToArray1D(CudaArray1D)
Synchron copy host to 1D Array
Declaration
public void SynchronCopyToArray1D(CudaArray1D array)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaArray1D | array |
SynchronCopyToArray1D(CudaArray1D, SizeT)
Synchron copy host to 1D Array
Declaration
public void SynchronCopyToArray1D(CudaArray1D array, SizeT offset)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaArray1D | array | |
| SizeT | offset |
SynchronCopyToDevice(CUdeviceptr)
Synchron copy host to device
Declaration
public void SynchronCopyToDevice(CUdeviceptr devicePtr)
Parameters
| Type | Name | Description |
|---|---|---|
| CUdeviceptr | devicePtr |
SynchronCopyToDevice(CudaDeviceVariable<float1>)
Synchron copy host to device
Declaration
public void SynchronCopyToDevice(CudaDeviceVariable<float1> devicePtr)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaDeviceVariable<float1> | devicePtr |
SynchronCopyToHost(CUdeviceptr)
Synchron copy device to host
Declaration
public void SynchronCopyToHost(CUdeviceptr devicePtr)
Parameters
| Type | Name | Description |
|---|---|---|
| CUdeviceptr | devicePtr |
SynchronCopyToHost(CudaDeviceVariable<float1>)
Synchron copy device to host
Declaration
public void SynchronCopyToHost(CudaDeviceVariable<float1> devicePtr)
Parameters
| Type | Name | Description |
|---|---|---|
| CudaDeviceVariable<float1> | devicePtr |
Unregister()
Unmaps the memory range whose base address is specified by p, and makes it pageable again.
The base address must be the same one specified to Register(CUMemHostRegisterFlags).
Declaration
public void Unregister()