Commit 06dc94b7 authored by incardon's avatar incardon

Resctructured configure.ac

parent 5142aa0b
......@@ -8,7 +8,6 @@ AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([src/main.cpp])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([src/config/config.h])
m4_ifdef([AX_CHECK_COMPILER_FLAGS],,[m4_include([m4/ax_check_compiler_flags.m4])])
m4_ifdef([ACX_PTHREAD],,[m4_include([m4/acx_pthread.m4])])
m4_ifdef([AX_CHECK_CL],,[m4_include([m4/ax_opencl.m4])])
m4_ifdef([AX_BOOST_BASE],,[m4_include([m4/ax_boost_base.m4])])
......@@ -16,11 +15,9 @@ m4_ifdef([AX_BOOST_PROGRAM_OPTIONS],,[m4_include([m4/ax_boost_program_options.m4
m4_ifdef([AX_BOOST_THREAD],,[m4_include([m4/ax_boost_thread.m4])])
m4_ifdef([ACX_MPI],,[m4_include([m4/acx_mpi.m4])])
m4_ifdef([AX_OPENMP],,[m4_include([m4/ax_openmp.m4])])
m4_ifdef([AX_GCC_X86_CPUID],,[m4_include([m4/ax_gcc_x86_cpuid.m4])])
m4_ifdef([AX_GCC_ARCHFLAG],,[m4_include([m4/ax_gcc_archflag.m4])])
m4_ifdef([AX_CUDA],,[m4_include([m4/ax_cuda.m4])])
CXXFLAGS+=" --std=c++11 "
CXXFLAGS+=" --std=c++11 -march=native -mtune=native "
NVCCFLAGS=" "
INCLUDES_PATH=" "
......@@ -31,10 +28,6 @@ AC_PROG_CXX
AC_CANONICAL_HOST
# Check target architetture
AX_GCC_ARCHFLAG([], [CXXFLAGS="$CXXFLAGS $ax_cv_gcc_archflag"], [])
###### Check for debug compilation
AC_MSG_CHECKING(whether to build with debug information)
......@@ -56,7 +49,7 @@ if test x"$debuger" = x"yes"; then
CXXFLAGS="$CXXFLAGS -g3 -Wall -O0 "
NVCCFLAGS+="$NVCCFLAGS -g -O0 "
else
CXXFLAGS="$CXXFLAGS -Wall -O3 -g3 "
CXXFLAGS="$CXXFLAGS -Wall -O3 -g3 -flto -funroll-loops "
NVCCFLAGS+="$NVCCFLAGS -O3 "
fi
......@@ -87,21 +80,23 @@ INCLUDES_PATH+="-I. -Iconfig -I../../OpenFPM_devices/src"
AX_CUDA
AC_MSG_CHECKING(whether to build with GPU support)
gpu_support=no
AC_ARG_ENABLE(gpu,
AC_HELP_STRING(
[--enable-gpu],
[enable gpu support]
),
gpu_support="$enableval"
)
AC_MSG_RESULT($gpu_support)
if test x"$gpu_support" = x"yes"; then
AC_DEFINE([GPU],[],[GPU support])
if test x"$NVCC_EXIST" = x"yes"; then
AC_MSG_CHECKING(whether to build with GPU support)
gpu_support=yes
AC_ARG_ENABLE(gpu,
AC_HELP_STRING(
[--enable-gpu],
[enable gpu support]
),
gpu_support="$enableval"
)
AC_MSG_RESULT($gpu_support)
if test x"$gpu_support" = x"yes"; then
AC_DEFINE([GPU],[],[GPU support])
fi
else
gpu_support=no
fi
......@@ -113,22 +108,6 @@ AM_CONDITIONAL(BUILDCUDA, test ! x$NVCC = x"no")
###########################
no_avx=no
no_sse42=no
no_sse41=no
no_sse3=no
no_sse2=no
no_sse=no
no_mmx=no
AX_CHECK_COMPILER_FLAGS([-msse4.2],[CXXFLAGS="$CXXFLAGS -mavx"],[no_avx=yes])
AX_CHECK_COMPILER_FLAGS([-msse4.2],[CXXFLAGS="$CXXFLAGS -msse4.2"],[no_sse42=yes])
AX_CHECK_COMPILER_FLAGS([-msse4.1],[CXXFLAGS="$CXXFLAGS -msse4.1"],[no_sse41=yes])
AX_CHECK_COMPILER_FLAGS([-msse3],[CXXFLAGS="$CXXFLAGS -msse3"],[no_sse3=yes])
AX_CHECK_COMPILER_FLAGS([-msse2],[CXXFLAGS="$CXXFLAGS -msse2"],[no_sse2=yes])
AX_CHECK_COMPILER_FLAGS([-msse],[CXXFLAGS="$CXXFLAGS -msse"],[no_sse=yes])
AX_CHECK_COMPILER_FLAGS([-mmmx],[CXXFLAGS="$CXXFLAGS -mmmx"],[no_mmx=yes])
AX_CHECK_COMPILER_FLAGS([-Wno-unused-but-set-variable],[CXXFLAGS="$CXXFLAGS -Wno-unused-but-set-variable"],[])
AC_SUBST(NVCCFLAGS)
AC_SUBST(INCLUDES_PATH)
......@@ -141,64 +120,21 @@ AC_OUTPUT
echo ""
echo "***********************************"
echo "* *"
arch_str="${ax_cv_gcc_archflag#-march=#-mtune=}"
arch_str="${arch_str#-mtune=}"
n_arch_str=${#arch_str}
for (( X=0; X<23-n_arch_str; X++ ))
do
arch_str="$arch_str "
done
echo "* arch: $arch_str*"
if [ test x"$no_sse42" = x"no" ]; then
echo "* sse4.2: yes *"
else
echo "* sse4.2: no *"
fi
if [ test x"$no_sse41" = x"no" ]; then
echo "* sse4.1: yes *"
else
echo "* sse4.1: no *"
fi
if [ test x"$no_sse3" = x"no" ]; then
echo "* sse3: yes *"
else
echo "* sse3: no *"
fi
if [ test x"$no_sse2" = x"no" ]; then
echo "* sse2: yes *"
else
echo "* sse2: no *"
fi
if [ test x"$no_sse" = x"no" ]; then
echo "* sse: yes *"
else
echo "* sse: no *"
fi
if [ test x"$no_mmx" = x"no" ]; then
echo "* mmx: yes *"
else
echo "* mmx: no *"
fi
if [ test x"$profiler" = x"yes" ]; then
echo "* profiler: yes *"
else
echo "* profiler: no *"
fi
if [ test x"$memcheck" = x"yes" ]; then
echo "* memcheck: yes *"
else
echo "* memcheck: no *"
fi
if [ test x"$debuger" = x"yes" ]; then
echo "* debug: yes *"
else
echo "* debug: no *"
fi
if [ test x"$no_64" = x"yes" ]; then
echo "* 64 bit: yes *"
else
echo "* 64 bit: no *"
fi
if [ test x"$mem_check" = x"yes" ]; then
echo "* memory check: yes *"
else
echo "* memory check: no *"
fi
if [ test x"$gpu_support" = x"no" ]; then
echo "* gpu: no *"
else
......
......@@ -36,7 +36,6 @@
#
AC_DEFUN([AX_CUDA],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PATH_PROG])dnl
# Search nvcc compiler
AC_CHECK_PROG([NVCC_EXIST],[nvcc],["yes"],["no"])
......
......@@ -126,6 +126,7 @@ public:
{
this->box = box;
this->gr_cell.setDimensions(div);
Initialize();
}
/*! \brief Set the domain to decompose
......
......@@ -115,23 +115,32 @@ public:
// Object type that the structure store
typedef T value_type;
/*! \brief Default constructor
/*! Initialize the cell list
*
* \param box Domain where this cell list is living
* \param origin of the Cell list
* \param div grid size on each dimension
*
*/
CellList()
void Initialize(Box<dim,T> & box, size_t (&div)[dim], Point<dim,T> & orig, size_t slot=16)
{
SpaceBox<dim,T> sbox;
Initialize(sbox,div,orig,slot);
}
/*! \brief Cell list
/*! Initialize the cell list
*
* \param box Domain where this cell list is living
* \param origin of the Cell list
* \param div grid size on each dimension
*
*/
CellList(SpaceBox<dim,T> & box, size_t (&div)[dim], Point<dim,T> & orig, size_t slot=16)
:CellDecomposer_sm<dim,T>(box,div),slot(slot),orig(orig)
void Initialize(SpaceBox<dim,T> & box, size_t (&div)[dim], Point<dim,T> & orig, size_t slot=16)
{
CellDecomposer_sm<dim,T>::setDimensions(box,div);
this->slot = slot;
this->orig = orig;
// create the array that store the number of particle on each cell and se it to 0
cl_n.resize(this->tot_n_cell);
......@@ -204,6 +213,39 @@ public:
}
}
/*! \brief Default constructor
*
*/
CellList()
{
}
/*! \brief Cell list
*
* \param box Domain where this cell list is living
* \param origin of the Cell list
* \param div grid size on each dimension
*
*/
CellList(Box<dim,T> & box, size_t (&div)[dim], Point<dim,T> & orig, size_t slot=16)
{
SpaceBox<dim,T> sbox(box);
Initialize(sbox,div,orig,slot);
}
/*! \brief Cell list
*
* \param box Domain where this cell list is living
* \param origin of the Cell list
* \param div grid size on each dimension
*
*/
CellList(SpaceBox<dim,T> & box, size_t (&div)[dim], Point<dim,T> & orig, size_t slot=16)
{
Initialize(box,div,orig,slot);
}
/*! \brief Add an element in the cell list
*
* \param pos array that contain the coordinate
......
......@@ -173,6 +173,18 @@ template<unsigned int dim ,typename T> class Point
return result;
}
/*! \brief Set to zero the point coordinate
*
*
*/
void zero()
{
for (size_t i = 0 ; i < dim ; i++)
{
get(i) = 0;
}
}
/*! \brief Point constructor from point
*
* \param p the point
......
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