PARALUTION  1.0.0
PARALUTION
allocate_free.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_UTILS_ALLOCATE_FREE_HPP_
2 #define PARALUTION_UTILS_ALLOCATE_FREE_HPP_
3 
4 #include <iostream>
5 
6 // When CUDA backend is available the host memory allocation
7 // can use cudaMallocHost() function for pinned memory
8 // thus the memory transfers to the GPU are faster
9 // and this also enables the async transfers.
10 // Uncomment to use pinned memory
11 //
12 // To force standard CPU allocation comment the following line
13 // #define PARALUTION_CUDA_PINNED_MEMORY
14 
15 namespace paralution {
16 
18 template <typename DataType>
19 void allocate_host(const int size, DataType **ptr);
20 
22 template <typename DataType>
23 void free_host(DataType **ptr);
24 
26 template <typename DataType>
27 void set_to_zero_host(const int size, DataType *ptr);
28 
29 }
30 
31 #endif // PARALUTION_UTILS_ALLOCATE_FREE_HPP_
void allocate_host(const int size, DataType **ptr)
Allocate buffer on the host.
Definition: allocate_free.cpp:26
void set_to_zero_host(const int size, DataType *ptr)
set a buffer to zero on the host
Definition: allocate_free.cpp:127
Definition: backend_manager.cpp:43
void free_host(DataType **ptr)
Free buffer on the host.
Definition: allocate_free.cpp:96