Commit e2c5a3db authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed CUBLAS because it is used only in the benchmarks

And of course our implementation is faster ;-)
parent 052e268e
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -161,23 +161,6 @@ if( WITH_CUDA STREQUAL "yes" )
        # TODO: this is necessary only due to a bug in cmake
        set( CUDA_ADD_LIBRARY_OPTIONS -shared )

        ####
        # Check for cuBLAS
        #
        if( NOT WITH_CUBLAS STREQUAL "no" )
            find_path( CUBLAS_INCLUDE_DIR cublas_v2.h
                       /usr/local/cuda/include
                       ${CUDA_INCLUDE_DIR}
                       DOC "CUBLAS headers." )
            if( ${CUBLAS_INCLUDE_DIR} STREQUAL "CUBLAS_INCLUDE_DIR-NOTFOUND" )
                message( "CUBLAS not found." )
                set( HAVE_CUBLAS "//#define HAVE_CUBLAS 1" )
            else()
                message( "CUBLAS found. -- ${CUBLAS_INCLUDE_DIR}" )
                set( HAVE_CUBLAS "#define HAVE_CUBLAS 1" )
            endif()
        endif( NOT WITH_CUBLAS STREQUAL "no" )

        ####
        # Check for CUSP
        #
+0 −6
Original line number Diff line number Diff line
@@ -87,9 +87,6 @@ set( tnl_CUDA__SOURCES ${tnl_config_CUDA__SOURCES}
if( BUILD_CUDA )
   CUDA_ADD_LIBRARY( tnl SHARED ${tnl_CUDA__SOURCES}
                     OPTIONS ${CUDA_ADD_LIBRARY_OPTIONS} )
   if( HAVE_CUBLAS )
      CUDA_ADD_CUBLAS_TO_TARGET( tnl )
   endif( HAVE_CUBLAS )
   CUDA_ADD_LIBRARY( tnl_static STATIC ${tnl_CUDA__SOURCES} )
else( BUILD_CUDA )
   ADD_LIBRARY( tnl SHARED ${tnl_SOURCES} )
@@ -111,9 +108,6 @@ IF( BUILD_MPI )
   if( BUILD_CUDA )
      CUDA_ADD_LIBRARY( tnl-mpi SHARED ${tnl_CUDA__SOURCES}
                        OPTIONS ${CUDA_ADD_LIBRARY_OPTIONS} )
      if( HAVE_CUBLAS )
         CUDA_ADD_CUBLAS_TO_TARGET( tnl-mpi )
      endif( HAVE_CUBLAS )
      CUDA_ADD_LIBRARY( tnl-mpi_static STATIC ${tnl_CUDA__SOURCES} )
   else( BUILD_CUDA )
      ADD_LIBRARY( tnl-mpi SHARED ${tnl_SOURCES} )
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ set( headers ArrayOperations.h
             ArrayOperationsMIC_impl.h
             cuda-prefix-sum.h
             cuda-prefix-sum_impl.h
             CublasWrapper.h
             CudaMultireductionKernel.h
             CudaReductionBuffer.h
             CudaReductionKernel.h
+0 −68
Original line number Diff line number Diff line
/***************************************************************************
                          CublasWraper.h  -  description
                             -------------------
    begin                : Apr 7, 2015
    copyright            : (C) 2015 by Tomas Oberhuber
    email                : tomas.oberhuber@fjfi.cvut.cz
 ***************************************************************************/

/* See Copyright Notice in tnl/Copyright */

#pragma once

#if defined HAVE_CUBLAS && defined HAVE_CUDA
#include <cublas_v2.h>
#endif

namespace TNL {
namespace Containers {
namespace Algorithms {

template< typename Real1,
          typename Real2,
          typename Index >
class CublasWraper
{
    public:
        static bool dot( const Real1* v1, const Real2* v2, const Index size, Real1& result)
        {
            return false;
        }
};

#if defined HAVE_CUBLAS && defined HAVE_CUDA

template< typename Index >
class CublasWraper< float, float, Index >
{
    public:
        static bool dot( const float* v1, const float* v2, const Index size, float& result)
        {

            cublasHandle_t handle;
            cublasCreate( &handle );
            cublasSdot( handle, size, v1, 1, v2, 1, &result );
            cublasDestroy( handle );
            return false;
        }
};

template< typename Index >
class CublasWraper< double, double, Index >
{
    public:
        static bool dot( const double* v1, const double* v2, const Index size, double& result)
        {
            cublasHandle_t handle;
            cublasCreate( &handle );
            cublasDdot( handle, size, v1, 1, v2, 1, &result );
            cublasDestroy( handle );
            return false;
        }
};
#endif

} // namespace Algorithms
} // namespace Containers
} // namespace TNL
+0 −7
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
#include <TNL/Exceptions/CudaSupportMissing.h>
#include <TNL/Containers/Algorithms/VectorOperations.h>
#include <TNL/Containers/Algorithms/cuda-prefix-sum.h>
#include <TNL/Containers/Algorithms/CublasWrapper.h>

namespace TNL {
namespace Containers {   
@@ -426,12 +425,6 @@ getScalarProduct( const Vector1& v1,
   TNL_ASSERT_EQ( v1.getSize(), v2.getSize(), "The vector sizes must be the same." );

   Real result( 0 );
/*#if defined HAVE_CUBLAS && defined HAVE_CUDA
   if( CublasWraper< typename Vector1::RealType,
                         typename Vector2::RealType,
                         typename Vector1::IndexType >::dot( v1.getData(), v1.getData(), v1.getSize(), result ) )
       return result;
#endif*/
   Algorithms::ParallelReductionScalarProduct< typename Vector1::RealType, typename Vector2::RealType > operation;
   Reduction< Devices::Cuda >::reduce( operation,
                                       v1.getSize(),
Loading