Loading src/TNL/Containers/Algorithms/ArrayOperations.h +1 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ class ArrayOperations< Devices::Cuda > template< typename Element > static Element getMemoryElement( const Element* data ); // TODO: does not make sense for CUDA - remove? template< typename Element, typename Index > static Element& getArrayElementReference( Element* data, const Index i ); Loading src/TNL/Containers/Array.h +2 −2 Original line number Diff line number Diff line Loading @@ -135,11 +135,11 @@ class Array : public virtual Object */ bool boundLoad( File& file ); bool boundLoad( const String& fileName ); using Object::save; using Object::load; using Object::save; using Object::boundLoad; ~Array(); Loading src/TNL/Containers/Array_impl.h +22 −42 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ Array( Array< Element, Device, Index >& array, allocationPointer( array.allocationPointer ), referenceCounter( 0 ) { TNL_ASSERT_TRUE( array.getData(), "Empty arrays cannot be bound." ); TNL_ASSERT_LT( begin, array.getSize(), "Begin of array is out of bounds." ); TNL_ASSERT_LE( begin + size, array.getSize(), "End of array is out of bounds." ); Loading Loading @@ -213,6 +214,7 @@ Array< Element, Device, Index >:: bind( Element* data, const Index size ) { TNL_ASSERT_TRUE( data, "Null pointer cannot be bound." ); this->releaseData(); this->data = data; this->size = size; Loading @@ -232,6 +234,7 @@ bind( const ArrayT& array, static_assert( std::is_same< Element, typename ArrayT::ElementType >::value, "ElementType of both arrays must be the same." ); static_assert( std::is_same< Device, typename ArrayT::DeviceType >::value, "DeviceType of both arrays must be the same." ); static_assert( std::is_same< Index, typename ArrayT::IndexType >::value, "IndexType of both arrays must be the same." ); TNL_ASSERT_TRUE( array.getData(), "Empty array cannot be bound." ); TNL_ASSERT_LT( begin, array.getSize(), "Begin of array is out of bounds." ); TNL_ASSERT_LE( begin + size, array.getSize(), "End of array is out of bounds." ); Loading Loading @@ -546,29 +549,6 @@ boundLoad( File& file ) return true; } template< typename Element, typename Device, typename Index > bool Array< Element, Device, Index >:: boundLoad( const String& fileName ) { File file; if( ! file. open( fileName, IOMode::read ) ) { std::cerr << "I am not bale to open the file " << fileName << " for reading." << std::endl; return false; } if( ! this->boundLoad( file ) ) return false; if( ! file. close() ) { std::cerr << "An error occurred when I was closing the file " << fileName << "." << std::endl; return false; } return true; } template< typename Element, typename Device, typename Index > Loading src/TNL/Containers/StaticArray.h +0 −7 Original line number Diff line number Diff line Loading @@ -16,10 +16,6 @@ namespace TNL { namespace Containers { //! Aliases for the coordinates // TODO: Remove this - it is here only because of some legact code enum { tnlX = 0, tnlY, tnlZ }; template< int Size, typename Element > class StaticArray { Loading Loading @@ -91,7 +87,6 @@ class StaticArray protected: Element data[ Size ]; }; template< typename Element > Loading Loading @@ -365,7 +360,6 @@ class StaticArray< 3, Element > protected: Element data[ size ]; }; template< int Size, typename Element > Loading @@ -378,4 +372,3 @@ std::ostream& operator << ( std::ostream& str, const StaticArray< Size, Element #include <TNL/Containers/StaticArray1D_impl.h> #include <TNL/Containers/StaticArray2D_impl.h> #include <TNL/Containers/StaticArray3D_impl.h> src/TNL/Containers/StaticArray1D_impl.h +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #pragma once #include <TNL/param-types.h> #include <TNL/Containers/StaticArray.h> namespace TNL { namespace Containers { Loading Loading
src/TNL/Containers/Algorithms/ArrayOperations.h +1 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ class ArrayOperations< Devices::Cuda > template< typename Element > static Element getMemoryElement( const Element* data ); // TODO: does not make sense for CUDA - remove? template< typename Element, typename Index > static Element& getArrayElementReference( Element* data, const Index i ); Loading
src/TNL/Containers/Array.h +2 −2 Original line number Diff line number Diff line Loading @@ -135,11 +135,11 @@ class Array : public virtual Object */ bool boundLoad( File& file ); bool boundLoad( const String& fileName ); using Object::save; using Object::load; using Object::save; using Object::boundLoad; ~Array(); Loading
src/TNL/Containers/Array_impl.h +22 −42 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ Array( Array< Element, Device, Index >& array, allocationPointer( array.allocationPointer ), referenceCounter( 0 ) { TNL_ASSERT_TRUE( array.getData(), "Empty arrays cannot be bound." ); TNL_ASSERT_LT( begin, array.getSize(), "Begin of array is out of bounds." ); TNL_ASSERT_LE( begin + size, array.getSize(), "End of array is out of bounds." ); Loading Loading @@ -213,6 +214,7 @@ Array< Element, Device, Index >:: bind( Element* data, const Index size ) { TNL_ASSERT_TRUE( data, "Null pointer cannot be bound." ); this->releaseData(); this->data = data; this->size = size; Loading @@ -232,6 +234,7 @@ bind( const ArrayT& array, static_assert( std::is_same< Element, typename ArrayT::ElementType >::value, "ElementType of both arrays must be the same." ); static_assert( std::is_same< Device, typename ArrayT::DeviceType >::value, "DeviceType of both arrays must be the same." ); static_assert( std::is_same< Index, typename ArrayT::IndexType >::value, "IndexType of both arrays must be the same." ); TNL_ASSERT_TRUE( array.getData(), "Empty array cannot be bound." ); TNL_ASSERT_LT( begin, array.getSize(), "Begin of array is out of bounds." ); TNL_ASSERT_LE( begin + size, array.getSize(), "End of array is out of bounds." ); Loading Loading @@ -546,29 +549,6 @@ boundLoad( File& file ) return true; } template< typename Element, typename Device, typename Index > bool Array< Element, Device, Index >:: boundLoad( const String& fileName ) { File file; if( ! file. open( fileName, IOMode::read ) ) { std::cerr << "I am not bale to open the file " << fileName << " for reading." << std::endl; return false; } if( ! this->boundLoad( file ) ) return false; if( ! file. close() ) { std::cerr << "An error occurred when I was closing the file " << fileName << "." << std::endl; return false; } return true; } template< typename Element, typename Device, typename Index > Loading
src/TNL/Containers/StaticArray.h +0 −7 Original line number Diff line number Diff line Loading @@ -16,10 +16,6 @@ namespace TNL { namespace Containers { //! Aliases for the coordinates // TODO: Remove this - it is here only because of some legact code enum { tnlX = 0, tnlY, tnlZ }; template< int Size, typename Element > class StaticArray { Loading Loading @@ -91,7 +87,6 @@ class StaticArray protected: Element data[ Size ]; }; template< typename Element > Loading Loading @@ -365,7 +360,6 @@ class StaticArray< 3, Element > protected: Element data[ size ]; }; template< int Size, typename Element > Loading @@ -378,4 +372,3 @@ std::ostream& operator << ( std::ostream& str, const StaticArray< Size, Element #include <TNL/Containers/StaticArray1D_impl.h> #include <TNL/Containers/StaticArray2D_impl.h> #include <TNL/Containers/StaticArray3D_impl.h>
src/TNL/Containers/StaticArray1D_impl.h +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #pragma once #include <TNL/param-types.h> #include <TNL/Containers/StaticArray.h> namespace TNL { namespace Containers { Loading