Loading CMakeLists.txt +12 −18 Original line number Diff line number Diff line Loading @@ -32,17 +32,10 @@ if( WITH_TEMPLATE_EXPLICIT_INSTANTIATION STREQUAL "yes" ) AddCompilerFlag( "-DTEMPLATE_EXPLICIT_INSTANTIATION " ) endif() if( WITH_CUDA STREQUAL "yes" ) AddCompilerFlag( "-DHAVE_NOT_CXX11 -U_GLIBCXX_ATOMIC_BUILTINS -U_GLIBCXX_USE_INT128" ) set( CUDA_LINKER_OPTIONS "-arch sm_20 -shared" ) else() AddCompilerFlag( "-std=gnu++0x" ) endif() ##### # Check for CUDA # if( NOT WITH_CUDA STREQUAL "no" ) if( WITH_CUDA STREQUAL "yes" ) find_package( CUDA ) if( CUDA_FOUND ) set( BUILD_CUDA TRUE) Loading @@ -50,14 +43,11 @@ if( NOT WITH_CUDA STREQUAL "no" ) set(BUILD_SHARED_LIBS ON) set(CUDA_SEPARABLE_COMPILATION ON) set(CUSPARSE_LIBRARY /usr/local/cuda/lib64/libcusparse.so) # TODO: fix this set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-DHAVE_CUDA) #set( CUDA_ADD_EXECUTABLE_OPTIONS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=\"sm_35,compute_35\" ) #set( CUDA_ADD_LIBRARY_OPTIONS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=\"sm_35,compute_35\" -shared ) AddCompilerFlag( "-DHAVE_NOT_CXX11 -U_GLIBCXX_ATOMIC_BUILTINS -U_GLIBCXX_USE_INT128" ) set( CUDA_ADD_EXECUTABLE_OPTIONS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 ) set( CUDA_ADD_LIBRARY_OPTIONS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -shared ) set( CUDA_LINKER_OPTIONS "-arch sm_20 -shared" ) #### # Check for CUSP # Loading Loading @@ -91,8 +81,12 @@ if( NOT WITH_CUDA STREQUAL "no" ) endif() endif( NOT WITH_CUSPARSE STREQUAL "no" ) else( CUDA_FOUND ) AddCompilerFlag( "-std=gnu++0x" ) endif( CUDA_FOUND ) endif( NOT WITH_CUDA STREQUAL "no" ) else( WITH_CUDA STREQUAL "yes" ) AddCompilerFlag( "-std=gnu++0x" ) endif( WITH_CUDA STREQUAL "yes" ) #### # Check for OpenMP Loading examples/heat-equation/tnl-heat-equation.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ #include <operators/tnlAnalyticNeumannBoundaryConditions.h> #include <operators/tnlNeumannBoundaryConditions.h> #include <functions/tnlConstantFunction.h> #include <functions/tnlAnalyticFunctionAdapter.h> #include "heatEquationSolver.h" //typedef tnlDefaultConfigTag BuildConfig; Loading src/functions/tnlFunctionAdapter.h +27 −27 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class tnlFunctionAdapter #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const RealType& time = 0.0 ) Loading Loading @@ -67,7 +67,7 @@ class tnlFunctionAdapter< Mesh, tnlConstantFunction< FunctionDimensions, Real > #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const RealType& time = 0.0 ) Loading Loading @@ -100,7 +100,7 @@ class tnlFunctionAdapter< tnlGrid< Dimensions, Real, Device, Index >, Function > #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const CoordinatesType& coordinates, Loading Loading @@ -134,7 +134,7 @@ class tnlFunctionAdapter< tnlGrid< Dimensions, Real, Device, Index >, #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const CoordinatesType& coordinates, Loading Loading @@ -163,7 +163,7 @@ class tnlFunctionAdapter< Mesh, tnlVector< Real, Device, Index > > #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const RealType& time = 0.0 ) Loading Loading @@ -206,7 +206,7 @@ class tnlFunctionAdapter< tnlGrid< Dimensions, Real, Device, Index >, #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const CoordinatesType& coordinates, Loading src/solvers/pde/tnlLinearSystemAssembler.h +12 −8 Original line number Diff line number Diff line Loading @@ -150,8 +150,10 @@ class tnlLinearSystemAssembler TraversalUserData& userData, const IndexType index ) { typedef tnlFunctionAdapter< MeshType, RightHandSide > FunctionAdapter; userData.b[ index ] = userData.u[ index ] + userData.tau * userData.rightHandSide.getValue( mesh, FunctionAdapter::getValue( mesh, userData.rightHandSide, index, userData.time ); typename MatrixType::IndexType rowLength; Loading Loading @@ -257,12 +259,14 @@ class tnlLinearSystemAssembler< tnlGrid< Dimensions, Real, Device, Index >, const IndexType index, const CoordinatesType& coordinates ) { typedef typename MeshType::VertexType VertexType; typedef tnlFunctionAdapter< MeshType, RightHandSide > FunctionAdapter; userData.b[ index ] = userData.u[ index ] + userData.tau * userData.rightHandSide.template getValue< VertexType >( mesh, FunctionAdapter::getValue( mesh, userData.rightHandSide, index, coordinates, userData.time ); typename MatrixType::IndexType rowLength; userData.differentialOperator.updateLinearSystem( userData.time, userData.tau, Loading Loading
CMakeLists.txt +12 −18 Original line number Diff line number Diff line Loading @@ -32,17 +32,10 @@ if( WITH_TEMPLATE_EXPLICIT_INSTANTIATION STREQUAL "yes" ) AddCompilerFlag( "-DTEMPLATE_EXPLICIT_INSTANTIATION " ) endif() if( WITH_CUDA STREQUAL "yes" ) AddCompilerFlag( "-DHAVE_NOT_CXX11 -U_GLIBCXX_ATOMIC_BUILTINS -U_GLIBCXX_USE_INT128" ) set( CUDA_LINKER_OPTIONS "-arch sm_20 -shared" ) else() AddCompilerFlag( "-std=gnu++0x" ) endif() ##### # Check for CUDA # if( NOT WITH_CUDA STREQUAL "no" ) if( WITH_CUDA STREQUAL "yes" ) find_package( CUDA ) if( CUDA_FOUND ) set( BUILD_CUDA TRUE) Loading @@ -50,14 +43,11 @@ if( NOT WITH_CUDA STREQUAL "no" ) set(BUILD_SHARED_LIBS ON) set(CUDA_SEPARABLE_COMPILATION ON) set(CUSPARSE_LIBRARY /usr/local/cuda/lib64/libcusparse.so) # TODO: fix this set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-DHAVE_CUDA) #set( CUDA_ADD_EXECUTABLE_OPTIONS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=\"sm_35,compute_35\" ) #set( CUDA_ADD_LIBRARY_OPTIONS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=\"sm_35,compute_35\" -shared ) AddCompilerFlag( "-DHAVE_NOT_CXX11 -U_GLIBCXX_ATOMIC_BUILTINS -U_GLIBCXX_USE_INT128" ) set( CUDA_ADD_EXECUTABLE_OPTIONS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 ) set( CUDA_ADD_LIBRARY_OPTIONS -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -shared ) set( CUDA_LINKER_OPTIONS "-arch sm_20 -shared" ) #### # Check for CUSP # Loading Loading @@ -91,8 +81,12 @@ if( NOT WITH_CUDA STREQUAL "no" ) endif() endif( NOT WITH_CUSPARSE STREQUAL "no" ) else( CUDA_FOUND ) AddCompilerFlag( "-std=gnu++0x" ) endif( CUDA_FOUND ) endif( NOT WITH_CUDA STREQUAL "no" ) else( WITH_CUDA STREQUAL "yes" ) AddCompilerFlag( "-std=gnu++0x" ) endif( WITH_CUDA STREQUAL "yes" ) #### # Check for OpenMP Loading
examples/heat-equation/tnl-heat-equation.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ #include <operators/tnlAnalyticNeumannBoundaryConditions.h> #include <operators/tnlNeumannBoundaryConditions.h> #include <functions/tnlConstantFunction.h> #include <functions/tnlAnalyticFunctionAdapter.h> #include "heatEquationSolver.h" //typedef tnlDefaultConfigTag BuildConfig; Loading
src/functions/tnlFunctionAdapter.h +27 −27 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class tnlFunctionAdapter #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const RealType& time = 0.0 ) Loading Loading @@ -67,7 +67,7 @@ class tnlFunctionAdapter< Mesh, tnlConstantFunction< FunctionDimensions, Real > #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const RealType& time = 0.0 ) Loading Loading @@ -100,7 +100,7 @@ class tnlFunctionAdapter< tnlGrid< Dimensions, Real, Device, Index >, Function > #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const CoordinatesType& coordinates, Loading Loading @@ -134,7 +134,7 @@ class tnlFunctionAdapter< tnlGrid< Dimensions, Real, Device, Index >, #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const CoordinatesType& coordinates, Loading Loading @@ -163,7 +163,7 @@ class tnlFunctionAdapter< Mesh, tnlVector< Real, Device, Index > > #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const RealType& time = 0.0 ) Loading Loading @@ -206,7 +206,7 @@ class tnlFunctionAdapter< tnlGrid< Dimensions, Real, Device, Index >, #ifdef HAVE_CUDA __device__ __host__ #endif RealType getValue( const MeshType& mesh, static RealType getValue( const MeshType& mesh, const FunctionType& function, const IndexType index, const CoordinatesType& coordinates, Loading
src/solvers/pde/tnlLinearSystemAssembler.h +12 −8 Original line number Diff line number Diff line Loading @@ -150,8 +150,10 @@ class tnlLinearSystemAssembler TraversalUserData& userData, const IndexType index ) { typedef tnlFunctionAdapter< MeshType, RightHandSide > FunctionAdapter; userData.b[ index ] = userData.u[ index ] + userData.tau * userData.rightHandSide.getValue( mesh, FunctionAdapter::getValue( mesh, userData.rightHandSide, index, userData.time ); typename MatrixType::IndexType rowLength; Loading Loading @@ -257,12 +259,14 @@ class tnlLinearSystemAssembler< tnlGrid< Dimensions, Real, Device, Index >, const IndexType index, const CoordinatesType& coordinates ) { typedef typename MeshType::VertexType VertexType; typedef tnlFunctionAdapter< MeshType, RightHandSide > FunctionAdapter; userData.b[ index ] = userData.u[ index ] + userData.tau * userData.rightHandSide.template getValue< VertexType >( mesh, FunctionAdapter::getValue( mesh, userData.rightHandSide, index, coordinates, userData.time ); typename MatrixType::IndexType rowLength; userData.differentialOperator.updateLinearSystem( userData.time, userData.tau, Loading