Commit c62583ad authored by incardon's avatar incardon
Browse files

Adding align_number_device

parent aa00b03d
Pipeline #2468 failed with stages
in 18 seconds
......@@ -4,8 +4,8 @@ project(openfpm_devices LANGUAGES C CXX)
set(BOOST_INCLUDE ${Boost_INCLUDE_DIR} CACHE PATH "Include directory for BOOST")
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CUDA_STANDARD 11)
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CUDA_STANDARD 14)
find_package(Boost 1.68.0 REQUIRED COMPONENTS unit_test_framework iostreams program_options)
......
......@@ -43,6 +43,21 @@
extern size_t TotCudaMemoryAllocated;
/*! \brief given an alignment and an alignment it return the smallest number numiple of the alignment
* such that the value returned is bigger ot equal that the number given
*
* alignment 8 number 2 it return 8
* alignment 8 number 9 it return 16
*
* \param al alignment
* \param number
*
*/
__device__ inline size_t align_number_device(size_t al, size_t number)
{
return number + ((number % al) != 0)*(al - number % al);
}
//! Is an array to report general error can happen in CUDA
static __device__ unsigned char global_cuda_error_array[256];
......
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