Commit 4ad227b9 authored by incardon's avatar incardon

Fixing BOOST detection

parent 3e577db1
...@@ -4,7 +4,6 @@ else() ...@@ -4,7 +4,6 @@ else()
set(CUDA_SOURCES ) set(CUDA_SOURCES )
endif() endif()
target_include_directories (pdata PUBLIC ${Boost_INCLUDE_DIRS})
add_executable(mem main.cpp memory/HeapMemory.cpp ${CUDA_SOURCES} Memleak_check.cpp) add_executable(mem main.cpp memory/HeapMemory.cpp ${CUDA_SOURCES} Memleak_check.cpp)
...@@ -19,6 +18,7 @@ endif() ...@@ -19,6 +18,7 @@ endif()
target_include_directories (mem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories (mem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (mem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config) target_include_directories (mem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
target_include_directories (mem PUBLIC ${Boost_INCLUDE_DIRS})
target_include_directories (ofpmmemory PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories (ofpmmemory PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (ofpmmemory PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config) target_include_directories (ofpmmemory PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
......
...@@ -47,6 +47,10 @@ bool CudaMemory::allocate(size_t sz) ...@@ -47,6 +47,10 @@ bool CudaMemory::allocate(size_t sz)
this->sz = sz; this->sz = sz;
#ifdef FILL_CUDA_MEMORY_WITH_MINUS_ONE
CUDA_SAFE_CALL(cudaMemset(dm,-1,sz))
#endif
return true; return true;
} }
...@@ -217,8 +221,14 @@ bool CudaMemory::resize(size_t sz) ...@@ -217,8 +221,14 @@ bool CudaMemory::resize(size_t sz)
if (dm != NULL) if (dm != NULL)
{ {
if (this->sz < sz) if (this->sz < sz)
{
CUDA_SAFE_CALL(cudaMalloc(&tdm,sz)); CUDA_SAFE_CALL(cudaMalloc(&tdm,sz));
#ifdef FILL_CUDA_MEMORY_WITH_MINUS_ONE
CUDA_SAFE_CALL(cudaMemset(tdm,-1,sz));
#endif
}
//! copy from the old buffer to the new one //! copy from the old buffer to the new one
CUDA_SAFE_CALL(cudaMemcpy(tdm,dm,CudaMemory::size(),cudaMemcpyDeviceToDevice)); CUDA_SAFE_CALL(cudaMemcpy(tdm,dm,CudaMemory::size(),cudaMemcpyDeviceToDevice));
......
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