Loading src/TNL/Containers/Array_impl.h +17 −15 Original line number Diff line number Diff line Loading @@ -175,7 +175,7 @@ setSize( const Index size ) Algorithms::ArrayOperations< Device >::allocateMemory( this->allocationPointer, size ); this->data = this->allocationPointer; this->size = size; if( ! this->allocationPointer ) if( size > 0 && ! this->allocationPointer ) { std::cerr << "I am not able to allocate new array with size " << ( double ) this->size * sizeof( ElementType ) / 1.0e9 << " GB." << std::endl; Loading Loading @@ -370,6 +370,7 @@ operator = ( const Array< Element, Device, Index >& array ) TNL_ASSERT( array. getSize() == this->getSize(), std::cerr << "Source size: " << array. getSize() << std::endl << "Target size: " << this->getSize() << std::endl ); if( this->getSize() > 0 ) Algorithms::ArrayOperations< Device >:: template copyMemory< Element, Element, Loading @@ -391,6 +392,7 @@ operator = ( const ArrayT& array ) TNL_ASSERT( array. getSize() == this->getSize(), std::cerr << "Source size: " << array. getSize() << std::endl << "Target size: " << this->getSize() << std::endl ); if( this->getSize() > 0 ) Algorithms::ArrayOperations< Device, typename ArrayT::DeviceType >:: template copyMemory< Element, typename ArrayT::ElementType, Loading Loading
src/TNL/Containers/Array_impl.h +17 −15 Original line number Diff line number Diff line Loading @@ -175,7 +175,7 @@ setSize( const Index size ) Algorithms::ArrayOperations< Device >::allocateMemory( this->allocationPointer, size ); this->data = this->allocationPointer; this->size = size; if( ! this->allocationPointer ) if( size > 0 && ! this->allocationPointer ) { std::cerr << "I am not able to allocate new array with size " << ( double ) this->size * sizeof( ElementType ) / 1.0e9 << " GB." << std::endl; Loading Loading @@ -370,6 +370,7 @@ operator = ( const Array< Element, Device, Index >& array ) TNL_ASSERT( array. getSize() == this->getSize(), std::cerr << "Source size: " << array. getSize() << std::endl << "Target size: " << this->getSize() << std::endl ); if( this->getSize() > 0 ) Algorithms::ArrayOperations< Device >:: template copyMemory< Element, Element, Loading @@ -391,6 +392,7 @@ operator = ( const ArrayT& array ) TNL_ASSERT( array. getSize() == this->getSize(), std::cerr << "Source size: " << array. getSize() << std::endl << "Target size: " << this->getSize() << std::endl ); if( this->getSize() > 0 ) Algorithms::ArrayOperations< Device, typename ArrayT::DeviceType >:: template copyMemory< Element, typename ArrayT::ElementType, Loading