Commit cc12fad4 authored by Matthias Messner's avatar Matthias Messner

more merges

parent 0f163780
......@@ -30,6 +30,7 @@ OPTION( SCALFMM_USE_MEM_STATS "Set to ON to profile memory" OFF )
OPTION( SCALFMM_USE_DOUBLE_PRECISION "Set to ON to compile in double precision" OFF )
OPTION( SCALFMM_ATTACHE_SOURCE "Set to ON to compile with -g" OFF )
OPTION( SCALFMM_USE_STARPU "Set to ON to use starpu" OFF )
OPTION( SCALFMM_USE_CUDA "Set to ON to use cuda (with starpu for example)" OFF )
# Test if openmp is here
......@@ -53,6 +54,10 @@ else()
ENDIF()
endif()
# cuda
if( SCALFMM_USE_CUDA )
FIND_PACKAGE(CUDA)
endif()
# starpu
if( SCALFMM_USE_STARPU )
......@@ -71,7 +76,7 @@ endif()
# Attach source code to exec
if( SCALFMM_ATTACHE_SOURCE )
MESSAGE( STATUS "Use -g in compiler flags" )
ADD_DEFINITIONS(-g)
ADD_DEFINITIONS(-g -G)
endif()
# Trace
......@@ -104,8 +109,10 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/Src/ScalFmmConfig.h.cmake
MESSAGE( STATUS "SCALFMM_USE_MEM_STATS = ${SCALFMM_USE_MEM_STATS}" )
# Test if openmp is here
include(FindOpenMP)
find_package (OpenMP)
# include(FindOpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
......
......@@ -12,7 +12,18 @@ file(
GLOB_RECURSE
source_tests_files
./*.cpp
)
)
# Find all cuda files
if( SCALFMM_USE_CUDA )
file(
GLOB_RECURSE
source_cuda_files
./*.cu
)
endif()
# Adding the project sources dir as an include dir
INCLUDE_DIRECTORIES(
......@@ -58,16 +69,25 @@ foreach(exec ${source_tests_files})
# Dependency are OK
if( compile_exec )
add_executable(
${execname}
${exec}
)
if( SCALFMM_USE_CUDA )
CUDA_ADD_EXECUTABLE(
${execname}
${exec}
${source_cuda_files}
)
else()
add_executable(
${execname}
${exec}
)
endif()
target_link_libraries(
${execname}
${scalfmm_lib}
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
${STARPU_LIBRARIES}
)
)
endif()
endforeach(exec)
This diff is collapsed.
......@@ -27,6 +27,7 @@
#include "../../Src/Utils/FTic.hpp"
#include "../../Src/Utils/FBlas.hpp"
#include "../../Src/Kernels/Chebyshev/FChebTensor.hpp"
#include "../../Src/Kernels/Chebyshev/FChebMatrixKernel.hpp"
......@@ -34,6 +35,20 @@
template <int ORDER>
void permuteMatrix(const unsigned int perm[ORDER*ORDER*ORDER], FReal *const Matrix)
{
const unsigned int nnodes = ORDER*ORDER*ORDER;
// allocate temporary memory for matrix
FReal temp[nnodes*nnodes];
// permute rows
for (unsigned int r=0; r<nnodes; ++r)
FBlas::copy(nnodes, Matrix+r, nnodes, temp+perm[r], nnodes);
// permute columns
for (unsigned int c=0; c<nnodes; ++c)
FBlas::copy(nnodes, temp + c * nnodes, Matrix + perm[c] * nnodes);
}
......@@ -115,7 +130,7 @@ int main(int argc, char* argv[])
// permute
const unsigned int pidx = permuter.getPermutationArrayAndIndex(i, j, k, perm);
permuter.permuteMatrix(perm, K0);
permuteMatrix<order>(perm, K0);
if (K[pidx]==NULL) std::cout << " - not existing index " << pidx << std::endl;
......
......@@ -48,10 +48,18 @@ foreach(exec ${source_tests_files})
# Dependency are OK
if( compile_exec )
add_executable(
${execname}
${exec}
)
if( SCALFMM_USE_CUDA )
CUDA_ADD_EXECUTABLE(
${execname}
${exec}
)
else()
add_executable(
${execname}
${exec}
)
endif()
target_link_libraries(
${execname}
${scalfmm_lib}
......
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