Commit e105e6ef authored by incardon's avatar incardon
Browse files

Adding temporal cuda memory

parent 309c3143
...@@ -23,6 +23,14 @@ size_t tot_recv = 0; ...@@ -23,6 +23,14 @@ size_t tot_recv = 0;
std::string program_name; std::string program_name;
#ifdef CUDA_GPU
#include "memory/CudaMemory.cuh"
CudaMemory mem_tmp;
#endif
// Segmentation fault signal handler // Segmentation fault signal handler
void bt_sighandler(int sig, siginfo_t * info, void * ctx_p) void bt_sighandler(int sig, siginfo_t * info, void * ctx_p)
{ {
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
#include "VCluster_meta_function.hpp" #include "VCluster_meta_function.hpp"
#include "util/math_util_complex.hpp" #include "util/math_util_complex.hpp"
#ifdef CUDA_GPU
extern CudaMemory mem_tmp;
#endif
void bt_sighandler(int sig, siginfo_t * info, void * ctx); void bt_sighandler(int sig, siginfo_t * info, void * ctx);
/*! \brief Implementation of VCluster class /*! \brief Implementation of VCluster class
...@@ -986,6 +990,13 @@ static inline void openfpm_init(int *argc, char ***argv) ...@@ -986,6 +990,13 @@ static inline void openfpm_init(int *argc, char ***argv)
openfpm::math::init_getFactorization(); openfpm::math::init_getFactorization();
ofp_initialized = true; ofp_initialized = true;
#ifdef CUDA_GPU
// Initialize temporal memory
mem_tmp.incRef();
#endif
} }
...@@ -1004,6 +1015,14 @@ static inline void openfpm_finalize() ...@@ -1004,6 +1015,14 @@ static inline void openfpm_finalize()
delete_global_v_cluster_private(); delete_global_v_cluster_private();
ofp_initialized = false; ofp_initialized = false;
#ifdef CUDA_GPU
// Release memory
mem_tmp.destroy();
mem_tmp.decRef();
#endif
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment