Commit 95b5e99d authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing build of tnl-benchmark-sort using CUDA samples.

parent 97df27df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ if( ${WITH_CUDA} )
        set( CMAKE_EXECUTABLE_SUFFIX "${executable_suffix_backup}" )
    endif()
    if( NOT CUDA_SAMPLES_DIR STREQUAL "none" )
      set( CUDA_SAMPLES_FLAGS "-I${CUDA_SAMPLES_DIR}/common/inc")
      set( CUDA_SAMPLES_FLAGS "-I${CUDA_SAMPLES_DIR}/common/inc -DHAVE_CUDA_SAMPLES")
    endif()
endif()

+2 −2
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ Options for the 'tests' and 'matrix-tests' targets:
    --with-system-gtest=yes/no            Use GTest installed in the local system and do not download the latest version. '$WITH_SYSTEM_GTEST' by default.

External dependencies:
   --cuda-samples-dir=PATH                CUDA samples are used by some reference algorithms used in benchmarks. '$CUDA_SAMPLES_PATH` by default.
   --cuda-samples-path=PATH                CUDA samples are used by some reference algorithms used in benchmarks. '$CUDA_SAMPLES_PATH' by default.
EOF
}

+2 −7
Original line number Diff line number Diff line
@@ -8,7 +8,9 @@
#include <TNL/Algorithms/Sorting/STLSort.h>

#ifdef HAVE_CUDA
#ifdef HAVE_CUDA_SAMPLES
#include "ReferenceAlgorithms/MancaQuicksort.h"
#endif
#include "ReferenceAlgorithms/CedermanQuicksort.h"
#endif

@@ -16,13 +18,6 @@

using namespace TNL;

/*struct STLSorter
{
    template< typename Value >
    static void sort( std::vector< Value >& vec ) { std::sort( vec.begin(), vec.end() ); };
};*/


template< typename Sorter >
struct Measurer
{
+4 −0
Original line number Diff line number Diff line
@@ -92,8 +92,10 @@ int main(int argc, char *argv[])
        std::cout << "Bitonic sort on GPU ... " << std::endl;
        start< BitonicSort >( cout, "\t" );
#ifdef HAVE_CUDA
#ifdef HAVE_CUDA_SAMPLES
        std::cout << "Manca quicksort on GPU ... " << std::endl;
        start< MancaQuicksort >( cout, "\t" );
#endif
        std::cout << "Cederman quicksort on GPU ... " << std::endl;
        start< CedermanQuicksort >( cout, "\t" );
#endif
@@ -108,8 +110,10 @@ int main(int argc, char *argv[])
        std::cout << "Bitonic sort on GPU ... " << std::endl;
        start< BitonicSort >(out, ",");
#ifdef HAVE_CUDA
#ifdef HAVE_CUDA_SAMPLES
        std::cout << "Manca quicksort on GPU ... " << std::endl;
        start< MancaQuicksort >( out, "," );
#endif
        std::cout << "Cederman quicksort on GPU ... " << std::endl;
        start< CedermanQuicksort >( out, "," );
#endif
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ sort( Array& arr, const Compare& cmp )
        }
    }

    TNL_ASSERT_LE( blockDim * multiplier * sizeof(Value), maxSharable,"" );
    TNL_ASSERT_LE( ( int ) ( blockDim * multiplier * sizeof(Value) ), maxSharable,"" );

    this->init(arr, maxBlocks, blockDim, multiplier * blockDim, maxSharable);
    this->performSort( cmp );