Skip to content
Snippets Groups Projects
Commit 98033dea authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Merge branch 'GPU_test' of git.mpi-cbg.de:openfpm/openfpm_devices into GPU_test

parents cd05d830 46e4994c
No related branches found
No related tags found
No related merge requests found
...@@ -47,8 +47,8 @@ fi ...@@ -47,8 +47,8 @@ fi
prefix="$prefix/openfpm_devices" prefix="$prefix/openfpm_devices"
echo "Installation dir is: $prefix" echo "Installation dir is: $prefix"
AC_PROG_RANLIB LT_INIT
AM_PROG_AR AC_SUBST([LIBTOOL_DEPS])
# Checks for programs. # Checks for programs.
AC_PROG_CXX AC_PROG_CXX
......
...@@ -7,6 +7,10 @@ endif ...@@ -7,6 +7,10 @@ endif
LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(CUDA_LIBS) $(BOOST_THREAD_LIB) LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(CUDA_LIBS) $(BOOST_THREAD_LIB)
LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status libtool
noinst_PROGRAMS = mem noinst_PROGRAMS = mem
mem_SOURCES = main.cpp memory/HeapMemory.cpp $(CUDA_SOURCES) Memleak_check.cpp mem_SOURCES = main.cpp memory/HeapMemory.cpp $(CUDA_SOURCES) Memleak_check.cpp
mem_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include mem_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include
...@@ -22,6 +26,16 @@ libofpmmemory_se2_a_SOURCES = memory/HeapMemory.cpp $(CUDA_SOURCES) memory/PtrMe ...@@ -22,6 +26,16 @@ libofpmmemory_se2_a_SOURCES = memory/HeapMemory.cpp $(CUDA_SOURCES) memory/PtrMe
libofpmmemory_se2_a_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include -DSE_CLASS2 libofpmmemory_se2_a_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include -DSE_CLASS2
libofpmmemory_se2_a_CFLAGS = libofpmmemory_se2_a_CFLAGS =
lib_LTLIBRARIES = libofpmmemory.la libofpmmemory_se2.la
libofpmmemory_la_SOURCES = memory/HeapMemory.cpp $(CUDA_SOURCES) memory/PtrMemory.cpp Memleak_check.cpp
libofpmmemory_la_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include
libofpmmemory_la_CFLAGS =
libofpmmemory_se2_la_SOURCES = memory/HeapMemory.cpp $(CUDA_SOURCES) memory/PtrMemory.cpp Memleak_check.cpp
libofpmmemory_se2_la_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include -DSE_CLASS2
libofpmmemory_se2_la_CFLAGS =
nobase_include_HEADERS = memory/ExtPreAlloc.hpp memory/BHeapMemory.hpp memory/HeapMemory.hpp memory/memory.hpp memory/PtrMemory.hpp \ nobase_include_HEADERS = memory/ExtPreAlloc.hpp memory/BHeapMemory.hpp memory/HeapMemory.hpp memory/memory.hpp memory/PtrMemory.hpp \
Memleak_check.hpp util/print_stack.hpp ptr_info.hpp \ Memleak_check.hpp util/print_stack.hpp ptr_info.hpp \
util/se_util.hpp util/se_util.hpp
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#define EXTPREALLOC_HPP_ #define EXTPREALLOC_HPP_
#include <stddef.h> #include <stddef.h>
#include "memory.hpp"
#include <iostream>
/*! Preallocated memory sequence /*! Preallocated memory sequence
* *
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <iostream> #include <iostream>
#include <cstdint> #include <cstdint>
static const int extra_pad = 512;
// If debugging mode include memory leak check // If debugging mode include memory leak check
#ifdef SE_CLASS2 #ifdef SE_CLASS2
#include "Memleak_check.hpp" #include "Memleak_check.hpp"
...@@ -26,7 +28,7 @@ bool HeapMemory::allocate(size_t sz) ...@@ -26,7 +28,7 @@ bool HeapMemory::allocate(size_t sz)
{ {
//! Allocate the device memory //! Allocate the device memory
if (dm == NULL) if (dm == NULL)
dmOrig = new byte[sz+alignement]; dmOrig = new byte[sz+alignement+extra_pad];
else else
std::cerr << __FILE__ << ":" << __LINE__ << " error memory already allocated\n"; std::cerr << __FILE__ << ":" << __LINE__ << " error memory already allocated\n";
...@@ -180,7 +182,7 @@ bool HeapMemory::resize(size_t sz) ...@@ -180,7 +182,7 @@ bool HeapMemory::resize(size_t sz)
//! Create a new buffer if sz is bigger than the actual size //! Create a new buffer if sz is bigger than the actual size
byte * tdm; byte * tdm;
byte * tdmOrig; byte * tdmOrig;
tdmOrig = new byte[sz+alignement]; tdmOrig = new byte[sz+alignement+extra_pad];
#ifdef SE_CLASS2 #ifdef SE_CLASS2
check_new(tdmOrig,sz+alignement,HEAPMEMORY_EVENT,0); check_new(tdmOrig,sz+alignement,HEAPMEMORY_EVENT,0);
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment