Loading src/TNL/Experimental/Multimaps/EllpackIndexMultimap.h +19 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,13 @@ class EllpackIndexMultimap using ConstValuesAccessorType = EllpackIndexMultimapValues< const IndexType, DeviceType, LocalIndexType >; using ValuesAllocationVectorType = Containers::Vector< LocalIndexType, DeviceType, IndexType >; EllpackIndexMultimap(); EllpackIndexMultimap() = default; template< typename Device_ > EllpackIndexMultimap( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ); template< typename Device_ > EllpackIndexMultimap& operator=( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ); static String getType(); Loading @@ -37,14 +43,20 @@ class EllpackIndexMultimap void setKeysRange( const IndexType& keysRange ); __cuda_callable__ const IndexType getKeysRange() const; bool allocate( const LocalIndexType& maxValuesCount ); bool allocate( const ValuesAllocationVectorType& valuesCounts ); template< typename Device_ > bool setLike( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ); __cuda_callable__ ValuesAccessorType getValues( const IndexType& inputIndex ); __cuda_callable__ ConstValuesAccessorType getValues( const IndexType& inputIndex ) const; bool operator==( const EllpackIndexMultimap< Index, Device, LocalIndex >& other ) const; Loading @@ -63,8 +75,12 @@ class EllpackIndexMultimap Containers::Vector< IndexType, DeviceType, IndexType > values; Containers::Vector< LocalIndexType, DeviceType, IndexType > valuesCounts; IndexType keysRange; LocalIndexType maxValuesCount; IndexType keysRange = 0; LocalIndexType maxValuesCount = 0; // friend class is needed for templated assignment operators template< typename Index_, typename Device_, typename LocalIndex_ > friend class EllpackIndexMultimap; }; template< typename Index, Loading src/TNL/Experimental/Multimaps/EllpackIndexMultimapValues.h +1 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ class EllpackIndexMultimapValues typename std::add_const< LocalIndexType >::type, LocalIndexType >::type; __cuda_callable__ EllpackIndexMultimapValues( IndexType* values, ValuesCountType* valuesCounts, const IndexType& input, Loading src/TNL/Experimental/Multimaps/EllpackIndexMultimapValues_impl.h +1 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ bind( const EllpackIndexMultimapValues& other ) template< typename Index, typename Device, typename LocalIndex > __cuda_callable__ EllpackIndexMultimapValues< Index, Device, LocalIndex >:: EllpackIndexMultimapValues( IndexType* values, ValuesCountType* valuesCounts, Loading src/TNL/Experimental/Multimaps/EllpackIndexMultimap_impl.h +38 −2 Original line number Diff line number Diff line Loading @@ -17,10 +17,26 @@ namespace TNL { template< typename Index, typename Device, typename LocalIndex > template< typename Device_ > EllpackIndexMultimap< Index, Device, LocalIndex >:: EllpackIndexMultimap() : keysRange( 0 ), maxValuesCount( 0 ) EllpackIndexMultimap( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ) { operator=( other ); } template< typename Index, typename Device, typename LocalIndex > template< typename Device_ > EllpackIndexMultimap< Index, Device, LocalIndex >& EllpackIndexMultimap< Index, Device, LocalIndex >:: operator=( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ) { values = other.values; valuesCounts = other.valuesCounts; keysRange = other.keysRange; maxValuesCount = other.maxValuesCount; return *this; } template< typename Index, Loading Loading @@ -63,6 +79,7 @@ setKeysRange( const IndexType& keysRange ) template< typename Index, typename Device, typename LocalIndex > __cuda_callable__ const Index EllpackIndexMultimap< Index, Device, LocalIndex >:: getKeysRange() const Loading Loading @@ -113,6 +130,24 @@ allocate( const ValuesAllocationVectorType& valuesCounts ) template< typename Index, typename Device, typename LocalIndex > template< typename Device_ > bool EllpackIndexMultimap< Index, Device, LocalIndex >:: setLike( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ) { if( ! values.setLike( other.values ) ) return false; if( ! valuesCounts.setLike( other.valuesCounts ) ) return false; keysRange = other.keysRange; maxValuesCount = other.keysRange; return true; } template< typename Index, typename Device, typename LocalIndex > __cuda_callable__ typename EllpackIndexMultimap< Index, Device, LocalIndex >::ValuesAccessorType EllpackIndexMultimap< Index, Device, LocalIndex >:: getValues( const IndexType& inputIndex ) Loading @@ -133,6 +168,7 @@ getValues( const IndexType& inputIndex ) template< typename Index, typename Device, typename LocalIndex > __cuda_callable__ typename EllpackIndexMultimap< Index, Device, LocalIndex >::ConstValuesAccessorType EllpackIndexMultimap< Index, Device, LocalIndex >:: getValues( const IndexType& inputIndex ) const Loading src/TNL/Experimental/Multimaps/StaticEllpackIndexMultimap.h +18 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,13 @@ class StaticEllpackIndexMultimap using ValuesAccessorType = StaticEllpackIndexMultimapValues< ValuesCount, IndexType, DeviceType, LocalIndexType >; using ConstValuesAccessorType = StaticEllpackIndexMultimapValues< ValuesCount, const IndexType, DeviceType, LocalIndexType >; StaticEllpackIndexMultimap(); StaticEllpackIndexMultimap() = default; template< typename Device_ > StaticEllpackIndexMultimap( const StaticEllpackIndexMultimap< ValuesCount, Index, Device_, LocalIndex >& other ); template< typename Device_ > StaticEllpackIndexMultimap& operator=( const StaticEllpackIndexMultimap< ValuesCount, Index, Device_, LocalIndex >& other ); static String getType(); Loading @@ -37,12 +43,18 @@ class StaticEllpackIndexMultimap void setKeysRange( const IndexType& keysRange ); __cuda_callable__ const IndexType getKeysRange() const; bool allocate(); template< typename Device_ > bool setLike( const StaticEllpackIndexMultimap< ValuesCount, Index, Device_, LocalIndex >& other ); __cuda_callable__ ValuesAccessorType getValues( const IndexType& inputIndex ); __cuda_callable__ ConstValuesAccessorType getValues( const IndexType& inputIndex ) const; bool operator==( const StaticEllpackIndexMultimap& other ) const; Loading @@ -60,7 +72,11 @@ class StaticEllpackIndexMultimap protected: Containers::Vector< IndexType, DeviceType, IndexType > values; IndexType keysRange; IndexType keysRange = 0; // friend class is needed for templated assignment operators template< int ValuesCount_, typename Index_, typename Device_, typename LocalIndex_ > friend class StaticEllpackIndexMultimap; }; template< int ValuesCount, Loading Loading
src/TNL/Experimental/Multimaps/EllpackIndexMultimap.h +19 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,13 @@ class EllpackIndexMultimap using ConstValuesAccessorType = EllpackIndexMultimapValues< const IndexType, DeviceType, LocalIndexType >; using ValuesAllocationVectorType = Containers::Vector< LocalIndexType, DeviceType, IndexType >; EllpackIndexMultimap(); EllpackIndexMultimap() = default; template< typename Device_ > EllpackIndexMultimap( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ); template< typename Device_ > EllpackIndexMultimap& operator=( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ); static String getType(); Loading @@ -37,14 +43,20 @@ class EllpackIndexMultimap void setKeysRange( const IndexType& keysRange ); __cuda_callable__ const IndexType getKeysRange() const; bool allocate( const LocalIndexType& maxValuesCount ); bool allocate( const ValuesAllocationVectorType& valuesCounts ); template< typename Device_ > bool setLike( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ); __cuda_callable__ ValuesAccessorType getValues( const IndexType& inputIndex ); __cuda_callable__ ConstValuesAccessorType getValues( const IndexType& inputIndex ) const; bool operator==( const EllpackIndexMultimap< Index, Device, LocalIndex >& other ) const; Loading @@ -63,8 +75,12 @@ class EllpackIndexMultimap Containers::Vector< IndexType, DeviceType, IndexType > values; Containers::Vector< LocalIndexType, DeviceType, IndexType > valuesCounts; IndexType keysRange; LocalIndexType maxValuesCount; IndexType keysRange = 0; LocalIndexType maxValuesCount = 0; // friend class is needed for templated assignment operators template< typename Index_, typename Device_, typename LocalIndex_ > friend class EllpackIndexMultimap; }; template< typename Index, Loading
src/TNL/Experimental/Multimaps/EllpackIndexMultimapValues.h +1 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ class EllpackIndexMultimapValues typename std::add_const< LocalIndexType >::type, LocalIndexType >::type; __cuda_callable__ EllpackIndexMultimapValues( IndexType* values, ValuesCountType* valuesCounts, const IndexType& input, Loading
src/TNL/Experimental/Multimaps/EllpackIndexMultimapValues_impl.h +1 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ bind( const EllpackIndexMultimapValues& other ) template< typename Index, typename Device, typename LocalIndex > __cuda_callable__ EllpackIndexMultimapValues< Index, Device, LocalIndex >:: EllpackIndexMultimapValues( IndexType* values, ValuesCountType* valuesCounts, Loading
src/TNL/Experimental/Multimaps/EllpackIndexMultimap_impl.h +38 −2 Original line number Diff line number Diff line Loading @@ -17,10 +17,26 @@ namespace TNL { template< typename Index, typename Device, typename LocalIndex > template< typename Device_ > EllpackIndexMultimap< Index, Device, LocalIndex >:: EllpackIndexMultimap() : keysRange( 0 ), maxValuesCount( 0 ) EllpackIndexMultimap( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ) { operator=( other ); } template< typename Index, typename Device, typename LocalIndex > template< typename Device_ > EllpackIndexMultimap< Index, Device, LocalIndex >& EllpackIndexMultimap< Index, Device, LocalIndex >:: operator=( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ) { values = other.values; valuesCounts = other.valuesCounts; keysRange = other.keysRange; maxValuesCount = other.maxValuesCount; return *this; } template< typename Index, Loading Loading @@ -63,6 +79,7 @@ setKeysRange( const IndexType& keysRange ) template< typename Index, typename Device, typename LocalIndex > __cuda_callable__ const Index EllpackIndexMultimap< Index, Device, LocalIndex >:: getKeysRange() const Loading Loading @@ -113,6 +130,24 @@ allocate( const ValuesAllocationVectorType& valuesCounts ) template< typename Index, typename Device, typename LocalIndex > template< typename Device_ > bool EllpackIndexMultimap< Index, Device, LocalIndex >:: setLike( const EllpackIndexMultimap< Index, Device_, LocalIndex >& other ) { if( ! values.setLike( other.values ) ) return false; if( ! valuesCounts.setLike( other.valuesCounts ) ) return false; keysRange = other.keysRange; maxValuesCount = other.keysRange; return true; } template< typename Index, typename Device, typename LocalIndex > __cuda_callable__ typename EllpackIndexMultimap< Index, Device, LocalIndex >::ValuesAccessorType EllpackIndexMultimap< Index, Device, LocalIndex >:: getValues( const IndexType& inputIndex ) Loading @@ -133,6 +168,7 @@ getValues( const IndexType& inputIndex ) template< typename Index, typename Device, typename LocalIndex > __cuda_callable__ typename EllpackIndexMultimap< Index, Device, LocalIndex >::ConstValuesAccessorType EllpackIndexMultimap< Index, Device, LocalIndex >:: getValues( const IndexType& inputIndex ) const Loading
src/TNL/Experimental/Multimaps/StaticEllpackIndexMultimap.h +18 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,13 @@ class StaticEllpackIndexMultimap using ValuesAccessorType = StaticEllpackIndexMultimapValues< ValuesCount, IndexType, DeviceType, LocalIndexType >; using ConstValuesAccessorType = StaticEllpackIndexMultimapValues< ValuesCount, const IndexType, DeviceType, LocalIndexType >; StaticEllpackIndexMultimap(); StaticEllpackIndexMultimap() = default; template< typename Device_ > StaticEllpackIndexMultimap( const StaticEllpackIndexMultimap< ValuesCount, Index, Device_, LocalIndex >& other ); template< typename Device_ > StaticEllpackIndexMultimap& operator=( const StaticEllpackIndexMultimap< ValuesCount, Index, Device_, LocalIndex >& other ); static String getType(); Loading @@ -37,12 +43,18 @@ class StaticEllpackIndexMultimap void setKeysRange( const IndexType& keysRange ); __cuda_callable__ const IndexType getKeysRange() const; bool allocate(); template< typename Device_ > bool setLike( const StaticEllpackIndexMultimap< ValuesCount, Index, Device_, LocalIndex >& other ); __cuda_callable__ ValuesAccessorType getValues( const IndexType& inputIndex ); __cuda_callable__ ConstValuesAccessorType getValues( const IndexType& inputIndex ) const; bool operator==( const StaticEllpackIndexMultimap& other ) const; Loading @@ -60,7 +72,11 @@ class StaticEllpackIndexMultimap protected: Containers::Vector< IndexType, DeviceType, IndexType > values; IndexType keysRange; IndexType keysRange = 0; // friend class is needed for templated assignment operators template< int ValuesCount_, typename Index_, typename Device_, typename LocalIndex_ > friend class StaticEllpackIndexMultimap; }; template< int ValuesCount, Loading