diff --git a/configure.ac b/configure.ac index 00e2994dde0e4693ac66fb044fee6e1e2da11f12..e64d09d8177660528c3f846620198b61cdef16dd 100755 --- a/configure.ac +++ b/configure.ac @@ -202,12 +202,8 @@ AC_SUBST(BOOST_CPPFLAGS) ####### Checking for GPU support -AX_CUDA - -if test x"$NVCC_EXIST" = x"yes"; then - AC_MSG_CHECKING(whether to build with GPU support) - gpu_support=yes - AC_ARG_ENABLE(gpu, +gpu_support=yes +AC_ARG_ENABLE(gpu, AC_HELP_STRING( [--enable-gpu], [enable gpu support] @@ -215,15 +211,18 @@ if test x"$NVCC_EXIST" = x"yes"; then gpu_support="$enableval" ) - AC_MSG_RESULT($gpu_support) - if test x"$gpu_support" = x"yes"; then - AC_DEFINE([CUDA_GPU],[],[CUDA GPU support]) +AC_MSG_RESULT($gpu_support) + +if test x"$gpu_support" = x"yes"; then + AX_CUDA + + if test x"$NVCC_EXIST" = x"yes"; then + AC_DEFINE([CUDA_GPU],[],[CUDA GPU support]) + else + gpu_support=no fi -else - gpu_support=no fi - # Set this conditional if cuda is wanted # diff --git a/src/Makefile.am b/src/Makefile.am index 0fd3dd7d9e5fd7597f2024a0d542ae940ad28ac9..985eaaafe014c150105f927d7986866eae257e75 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,12 +1,12 @@ -LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(CUDA_LIBS) $(BOOST_THREAD_LIB) - if BUILDCUDA CUDA_SOURCES=memory/CudaMemory.cu else CUDA_SOURCES= endif +LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(CUDA_LIBS) $(BOOST_THREAD_LIB) + 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 diff --git a/src/memory/BHeapMemory.hpp b/src/memory/BHeapMemory.hpp index 6a02117214b467efc93128df250cb77b2684118a..3f2f07479d1744b7219c13d3ca3ffbe9406f18ba 100644 --- a/src/memory/BHeapMemory.hpp +++ b/src/memory/BHeapMemory.hpp @@ -134,6 +134,30 @@ public: return HeapMemory::size(); } + /*! \brief Copy the memory + * + * + */ + BHeapMemory & operator=(const BHeapMemory & mem) + { + buf_sz = mem.buf_sz; + static_cast<HeapMemory *>(this)->operator=(mem); + + return *this; + } + + /*! \brief Copy the memory + * + * + */ + BHeapMemory & operator=(BHeapMemory && mem) + { + buf_sz = mem.buf_sz; + static_cast<HeapMemory *>(this)->operator=(mem); + + return *this; + } + /*! \brief Destroy the internal memory * *