Loading src/core/arrays/tnlSharedArray.h +8 −0 Original line number Diff line number Diff line Loading @@ -44,13 +44,17 @@ class tnlSharedArray : public tnlObject typedef tnlSharedArray< Element, tnlHost, Index > HostType; typedef tnlSharedArray< Element, tnlCuda, Index > CudaType; __cuda_callable__ tnlSharedArray(); __cuda_callable__ tnlSharedArray( Element* _data, const Index _size ); __cuda_callable__ tnlSharedArray( tnlArray< Element, Device, Index >& array ); __cuda_callable__ tnlSharedArray( tnlSharedArray< Element, Device, Index >& array ); static tnlString getType(); Loading @@ -61,17 +65,21 @@ class tnlSharedArray : public tnlObject virtual tnlString getSerializationTypeVirtual() const; __cuda_callable__ void bind( Element* _data, const Index _size ); template< typename Array > __cuda_callable__ void bind( Array& array, IndexType index = 0, IndexType size = 0 ); template< int Size > __cuda_callable__ void bind( tnlStaticArray< Size, Element >& array ); __cuda_callable__ void bind( tnlSharedArray< Element, Device, Index >& array ); void swap( tnlSharedArray< Element, Device, Index >& array ); Loading src/core/arrays/tnlSharedArray_impl.h +8 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ using namespace std; template< typename Element, typename Device, typename Index > __cuda_callable__ tnlSharedArray< Element, Device, Index >::tnlSharedArray() : size( 0 ), data( 0 ) { Loading @@ -39,6 +40,7 @@ tnlSharedArray< Element, Device, Index >::tnlSharedArray() template< typename Element, typename Device, typename Index > __cuda_callable__ tnlSharedArray< Element, Device, Index >::tnlSharedArray( Element* _data, const Index _size ) { Loading @@ -48,6 +50,7 @@ tnlSharedArray< Element, Device, Index >::tnlSharedArray( Element* _data, template< typename Element, typename Device, typename Index > __cuda_callable__ tnlSharedArray< Element, Device, Index >::tnlSharedArray( tnlArray< Element, Device, Index >& array ) { this->bind( array ); Loading @@ -56,6 +59,7 @@ tnlSharedArray< Element, Device, Index >::tnlSharedArray( tnlArray< Element, Dev template< typename Element, typename Device, typename Index > __cuda_callable__ tnlSharedArray< Element, Device, Index >::tnlSharedArray( tnlSharedArray< Element, Device, Index >& array ) { this->bind( array ); Loading Loading @@ -99,6 +103,7 @@ tnlString tnlSharedArray< Element, Device, Index > :: getSerializationTypeVirtua template< typename Element, typename Device, typename Index > __cuda_callable__ void tnlSharedArray< Element, Device, Index > :: bind( Element* data, const Index size ) { Loading @@ -116,6 +121,7 @@ template< typename Element, typename Device, typename Index > template< typename Array > __cuda_callable__ void tnlSharedArray< Element, Device, Index > :: bind( Array& array, IndexType index, IndexType size ) Loading @@ -134,6 +140,7 @@ template< typename Element, typename Device, typename Index > template< int Size > __cuda_callable__ void tnlSharedArray< Element, Device, Index >::bind( tnlStaticArray< Size, Element >& array ) { this->size = Size; Loading @@ -143,6 +150,7 @@ void tnlSharedArray< Element, Device, Index >::bind( tnlStaticArray< Size, Eleme template< typename Element, typename Device, typename Index > __cuda_callable__ void tnlSharedArray< Element, Device, Index > :: bind( tnlSharedArray< Element, Device, Index >& array ) { this -> size = array. getSize(); Loading src/core/tnlFile.h +0 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ #include <core/mfuncs.h> #include <core/tnlAssert.h> #include <core/tnlString.h> #include <core/tnlObject.h> #include <core/tnlHost.h> #include <core/tnlCuda.h> Loading src/core/tnlObject.h +7 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #ifndef tnlObjectH #define tnlObjectH #include <core/tnlCuda.h> #include <core/tnlString.h> class tnlFile; Loading @@ -39,11 +40,9 @@ class tnlObject public: //! Basic constructor __cuda_callable__ tnlObject(); //! Constructor with name tnlObject( const tnlString& name ); /**** * Type getter. This returns the type in C++ style - for example the returned value * may look as follows: "tnlVector< double, tnlCuda >". Loading Loading @@ -72,6 +71,9 @@ class tnlObject bool load( const tnlString& fileName ); //! Destructor // FIXME: __cuda_callable__ would have to be added to every overriding destructor, // even if the object's constructor is not __cuda_callable__ // __cuda_callable__ virtual ~tnlObject(){}; }; Loading @@ -83,4 +85,6 @@ bool getObjectType( const tnlString& file_name, tnlString& type ); bool parseObjectType( const tnlString& objectType, tnlList< tnlString >& parsedObjectType ); #include <core/tnlObject_impl.h> #endif src/core/tnlObject.cpp→src/core/tnlObject_impl.h +5 −6 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ * * ***************************************************************************/ #ifndef tnlObject_H_IMPLEMENTATION #define tnlObject_H_IMPLEMENTATION #include <core/tnlObject.h> #include <debug/tnlDebug.h> #include <core/tnlAssert.h> Loading @@ -27,15 +30,11 @@ const char magic_number[] = "TNLMN"; __cuda_callable__ tnlObject :: tnlObject() { } tnlObject :: tnlObject( const tnlString& _name ) { } tnlString tnlObject :: getType() { return tnlString( "tnlObject" ); Loading Loading @@ -207,4 +206,4 @@ bool parseObjectType( const tnlString& objectType, return true; } #endif /* tnlObject_H_IMPLEMENTATION */ Loading
src/core/arrays/tnlSharedArray.h +8 −0 Original line number Diff line number Diff line Loading @@ -44,13 +44,17 @@ class tnlSharedArray : public tnlObject typedef tnlSharedArray< Element, tnlHost, Index > HostType; typedef tnlSharedArray< Element, tnlCuda, Index > CudaType; __cuda_callable__ tnlSharedArray(); __cuda_callable__ tnlSharedArray( Element* _data, const Index _size ); __cuda_callable__ tnlSharedArray( tnlArray< Element, Device, Index >& array ); __cuda_callable__ tnlSharedArray( tnlSharedArray< Element, Device, Index >& array ); static tnlString getType(); Loading @@ -61,17 +65,21 @@ class tnlSharedArray : public tnlObject virtual tnlString getSerializationTypeVirtual() const; __cuda_callable__ void bind( Element* _data, const Index _size ); template< typename Array > __cuda_callable__ void bind( Array& array, IndexType index = 0, IndexType size = 0 ); template< int Size > __cuda_callable__ void bind( tnlStaticArray< Size, Element >& array ); __cuda_callable__ void bind( tnlSharedArray< Element, Device, Index >& array ); void swap( tnlSharedArray< Element, Device, Index >& array ); Loading
src/core/arrays/tnlSharedArray_impl.h +8 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ using namespace std; template< typename Element, typename Device, typename Index > __cuda_callable__ tnlSharedArray< Element, Device, Index >::tnlSharedArray() : size( 0 ), data( 0 ) { Loading @@ -39,6 +40,7 @@ tnlSharedArray< Element, Device, Index >::tnlSharedArray() template< typename Element, typename Device, typename Index > __cuda_callable__ tnlSharedArray< Element, Device, Index >::tnlSharedArray( Element* _data, const Index _size ) { Loading @@ -48,6 +50,7 @@ tnlSharedArray< Element, Device, Index >::tnlSharedArray( Element* _data, template< typename Element, typename Device, typename Index > __cuda_callable__ tnlSharedArray< Element, Device, Index >::tnlSharedArray( tnlArray< Element, Device, Index >& array ) { this->bind( array ); Loading @@ -56,6 +59,7 @@ tnlSharedArray< Element, Device, Index >::tnlSharedArray( tnlArray< Element, Dev template< typename Element, typename Device, typename Index > __cuda_callable__ tnlSharedArray< Element, Device, Index >::tnlSharedArray( tnlSharedArray< Element, Device, Index >& array ) { this->bind( array ); Loading Loading @@ -99,6 +103,7 @@ tnlString tnlSharedArray< Element, Device, Index > :: getSerializationTypeVirtua template< typename Element, typename Device, typename Index > __cuda_callable__ void tnlSharedArray< Element, Device, Index > :: bind( Element* data, const Index size ) { Loading @@ -116,6 +121,7 @@ template< typename Element, typename Device, typename Index > template< typename Array > __cuda_callable__ void tnlSharedArray< Element, Device, Index > :: bind( Array& array, IndexType index, IndexType size ) Loading @@ -134,6 +140,7 @@ template< typename Element, typename Device, typename Index > template< int Size > __cuda_callable__ void tnlSharedArray< Element, Device, Index >::bind( tnlStaticArray< Size, Element >& array ) { this->size = Size; Loading @@ -143,6 +150,7 @@ void tnlSharedArray< Element, Device, Index >::bind( tnlStaticArray< Size, Eleme template< typename Element, typename Device, typename Index > __cuda_callable__ void tnlSharedArray< Element, Device, Index > :: bind( tnlSharedArray< Element, Device, Index >& array ) { this -> size = array. getSize(); Loading
src/core/tnlFile.h +0 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ #include <core/mfuncs.h> #include <core/tnlAssert.h> #include <core/tnlString.h> #include <core/tnlObject.h> #include <core/tnlHost.h> #include <core/tnlCuda.h> Loading
src/core/tnlObject.h +7 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #ifndef tnlObjectH #define tnlObjectH #include <core/tnlCuda.h> #include <core/tnlString.h> class tnlFile; Loading @@ -39,11 +40,9 @@ class tnlObject public: //! Basic constructor __cuda_callable__ tnlObject(); //! Constructor with name tnlObject( const tnlString& name ); /**** * Type getter. This returns the type in C++ style - for example the returned value * may look as follows: "tnlVector< double, tnlCuda >". Loading Loading @@ -72,6 +71,9 @@ class tnlObject bool load( const tnlString& fileName ); //! Destructor // FIXME: __cuda_callable__ would have to be added to every overriding destructor, // even if the object's constructor is not __cuda_callable__ // __cuda_callable__ virtual ~tnlObject(){}; }; Loading @@ -83,4 +85,6 @@ bool getObjectType( const tnlString& file_name, tnlString& type ); bool parseObjectType( const tnlString& objectType, tnlList< tnlString >& parsedObjectType ); #include <core/tnlObject_impl.h> #endif
src/core/tnlObject.cpp→src/core/tnlObject_impl.h +5 −6 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ * * ***************************************************************************/ #ifndef tnlObject_H_IMPLEMENTATION #define tnlObject_H_IMPLEMENTATION #include <core/tnlObject.h> #include <debug/tnlDebug.h> #include <core/tnlAssert.h> Loading @@ -27,15 +30,11 @@ const char magic_number[] = "TNLMN"; __cuda_callable__ tnlObject :: tnlObject() { } tnlObject :: tnlObject( const tnlString& _name ) { } tnlString tnlObject :: getType() { return tnlString( "tnlObject" ); Loading Loading @@ -207,4 +206,4 @@ bool parseObjectType( const tnlString& objectType, return true; } #endif /* tnlObject_H_IMPLEMENTATION */