Created
July 8, 2014 13:33
-
-
Save khalednasr/92acd8aa23d7ae26196d 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
// default backend should be set to the global backend | |
template <class T, Backend backend=Backend::EIGEN3> | |
class ComputeMatrix | |
{ | |
}; | |
// If the backend is Eigen3, use SGMatrix | |
template <> template <class T> | |
class ComputeMatrix<T,Backend::EIGEN3> : public SGMatrix<T> | |
{ | |
using SGMatrix<T>::SGMatrix; | |
public: | |
ComputeMatrix(const SGMatrix<T>& cpu_mat) : SGMatrix<T>(cpu_mat) | |
{ | |
} | |
}; | |
// If the backend is ViennacL, use CGPUMatrix | |
template <> template <class T> | |
class ComputeMatrix<T,Backend::VIENNACL> : public CGPUMatrix<T> | |
{ | |
using CGPUMatrix<T>::CGPUMatrix; | |
public: | |
ComputeMatrix(const CGPUMatrix<T>& mat) : CGPUMatrix<T>(mat) | |
{ | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment