Commit 74b8b271 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Avoiding some compiler warnings from icpc

parent 1af54a9c
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -56,19 +56,19 @@ getElement( const Element* data )
#ifdef __CUDA_ARCH__
   return *data;
#else
   Element result;
#ifdef HAVE_CUDA
   cudaMemcpy( ( void* ) &result, ( void* ) data, sizeof( Element ), cudaMemcpyDeviceToHost );
   TNL_CHECK_CUDA_DEVICE;
#else
   throw Exceptions::CudaSupportMissing();
#endif
   // TODO: For some reason the following does not work after adding
   // #ifdef __CUDA_ARCH__ to Array::getElement and ArrayView::getElement 
   // Probably it might be a problem with lambda function 'kernel' which
   // nvcc probably does not handle properly.
   //MultiDeviceMemoryOperations< void, Devices::Cuda >::template copy< Element, Element, int >( &result, data, 1 );
   #ifdef HAVE_CUDA
      Element result;
      cudaMemcpy( ( void* ) &result, ( void* ) data, sizeof( Element ), cudaMemcpyDeviceToHost );
      TNL_CHECK_CUDA_DEVICE;
      return result;
   #else
      throw Exceptions::CudaSupportMissing();
   #endif
#endif
}

+4 −1
Original line number Diff line number Diff line
@@ -35,7 +35,10 @@ struct MPITypeResolver
         case sizeof( long int ):
            return MPI_LONG;
      }
   };
      // this will never happen thanks to the static_assert above, but icpc is not that smart
      // and complains about missing return statement at the end of non-void function
      throw 0;
   }
};

template<> struct MPITypeResolver< char >
+9 −0
Original line number Diff line number Diff line
@@ -270,11 +270,20 @@ struct SlicedNDArrayBase
      {
         const auto size = sizes.template getSize< dimension >();
         if( SliceInfo::getSliceSize(dimension) > 0 )
// icpc does not consider the condition when printing warnings
#ifdef __INTEL_COMPILER
   #pragma warning push
   #pragma warning disable 39    // division by zero
   #pragma warning disable 179   // right operand of "%" is zero
#endif
            // round to multiple of SliceSize
            return SliceInfo::getSliceSize(dimension) * (
                        size / SliceInfo::getSliceSize(dimension) +
                        ( size % SliceInfo::getSliceSize(dimension) != 0 )
                     );
#ifdef __INTEL_COMPILER
   #pragma warning pop
#endif
         // unmodified
         return size;
      }
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@

#pragma once

#include <cfloat>
#include <limits>

namespace TNL {
namespace Solvers {
@@ -22,7 +22,7 @@ ExplicitSolver()
:  time( 0.0 ),
   stopTime( 0.0 ),
   tau( 0.0 ),
   maxTau( DBL_MAX ),
   maxTau( std::numeric_limits< RealType >::max() ),
   verbosity( 0 ),
   testingMode( false ),
   problem( 0 )//,
+6 −0
Original line number Diff line number Diff line
@@ -172,11 +172,17 @@ private:
      #ifdef __NVCC__
         #pragma push
         #pragma diag_suppress 2361
      #elif defined(__INTEL_COMPILER)
         #pragma warning(push)
         #pragma warning(disable:3291)
      #endif
      template< typename M, M method >
      static constexpr std::true_type is_constexpr_impl( decltype(int{((*method)(), 0U)}) );
      #ifdef __NVCC__
         #pragma pop
      #elif defined(__INTEL_COMPILER)
         // FIXME: this does not work - warning would be shown again...
         //#pragma warning(pop)
      #endif

      template< typename M, M method >