Created
May 27, 2014 14:00
-
-
Save khalednasr/ae85d6d13fbe572e2bdc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <shogun/mathematics/linalg/linalg.h> | |
#include <viennacl/matrix.hpp> | |
#include <viennacl/vector.hpp> | |
namespace shogun | |
{ | |
namespace linalg | |
{ | |
template <class T, unsigned int Info = 1> | |
using VCLMatrix= viennacl::matrix<T, viennacl::column_major, Info>; | |
namespace implementation | |
{ | |
template <> template <class T,unsigned int Info> | |
struct sum<unsigned int,Backend::VIENNACL,VCLMatrix,T,Info> | |
{ | |
typedef VCLMatrix<T, Info> matrix_type; | |
static T compute(matrix_type m, bool no_diag) | |
{ | |
return 0; | |
} | |
static T compute(Block<unsigned int,VCLMatrix,T> b, bool no_diag) | |
{ | |
return 0; | |
} | |
}; | |
} | |
template <Backend backend,template <class,unsigned int> class Matrix, class T, unsigned int Info> | |
T sum(Matrix<T,Info> m, bool no_diag=false) | |
{ | |
return implementation::sum<unsigned int,backend,Matrix,T,Info>::compute(m, no_diag); | |
} | |
} | |
} | |
using namespace shogun; | |
int main() | |
{ | |
linalg::VCLMatrix<float64_t> mat(3,4); | |
// This line doesn't compile | |
float64_t sum = linalg::sum<linalg::Backend::VIENNACL>(mat); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment