Skip to content
Snippets Groups Projects
Commit acf5333f authored by Vít Hanousek's avatar Vít Hanousek
Browse files

Merge branch 'develop' into mpi

parents 1e041c45 066f518a
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ void tnl_slice_indexing( Scope & scope )
if (!slice.compute(a.getSize(), &start, &stop, &step, &slicelength))
throw py::error_already_set();
if (slicelength != value.getSize())
if (slicelength != (size_t) value.getSize())
throw std::runtime_error("Left and right hand size of slice assignment have different sizes!");
for (size_t i = 0; i < slicelength; ++i) {
......
......@@ -101,7 +101,18 @@ copyMemory( DestinationElement* destination,
if( std::is_same< DestinationElement, SourceElement >::value &&
( std::is_fundamental< DestinationElement >::value ||
std::is_pointer< DestinationElement >::value ) )
{
// GCC 8.1 complains that we bypass a non-trivial copy-constructor
// (in C++17 we could use constexpr if to avoid compiling this branch in that case)
#if defined(__GNUC__) && !defined(__clang__) && !defined(__NVCC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
memcpy( destination, source, size * sizeof( DestinationElement ) );
#if defined(__GNUC__) && !defined(__clang__) && !defined(__NVCC__)
#pragma GCC diagnostic pop
#endif
}
else
for( Index i = 0; i < size; i ++ )
destination[ i ] = ( DestinationElement ) source[ i ];
......
......@@ -30,7 +30,7 @@ void SmartPointersRegister::remove( SmartPointer* pointer, int deviceId )
try {
pointersOnDevices.at( deviceId ).erase( pointer );
}
catch( std::out_of_range ) {
catch( const std::out_of_range& ) {
std::cerr << "Given deviceId " << deviceId << " does not have any pointers yet. "
<< "Requested to remove pointer " << pointer << ". "
<< "This is most likely a bug in the smart pointer." << std::endl;
......@@ -46,7 +46,7 @@ bool SmartPointersRegister::synchronizeDevice( int deviceId )
( *it ).synchronize();
return TNL_CHECK_CUDA_DEVICE;
}
catch( std::out_of_range ) {
catch( const std::out_of_range& ) {
return false;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment