diff --git a/src/TNL/Containers/StaticArray.hpp b/src/TNL/Containers/StaticArray.hpp index c1ac8e62a7a2e8257d0824c36d7f4caaa443e661..c6af2e4edc7c0bed8347ac47403eb2a6644baad2 100644 --- a/src/TNL/Containers/StaticArray.hpp +++ b/src/TNL/Containers/StaticArray.hpp @@ -102,21 +102,21 @@ template< int Size, typename Value > __cuda_callable__ StaticArray< Size, Value >::StaticArray( const Value v[ Size ] ) { - Algorithms::StaticFor< 0, Size >::exec( detail::AssignArrayFunctor{}, data, v ); + Algorithms::StaticFor< 0, Size >::exec( detail::AssignArrayFunctor{}, getData(), v ); } template< int Size, typename Value > __cuda_callable__ StaticArray< Size, Value >::StaticArray( const Value& v ) { - Algorithms::StaticFor< 0, Size >::exec( detail::AssignValueFunctor{}, data, v ); + Algorithms::StaticFor< 0, Size >::exec( detail::AssignValueFunctor{}, getData(), v ); } template< int Size, typename Value > __cuda_callable__ StaticArray< Size, Value >::StaticArray( const StaticArray< Size, Value >& v ) { - Algorithms::StaticFor< 0, Size >::exec( detail::AssignArrayFunctor{}, data, v.getData() ); + Algorithms::StaticFor< 0, Size >::exec( detail::AssignArrayFunctor{}, getData(), v.getData() ); } template< int Size, typename Value > @@ -228,7 +228,7 @@ template< int Size, typename Value > __cuda_callable__ StaticArray< Size, Value >& StaticArray< Size, Value >::operator=( const StaticArray< Size, Value >& array ) { - Algorithms::StaticFor< 0, Size >::exec( detail::AssignArrayFunctor{}, data, array.getData() ); + Algorithms::StaticFor< 0, Size >::exec( detail::AssignArrayFunctor{}, getData(), array.getData() ); return *this; } @@ -264,7 +264,7 @@ StaticArray< Size, Value >:: operator StaticArray< Size, OtherValue >() const { StaticArray< Size, OtherValue > aux; - Algorithms::StaticFor< 0, Size >::exec( detail::AssignArrayFunctor{}, aux.getData(), data ); + Algorithms::StaticFor< 0, Size >::exec( detail::AssignArrayFunctor{}, aux.getData(), getData() ); return aux; } @@ -272,27 +272,27 @@ template< int Size, typename Value > __cuda_callable__ void StaticArray< Size, Value >::setValue( const ValueType& val ) { - Algorithms::StaticFor< 0, Size >::exec( detail::AssignValueFunctor{}, data, val ); + Algorithms::StaticFor< 0, Size >::exec( detail::AssignValueFunctor{}, getData(), val ); } template< int Size, typename Value > bool StaticArray< Size, Value >::save( File& file ) const { - file.save( data, Size ); + file.save( getData(), Size ); return true; } template< int Size, typename Value > bool StaticArray< Size, Value >::load( File& file) { - file.load( data, Size ); + file.load( getData(), Size ); return true; } template< int Size, typename Value > void StaticArray< Size, Value >::sort() { - detail::StaticArraySort< Size - 1, 0, Value >::exec( data ); + detail::StaticArraySort< Size - 1, 0, Value >::exec( getData() ); } template< int Size, typename Value > diff --git a/src/TNL/Containers/detail/StaticArrayAssignment.h b/src/TNL/Containers/detail/StaticArrayAssignment.h index 9a8d7d3eeb7bdbcfd9814ad3754d4ba9131004b5..6ba6c8e02a1ab81388203cef969eca594bef29c6 100644 --- a/src/TNL/Containers/detail/StaticArrayAssignment.h +++ b/src/TNL/Containers/detail/StaticArrayAssignment.h @@ -21,7 +21,7 @@ struct AssignArrayFunctor { template< typename LeftValue, typename RightValue > __cuda_callable__ - void operator()( int i, LeftValue& data, const RightValue& v ) const + void operator()( int i, LeftValue* data, const RightValue* v ) const { data[ i ] = v[ i ]; } @@ -31,7 +31,7 @@ struct AssignValueFunctor { template< typename LeftValue, typename RightValue > __cuda_callable__ - void operator()( int i, LeftValue& data, const RightValue& v ) const + void operator()( int i, LeftValue* data, const RightValue& v ) const { data[ i ] = v; } @@ -53,7 +53,7 @@ struct StaticArrayAssignment< StaticArray, T, true > static void assign( StaticArray& a, const T& v ) { static_assert( StaticArray::getSize() == T::getSize(), "Cannot assign static arrays with different size." ); - Algorithms::StaticFor< 0, StaticArray::getSize() >::exec( AssignArrayFunctor{}, a.getData(), v ); + Algorithms::StaticFor< 0, StaticArray::getSize() >::exec( AssignArrayFunctor{}, a.getData(), v.getData() ); } }; @@ -68,7 +68,7 @@ struct StaticArrayAssignment< StaticArray, T, false > __cuda_callable__ static void assign( StaticArray& a, const T& v ) { - Algorithms::StaticFor< 0, StaticArray::getSize() >::exec( AssignValueFunctor{}, a, v ); + Algorithms::StaticFor< 0, StaticArray::getSize() >::exec( AssignValueFunctor{}, a.getData(), v ); } };