Commit 0e42a5cd authored by oberhuber's avatar oberhuber
Browse files

Fixing the code to be comatible with Intel compiler.

parent 0b46ef6a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -45,6 +45,12 @@ else()
    AddCompilerFlag( "-O3 -march=native -DNDEBUG -g" )
endif()

get_filename_component( CXX_COMPILER_NAME ${CMAKE_CXX_COMPILER} NAME )
if( CXX_COMPILER_NAME MATCHES "icpc" )
   message( "Intel compiler detected..."    )
   AddCompilerFlag( "-DHAVE_ICPC" )
endif()

#####
# Check for CUDA
#
+20 −0
Original line number Diff line number Diff line
@@ -129,20 +129,28 @@ class tnlStaticFor
   __cuda_callable__
   static void exec()
   {
#ifndef HAVE_ICPC
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
                 tnlStaticForIndexTag< IndexType, end - begin >,
                 LoopBody >::exec();
#else
     tnlAssert( false, );
#endif
   }

   template< typename T >
   __cuda_callable__
   static void exec( T &p )
   {
#ifndef HAVE_ICPC
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
                 tnlStaticForIndexTag< IndexType, end - begin >,
                 LoopBody >::exec( p );
#else
     tnlAssert( false, );
#endif
   }

   template< typename T0,
@@ -150,10 +158,14 @@ class tnlStaticFor
   __cuda_callable__
   static void exec( T0& p0, T1& p1 )
   {
#ifndef HAVE_ICPC
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
                 tnlStaticForIndexTag< IndexType, end - begin >,
                 LoopBody >::exec( p0, p1 );
#else
     tnlAssert( false, );
#endif
   }

   template< typename T0,
@@ -162,10 +174,14 @@ class tnlStaticFor
   __cuda_callable__
   static void exec( T0& p0, T1& p1, T2& p2 )
   {
#ifndef HAVE_ICPC
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
                 tnlStaticForIndexTag< IndexType, end - begin >,
                 LoopBody >::exec( p0, p1, p2 );
#else
     tnlAssert( false, );
#endif
   }

   template< typename T0,
@@ -175,10 +191,14 @@ class tnlStaticFor
   __cuda_callable__
   static void exec( T0& p0, T1& p1, T2& p2, T3& p3 )
   {
#ifndef HAVE_ICPC
      StaticFor< IndexType,
                 tnlStaticForIndexTag< IndexType, begin >,
                 tnlStaticForIndexTag< IndexType, end - begin >,
                 LoopBody >::exec( p0, p1, p2, p3 );
#else
     tnlAssert( false, );
#endif
   }
};

+4 −0
Original line number Diff line number Diff line
@@ -580,6 +580,7 @@ void tnlVectorOperations< tnlCuda >::computePrefixSum( Vector& v,
                                                       typename Vector::IndexType begin,
                                                       typename Vector::IndexType end )
{
   #ifdef HAVE_CUDA
   typedef tnlParallelReductionSum< typename Vector::RealType,
                                    typename Vector::IndexType > OperationType;

@@ -592,6 +593,9 @@ void tnlVectorOperations< tnlCuda >::computePrefixSum( Vector& v,
                                                &v.getData()[ begin ],
                                                operation,
                                                inclusivePrefixSum );
   #else
      tnlCudaSupportMissingMessage;;
   #endif
}

template< typename Vector >
+2 −2
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
 *                                                                         *
 ***************************************************************************/

#ifndef HAVE_NOT_CXX11
#ifndef HAVE_ICPC
#include "tnl-mesh-convert.h"
#endif
#include "tnlConfig.h"
@@ -43,7 +43,7 @@ int main( int argc, char* argv[] )
      conf_desc.printUsage( argv[ 0 ] );
      return EXIT_FAILURE;
   }
#ifndef HAVE_NOT_CXX11
#ifndef HAVE_ICPC
   if( ! convertMesh( parameters ) )
      return EXIT_FAILURE;
#endif