nnlib
GPU-accelerated, C/C++ neural network library.
allocation.h
Go to the documentation of this file.
1 
12 #ifndef NNLIB_ALLOCATION_H
13 #define NNLIB_ALLOCATION_H
14 
15 #include <cstddef>
16 
23 float* allocate1DArray(size_t n);
24 
32 float* allocate1DArray(size_t n, float defaultValue);
33 
43 float** allocate2DArray(size_t n, size_t m);
44 
55 float** allocate2DArray(size_t n, size_t m, float defaultValue);
56 
64 void copy1DFromHostToHost(float* oldLoc, float* newLoc, size_t n);
65 
73 float* copy1DArray(size_t n, float* original);
74 
75 void copy1DArray(size_t n, float* original, float* copy);
76 
85 float** copy2DArray(size_t n, size_t m, float** original);
86 
87 #endif //NNLIB_ALLOCATION_H
float * allocate1DArray(size_t n)
Allocate 1D array.
Definition: allocation.cpp:34
float ** allocate2DArray(size_t n, size_t m)
Allocate 2D array.
Definition: allocation.cpp:12
void copy1DFromHostToHost(float *oldLoc, float *newLoc, size_t n)
Copy a 1D array between two locations on host.
Definition: allocation.cpp:70
float * copy1DArray(size_t n, float *original)
Copy 1D array to a new location.
Definition: allocation.cpp:48
float ** copy2DArray(size_t n, size_t m, float **original)
Copy 2D array to a new location.
Definition: allocation.cpp:60