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

Fixing cinflicts

parent e57d9bd5
No related branches found
No related tags found
No related merge requests found
......@@ -41,25 +41,28 @@ AC_DEFUN([AX_CUDA],
AC_CHECK_PROG([NVCC_EXIST],[nvcc],["yes"],["no"])
AS_IF([test "x$NVCC_EXIST" = "xno"],[],[
NVCC=`which nvcc`
# Set CUDA_CFLAGS to $NVCC, where substring "bin/nvcc"
# is substituted by "include".
CUDA_CFLAGS=" -I${NVCC%bin//nvcc}"
CUDA_CFLAGS=" -I${CUDA_CFLAGS%bin/nvcc}"
CUDA_CFLAGS=" ${NVCC%bin//nvcc}"
CUDA_CFLAGS=" ${CUDA_CFLAGS%bin/nvcc}"
CUDA_CFLAGS=" -I${CUDA_CFLAGS}include"
#Set CUDA_CFLAGS to $NVCC, where substring "bin/nvcc"
#is substituted by "lib".
CUDA_LIBS=" -L${NVCC%bin//nvcc}"
CUDA_LIBS=" -L${CUDA_LIBS%bin/nvcc}"
CUDA_LIBS="${NVCC%bin//nvcc}"
CUDA_LIBS="${CUDA_LIBS%bin/nvcc}"
CUDA_PATH=$CUDA_LIBS
CUDA_LIBS=" -L${CUDA_LIBS}lib"
# If $build_cpu contains "_64", append "64" to CUDA_LIBS
AS_IF([echo $build_cpu | grep -q "_64"],
[
AS_IF([ test -d {CUDA_LIBS}lib64 ], [ CUDA_LIBS+="64" ])
AS_IF([ ! command -v bumblebee >/dev/null ], [
CUDA_LIBS+=" -L/usr/lib64/nvidia-bumblebee/ "
AS_IF([ test -d $CUDA_PATH/lib64 ], [ CUDA_LIBS+="64" ], [])
# Be carefull the return code 0 mean true return code 1 mean false
AS_IF([ command -v bumblebeed >/dev/null ], [ CUDA_LIBS+=" -L/usr/lib64/nvidia-bumblebee/ " ],
[
echo "bumblebee, NVIDIA optimus, not found"
])
AS_IF([ test -d /usr/local/cuda/lib64 ], [ CUDA_LIBS+=" -L/usr/local/cuda/lib64 " ],
[
......@@ -69,7 +72,7 @@ AS_IF([test "x$NVCC_EXIST" = "xno"],[],[
# Append " -lcuda -lcudart" to CUDA_LIBS
CUDA_LIBS+=" -lcuda -lcudart"
# Make variables available in Makefile.am
AC_SUBST([CUDA_CFLAGS])
AC_SUBST([CUDA_LIBS])
......
......@@ -275,13 +275,7 @@ void CudaMemory::deviceToHost()
CUDA_SAFE_CALL(cudaMemcpy(hm,dm,sz,cudaMemcpyDeviceToHost));
}
<<<<<<< HEAD
=======
>>>>>>> 98033dea8fd01877d50de6bb96078f8b373a4c5a
/*! \brief Return a readable pointer with your data
*
* \return a readable pointer with your data
......@@ -301,6 +295,16 @@ const void * CudaMemory::getPointer() const
return hm;
}
/*! \brief fill host and device memory with the selected byte
*
*
*/
void CudaMemory::fill(unsigned char c)
{
CUDA_SAFE_CALL(cudaMemset(dm,c,size()));
memset(hm,c,size());
}
/*! \brief Return the CUDA device pointer
*
* \return CUDA device pointer
......@@ -319,7 +323,6 @@ void * CudaMemory::getDevicePointer()
return dm;
}
<<<<<<< HEAD
/*! \brief Return the CUDA device pointer (Do not copy to device)
*
* \return CUDA device pointer
......@@ -329,6 +332,4 @@ void * CudaMemory::getDevicePointerNoCopy()
{
return dm;
}
=======
>>>>>>> 98033dea8fd01877d50de6bb96078f8b373a4c5a
......@@ -95,6 +95,9 @@ public:
//! get the device pointer, but do not copy the memory from host to device
virtual void * getDevicePointerNoCopy();
//! fill the buffer with a byte
virtual void fill(unsigned char c);
//! This function notify that the device memory is not sync with
//! the host memory, is called when a task is performed that write
//! on the buffer
......@@ -115,7 +118,7 @@ public:
{
return ref_cnt;
}
/*! \brief Allocated Memory is never initialized
*
* \return false
......
......@@ -82,6 +82,15 @@ public:
//! flush the memory
virtual bool flush() {return mem->flush();};
/*! \brief fill host and device memory with the selected byte
*
*
*/
virtual void fill(unsigned char c)
{
mem->fill(c);
}
/*! \brief Allocate a chunk of memory
*
* Allocate a chunk of memory
......
......@@ -18,6 +18,16 @@ static const int extra_pad = 512;
#include "Memleak_check.hpp"
#endif
/*! \brief fill host and device memory with the selected byte
*
* \param byte to fill
*
*/
void HeapMemory::fill(unsigned char c)
{
memset(dm,c,size());
}
/*! \brief Allocate a chunk of memory
*
* \param sz size of the chunk of memory to allocate in byte
......
......@@ -87,6 +87,12 @@ public:
//! getPointer() getDevicePointer and getDevicePointerNoCopy() are equivalents
virtual void * getDevicePointerNoCopy();
/*! \brief fill host and device memory with the selected byte
*
*
*/
virtual void fill(unsigned char c);
//! Do nothing
virtual void deviceToHost(){};
......
......@@ -19,6 +19,16 @@
#include "Memleak_check.hpp"
#endif
/*! \brief fill memory with the selected byte
*
* \param byte to fill
*
*/
void PtrMemory::fill(unsigned char c)
{
memset(dm,c,this->size());
}
/*! \brief Allocate a chunk of memory
*
* \param sz size of the chunk of memory to allocate in byte
......
......@@ -88,6 +88,12 @@ public:
//! Do nothing
virtual void deviceToHost(){};
/*! \brief fill memory with the selected byte
*
*
*/
virtual void fill(unsigned char c);
//! Increment the reference counter
virtual void incRef()
{ref_cnt++;}
......
......@@ -137,6 +137,11 @@ class memory
*/
virtual void * getDevicePointerNoCopy() = 0;
/*! \brief Fill the buffer with a particular byte
*
*
*/
virtual void fill(unsigned char c) = 0;
};
#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