Loading src/core/cuda/tnlCublasWrapper.h 0 → 100644 +34 −0 Original line number Diff line number Diff line /*************************************************************************** tnlCublasWrapper.h - description ------------------- begin : Apr 7, 2015 copyright : (C) 2015 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef TNLCUBLASWARPER_H #define TNLCUBLASWARPER_H template< typename Real1, typename Real2, typename Index > class tnlCublasWrapper { public: static bool sdot( const Real1* v1, const Real2* v2, const Index size, Real1& result) { return false; } }; #endif /* TNLCUBLASWARPER_H */ src/core/vectors/tnlVectorOperationsCuda_impl.h +7 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define TNLVECTOROPERATIONSCUDA_IMPL_H_ #include <core/cuda/cuda-prefix-sum.h> #include <core/cuda/tnlCublasWrapper.h> template< typename Vector > void tnlVectorOperations< tnlCuda >::addElement( Vector& v, Loading Loading @@ -349,6 +350,12 @@ typename Vector1 :: RealType tnlVectorOperations< tnlCuda > :: getScalarProduct( cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); Real result( 0 ); #ifdef HAVE_CUBLAS if( tnlCublasWrapper< typename Vector1::RealType, typename Vector2::RealType, typename Vector1::IndexType >::sdot( v1.getData(), v1.getData(), v1.getSize(), result ) ) return result; #endif tnlParallelReductionScalarProduct< Real, Index > operation; reductionOnCudaDevice( operation, v1. getSize(), Loading tnlConfig.h.in +1 −1 Original line number Diff line number Diff line @HAVE_LIBBZ2@ @HAVE_CUBLAS@ @HAVE_CUSP@ Loading Loading
src/core/cuda/tnlCublasWrapper.h 0 → 100644 +34 −0 Original line number Diff line number Diff line /*************************************************************************** tnlCublasWrapper.h - description ------------------- begin : Apr 7, 2015 copyright : (C) 2015 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef TNLCUBLASWARPER_H #define TNLCUBLASWARPER_H template< typename Real1, typename Real2, typename Index > class tnlCublasWrapper { public: static bool sdot( const Real1* v1, const Real2* v2, const Index size, Real1& result) { return false; } }; #endif /* TNLCUBLASWARPER_H */
src/core/vectors/tnlVectorOperationsCuda_impl.h +7 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define TNLVECTOROPERATIONSCUDA_IMPL_H_ #include <core/cuda/cuda-prefix-sum.h> #include <core/cuda/tnlCublasWrapper.h> template< typename Vector > void tnlVectorOperations< tnlCuda >::addElement( Vector& v, Loading Loading @@ -349,6 +350,12 @@ typename Vector1 :: RealType tnlVectorOperations< tnlCuda > :: getScalarProduct( cerr << "Vector names are " << v1. getName() << " and " << v2. getName() ); Real result( 0 ); #ifdef HAVE_CUBLAS if( tnlCublasWrapper< typename Vector1::RealType, typename Vector2::RealType, typename Vector1::IndexType >::sdot( v1.getData(), v1.getData(), v1.getSize(), result ) ) return result; #endif tnlParallelReductionScalarProduct< Real, Index > operation; reductionOnCudaDevice( operation, v1. getSize(), Loading
tnlConfig.h.in +1 −1 Original line number Diff line number Diff line @HAVE_LIBBZ2@ @HAVE_CUBLAS@ @HAVE_CUSP@ Loading