MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The HostBuffer helps manage host memory, often used when implementing CPU versions of a function or layer. More...
Public Member Functions | |
HostBuffer (CudaDnn< T > cuda) | |
The constructor. More... | |
void | Dispose () |
Release all resources used. More... | |
void | Free () |
Free the host buffer. More... | |
void | CopyFrom (Blob< T > b, bool bFromDiff=false) |
Copy the gpu data from the blob to the host buffer. More... | |
void | CopyTo (Blob< T > b, bool bToDiff=false) |
Copy from the host buffer to the gpu data of the blob. More... | |
void | CopyFromGpu (int nCount, long hGpu) |
Copy data from the GPU into the host buffer making sure to grow the host buffer capacity if needed. More... | |
void | CopyToGpu (int nCount, long hGpu) |
Copy data from the host buffer into the GPU memory. More... | |
T[] | GetHostData () |
Returns the host buffer data as an array of the base type. More... | |
double[] | GetHostDataAsDouble () |
Returns the host buffer data as an array of doubles. More... | |
float[] | GetHostDataAsFloat () |
Returns the host buffer data as an array of floats. More... | |
void | SetHostData (T[] rgSrc) |
Set the host buffer data, making to expand the capcity if needed. More... | |
Properties | |
long | Handle [get] |
Returns a handle to the host buffer. More... | |
long | Capacity [get] |
Returns the capacity of the host buffer. More... | |
The HostBuffer helps manage host memory, often used when implementing CPU versions of a function or layer.
T | Specifies the base type float or double. Using float is recommended to conserve GPU memory. |
Definition at line 13 of file HostBuffer.cs.
MyCaffe.common.HostBuffer< T >.HostBuffer | ( | CudaDnn< T > | cuda | ) |
The constructor.
cuda | Specifies the CudaDnn link to all low-level functionality. |
Definition at line 23 of file HostBuffer.cs.
void MyCaffe.common.HostBuffer< T >.CopyFrom | ( | Blob< T > | b, |
bool | bFromDiff = false |
||
) |
Copy the gpu data from the blob to the host buffer.
b | Specifies the blob to copy from. |
bFromDiff | Optionally, specifies to topy from the diff (default = false, which copies from the data). |
Definition at line 72 of file HostBuffer.cs.
void MyCaffe.common.HostBuffer< T >.CopyFromGpu | ( | int | nCount, |
long | hGpu | ||
) |
Copy data from the GPU into the host buffer making sure to grow the host buffer capacity if needed.
nCount | Specifies the number of items to copy. |
hGpu | Specifies the source GPU data to copy. |
Definition at line 92 of file HostBuffer.cs.
void MyCaffe.common.HostBuffer< T >.CopyTo | ( | Blob< T > | b, |
bool | bToDiff = false |
||
) |
Copy from the host buffer to the gpu data of the blob.
b | Specifies the blob to copy to. |
bToDiff | Optionally, specifies to copy to the diff (default = false, which copies to the data). |
Definition at line 82 of file HostBuffer.cs.
void MyCaffe.common.HostBuffer< T >.CopyToGpu | ( | int | nCount, |
long | hGpu | ||
) |
Copy data from the host buffer into the GPU memory.
nCount | Specifies the number of items to copy. |
hGpu | Specifies the destination GPU memory where the data is to be copied. |
Definition at line 109 of file HostBuffer.cs.
void MyCaffe.common.HostBuffer< T >.Dispose | ( | ) |
Release all resources used.
Definition at line 33 of file HostBuffer.cs.
void MyCaffe.common.HostBuffer< T >.Free | ( | ) |
Free the host buffer.
Definition at line 57 of file HostBuffer.cs.
T[] MyCaffe.common.HostBuffer< T >.GetHostData | ( | ) |
Returns the host buffer data as an array of the base type.
Definition at line 118 of file HostBuffer.cs.
double[] MyCaffe.common.HostBuffer< T >.GetHostDataAsDouble | ( | ) |
Returns the host buffer data as an array of doubles.
Definition at line 127 of file HostBuffer.cs.
float[] MyCaffe.common.HostBuffer< T >.GetHostDataAsFloat | ( | ) |
Returns the host buffer data as an array of floats.
Definition at line 136 of file HostBuffer.cs.
void MyCaffe.common.HostBuffer< T >.SetHostData | ( | T[] | rgSrc | ) |
Set the host buffer data, making to expand the capcity if needed.
rgSrc | Specifies the source data to set in the host buffer. |
Definition at line 145 of file HostBuffer.cs.
|
get |
Returns the capacity of the host buffer.
Definition at line 49 of file HostBuffer.cs.
|
get |
Returns a handle to the host buffer.
Definition at line 41 of file HostBuffer.cs.