Loading src/TNL/Algorithms/Sorting/BitonicSort.h +2 −3 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #pragma once #include <TNL/Algorithms/Sorting/detail/bitonicSort.h> #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { namespace Algorithms { Loading @@ -38,12 +39,10 @@ struct BitonicSort if( std::is_same< Device, Devices::Cuda >::value ) bitonicSort( begin, end, compare, swap ); else TNL_ASSERT( false, std::cerr << "inplace bitonic sort for CPU is not implemented" << std::endl ); throw Exceptions::NotImplementedError( "inplace bitonic sort is implemented only for CUDA" ); } }; } // namespace Sorting } // namespace Algorithms } //namespace TNL src/TNL/Algorithms/Sorting/BubbleSort.h +22 −25 Original line number Diff line number Diff line Loading @@ -13,7 +13,9 @@ #pragma once #include <algorithm> #include <TNL/Assert.h> #include <TNL/Devices/Cuda.h> #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { Loading @@ -25,9 +27,9 @@ 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 || std::is_same< Device, Devices::Sequential >::value ) { if( std::is_same< Device, Devices::Cuda >::value ) throw Exceptions::NotImplementedError( "inplace bubble sort is not implemented for CUDA" ); Index left( begin ), right( end -1 ); while( left < right ) { Loading @@ -54,13 +56,8 @@ struct BubbleSort left++; //lastChange; } } else throw Exceptions::NotImplementedError(); } }; } // namespace Sorting } // namespace Algorithms } //namespace TNL src/TNL/Algorithms/Sorting/DefaultSorter.h +4 −6 Original line number Diff line number Diff line Loading @@ -12,8 +12,6 @@ #pragma once #include <utility> // std::pair, std::forward #include <TNL/Devices/Sequential.h> #include <TNL/Devices/Host.h> #include <TNL/Devices/Cuda.h> Loading @@ -30,13 +28,13 @@ template< typename Device > struct DefaultSorter; template<> struct DefaultSorter< Devices::Host > struct DefaultSorter< Devices::Sequential > { using SorterType = Algorithms::Sorting::STLSort; }; template<> struct DefaultSorter< Devices::Sequential > struct DefaultSorter< Devices::Host > { using SorterType = Algorithms::Sorting::STLSort; }; Loading @@ -51,13 +49,13 @@ template< typename Device > struct DefaultInplaceSorter; template<> struct DefaultInplaceSorter< Devices::Host > struct DefaultInplaceSorter< Devices::Sequential > { using SorterType = Algorithms::Sorting::BubbleSort; }; template<> struct DefaultInplaceSorter< Devices::Sequential > struct DefaultInplaceSorter< Devices::Host > { using SorterType = Algorithms::Sorting::BubbleSort; }; Loading src/TNL/Algorithms/Sorting/Quicksort.h +0 −2 Original line number Diff line number Diff line Loading @@ -39,5 +39,3 @@ struct Quicksort } // namespace Sorting } // namespace Algorithms } //namespace TNL src/TNL/Algorithms/Sorting/STLSort.h +0 −2 Original line number Diff line number Diff line Loading @@ -36,5 +36,3 @@ struct STLSort } // namespace Sorting } // namespace Algorithms } //namespace TNL Loading
src/TNL/Algorithms/Sorting/BitonicSort.h +2 −3 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #pragma once #include <TNL/Algorithms/Sorting/detail/bitonicSort.h> #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { namespace Algorithms { Loading @@ -38,12 +39,10 @@ struct BitonicSort if( std::is_same< Device, Devices::Cuda >::value ) bitonicSort( begin, end, compare, swap ); else TNL_ASSERT( false, std::cerr << "inplace bitonic sort for CPU is not implemented" << std::endl ); throw Exceptions::NotImplementedError( "inplace bitonic sort is implemented only for CUDA" ); } }; } // namespace Sorting } // namespace Algorithms } //namespace TNL
src/TNL/Algorithms/Sorting/BubbleSort.h +22 −25 Original line number Diff line number Diff line Loading @@ -13,7 +13,9 @@ #pragma once #include <algorithm> #include <TNL/Assert.h> #include <TNL/Devices/Cuda.h> #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { Loading @@ -25,9 +27,9 @@ 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 || std::is_same< Device, Devices::Sequential >::value ) { if( std::is_same< Device, Devices::Cuda >::value ) throw Exceptions::NotImplementedError( "inplace bubble sort is not implemented for CUDA" ); Index left( begin ), right( end -1 ); while( left < right ) { Loading @@ -54,13 +56,8 @@ struct BubbleSort left++; //lastChange; } } else throw Exceptions::NotImplementedError(); } }; } // namespace Sorting } // namespace Algorithms } //namespace TNL
src/TNL/Algorithms/Sorting/DefaultSorter.h +4 −6 Original line number Diff line number Diff line Loading @@ -12,8 +12,6 @@ #pragma once #include <utility> // std::pair, std::forward #include <TNL/Devices/Sequential.h> #include <TNL/Devices/Host.h> #include <TNL/Devices/Cuda.h> Loading @@ -30,13 +28,13 @@ template< typename Device > struct DefaultSorter; template<> struct DefaultSorter< Devices::Host > struct DefaultSorter< Devices::Sequential > { using SorterType = Algorithms::Sorting::STLSort; }; template<> struct DefaultSorter< Devices::Sequential > struct DefaultSorter< Devices::Host > { using SorterType = Algorithms::Sorting::STLSort; }; Loading @@ -51,13 +49,13 @@ template< typename Device > struct DefaultInplaceSorter; template<> struct DefaultInplaceSorter< Devices::Host > struct DefaultInplaceSorter< Devices::Sequential > { using SorterType = Algorithms::Sorting::BubbleSort; }; template<> struct DefaultInplaceSorter< Devices::Sequential > struct DefaultInplaceSorter< Devices::Host > { using SorterType = Algorithms::Sorting::BubbleSort; }; Loading
src/TNL/Algorithms/Sorting/Quicksort.h +0 −2 Original line number Diff line number Diff line Loading @@ -39,5 +39,3 @@ struct Quicksort } // namespace Sorting } // namespace Algorithms } //namespace TNL
src/TNL/Algorithms/Sorting/STLSort.h +0 −2 Original line number Diff line number Diff line Loading @@ -36,5 +36,3 @@ struct STLSort } // namespace Sorting } // namespace Algorithms } //namespace TNL