Commit b4f7bf50 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Merge branch 'develop' of geraldine.fjfi.cvut.cz:/local/projects/tnl/tnl into develop

Conflicts:
	src/UnitTests/Containers/VectorTest.cu
parents 3b8be6d7 1d1859fc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 );

+2 −2
Original line number Diff line number Diff line
@@ -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();

+22 −42
Original line number Diff line number Diff line
@@ -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." );

@@ -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;
@@ -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." );

@@ -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 >
+0 −7
Original line number Diff line number Diff line
@@ -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
{
@@ -91,7 +87,6 @@ class StaticArray

   protected:
   Element data[ Size ];

};

template< typename Element >
@@ -365,7 +360,6 @@ class StaticArray< 3, Element >

   protected:
   Element data[ size ];

};

template< int Size, typename Element >
@@ -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>
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#pragma once

#include <TNL/param-types.h>
#include <TNL/Containers/StaticArray.h>

namespace TNL {
namespace Containers {   
Loading