Loading src/TNL/Algorithms/Sorting/BubbleSort.h +4 −2 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ #include <algorithm> #include <TNL/Assert.h> #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { namespace Algorithms { Loading @@ -24,7 +25,8 @@ struct BubbleSort template< typename Device, typename Index, typename Compare, typename Swap > void static inplaceSort( const Index begin, const Index end, Compare& compare, Swap& swap ) { if( std::is_same< Device, Devices::Host >::value ) if( std::is_same< Device, Devices::Host >::value || std::is_same< Device, Devices::Sequential >::value ) { Index left( begin ), right( end -1 ); while( left < right ) Loading Loading @@ -53,7 +55,7 @@ struct BubbleSort } } else TNL_ASSERT( false, std::cerr << "inplace bubble sort is implemented only for CPU" << std::endl ); throw Exceptions::NotImplementedError(); } }; Loading src/TNL/Algorithms/Sorting/DefaultSorter.h +12 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,12 @@ struct DefaultSorter< Devices::Host > using SorterType = Algorithms::Sorting::STLSort; }; template<> struct DefaultSorter< Devices::Sequential > { using SorterType = Algorithms::Sorting::STLSort; }; template<> struct DefaultSorter< Devices::Cuda > { Loading @@ -50,6 +56,12 @@ struct DefaultInplaceSorter< Devices::Host > using SorterType = Algorithms::Sorting::BubbleSort; }; template<> struct DefaultInplaceSorter< Devices::Sequential > { using SorterType = Algorithms::Sorting::BubbleSort; }; template<> struct DefaultInplaceSorter< Devices::Cuda > { Loading src/UnitTests/Algorithms/Sorting/BubbleSortTest.su→src/UnitTests/Algorithms/Sorting/BubbleSortTest.cu +0 −0 File moved. View file Loading
src/TNL/Algorithms/Sorting/BubbleSort.h +4 −2 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ #include <algorithm> #include <TNL/Assert.h> #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { namespace Algorithms { Loading @@ -24,7 +25,8 @@ struct BubbleSort template< typename Device, typename Index, typename Compare, typename Swap > void static inplaceSort( const Index begin, const Index end, Compare& compare, Swap& swap ) { if( std::is_same< Device, Devices::Host >::value ) if( std::is_same< Device, Devices::Host >::value || std::is_same< Device, Devices::Sequential >::value ) { Index left( begin ), right( end -1 ); while( left < right ) Loading Loading @@ -53,7 +55,7 @@ struct BubbleSort } } else TNL_ASSERT( false, std::cerr << "inplace bubble sort is implemented only for CPU" << std::endl ); throw Exceptions::NotImplementedError(); } }; Loading
src/TNL/Algorithms/Sorting/DefaultSorter.h +12 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,12 @@ struct DefaultSorter< Devices::Host > using SorterType = Algorithms::Sorting::STLSort; }; template<> struct DefaultSorter< Devices::Sequential > { using SorterType = Algorithms::Sorting::STLSort; }; template<> struct DefaultSorter< Devices::Cuda > { Loading @@ -50,6 +56,12 @@ struct DefaultInplaceSorter< Devices::Host > using SorterType = Algorithms::Sorting::BubbleSort; }; template<> struct DefaultInplaceSorter< Devices::Sequential > { using SorterType = Algorithms::Sorting::BubbleSort; }; template<> struct DefaultInplaceSorter< Devices::Cuda > { Loading
src/UnitTests/Algorithms/Sorting/BubbleSortTest.su→src/UnitTests/Algorithms/Sorting/BubbleSortTest.cu +0 −0 File moved. View file