nnlib
GPU-accelerated, C/C++ neural network library.
|
Source file defining methods regarding memory allocation on host. More...
Functions | |
float ** | allocate2DArray (size_t n, size_t m) |
Allocate 2D array. More... | |
float ** | allocate2DArray (size_t n, size_t m, float defaultValue) |
Allocate 2D array with a default value. More... | |
float * | allocate1DArray (size_t n) |
Allocate 1D array. More... | |
float * | allocate1DArray (size_t n, float defaultValue) |
Allocate 1D array with a default value. More... | |
float * | copy1DArray (size_t n, float *original) |
Copy 1D array to a new location. More... | |
void | copy1DArray (size_t n, float *original, float *copy) |
float ** | copy2DArray (size_t n, size_t m, float **original) |
Copy 2D array to a new location. More... | |
void | copy1DFromHostToHost (float *oldLoc, float *newLoc, size_t n) |
Copy a 1D array between two locations on host. More... | |
Source file defining methods regarding memory allocation on host.
float* allocate1DArray | ( | size_t | n | ) |
Allocate 1D array.
n | The size of the array to allocate. |
n
. float* allocate1DArray | ( | size_t | n, |
float | defaultValue | ||
) |
Allocate 1D array with a default value.
n | The size of the array to allocate. |
defaultValue | The default value to fill the array with. |
n
. float** allocate2DArray | ( | size_t | n, |
size_t | m | ||
) |
Allocate 2D array.
The storage of the array is row-wise.
n | The number of rows of the array. |
m | The number of columns of the array. |
n
x m
. float** allocate2DArray | ( | size_t | n, |
size_t | m, | ||
float | defaultValue | ||
) |
Allocate 2D array with a default value.
The storage of the array is row-wise.
n | The number of rows of the array. |
m | The number of columns of the array. |
defaultValue | The default value to fill the array with. |
n
x m
. float* copy1DArray | ( | size_t | n, |
float * | original | ||
) |
Copy 1D array to a new location.
n | The size of the array to copy. |
original | The array to be copied. |
void copy1DFromHostToHost | ( | float * | oldLoc, |
float * | newLoc, | ||
size_t | n | ||
) |
Copy a 1D array between two locations on host.
oldLoc | The data to copy. |
newLoc | Where to copy the data to. |
n | The number of elements of the data to copy. |
float** copy2DArray | ( | size_t | n, |
size_t | m, | ||
float ** | original | ||
) |
Copy 2D array to a new location.
n | The number of rows of the original array. |
m | The number of columns of the original array. |
original | The array to be copied. |