Commit 98033dea authored by incardon's avatar incardon

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

parents cd05d830 46e4994c
......@@ -47,8 +47,8 @@ fi
prefix="$prefix/openfpm_devices"
echo "Installation dir is: $prefix"
AC_PROG_RANLIB
AM_PROG_AR
LT_INIT
AC_SUBST([LIBTOOL_DEPS])
# Checks for programs.
AC_PROG_CXX
......
......@@ -7,6 +7,10 @@ endif
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
mem_SOURCES = main.cpp memory/HeapMemory.cpp $(CUDA_SOURCES) Memleak_check.cpp
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
libofpmmemory_se2_a_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include -DSE_CLASS2
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 \
Memleak_check.hpp util/print_stack.hpp ptr_info.hpp \
util/se_util.hpp
......
......@@ -8,6 +8,8 @@
#define EXTPREALLOC_HPP_
#include <stddef.h>
#include "memory.hpp"
#include <iostream>
/*! Preallocated memory sequence
*
......
......@@ -11,6 +11,8 @@
#include <iostream>
#include <cstdint>
static const int extra_pad = 512;
// If debugging mode include memory leak check
#ifdef SE_CLASS2
#include "Memleak_check.hpp"
......@@ -26,7 +28,7 @@ bool HeapMemory::allocate(size_t sz)
{
//! Allocate the device memory
if (dm == NULL)
dmOrig = new byte[sz+alignement];
dmOrig = new byte[sz+alignement+extra_pad];
else
std::cerr << __FILE__ << ":" << __LINE__ << " error memory already allocated\n";
......@@ -180,7 +182,7 @@ bool HeapMemory::resize(size_t sz)
//! Create a new buffer if sz is bigger than the actual size
byte * tdm;
byte * tdmOrig;
tdmOrig = new byte[sz+alignement];
tdmOrig = new byte[sz+alignement+extra_pad];
#ifdef SE_CLASS2
check_new(tdmOrig,sz+alignement,HEAPMEMORY_EVENT,0);
#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