Commit 4ad227b9 authored by incardon's avatar incardon

Fixing BOOST detection

parent 3e577db1
Pipeline #980 failed with stages
in 41 seconds
......@@ -4,7 +4,6 @@ else()
set(CUDA_SOURCES )
endif()
target_include_directories (pdata PUBLIC ${Boost_INCLUDE_DIRS})
add_executable(mem main.cpp memory/HeapMemory.cpp ${CUDA_SOURCES} Memleak_check.cpp)
......@@ -19,6 +18,7 @@ endif()
target_include_directories (mem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
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}/config)
......
......@@ -47,6 +47,10 @@ bool CudaMemory::allocate(size_t sz)
this->sz = sz;
#ifdef FILL_CUDA_MEMORY_WITH_MINUS_ONE
CUDA_SAFE_CALL(cudaMemset(dm,-1,sz))
#endif
return true;
}
......@@ -217,8 +221,14 @@ bool CudaMemory::resize(size_t sz)
if (dm != NULL)
{
if (this->sz < 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
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