cuLite v0.3.1
A lite CUDA C++ Interface
Loading...
Searching...
No Matches
ex02n_dense_matrix_algebra_mmult.cpp
#include <iostream>
#include <cla3p/dense.hpp>
#include <culite/dense.hpp>
#include <culite/algebra.hpp>
int main()
{
cla3p::dns::RdMatrix hostA(3, 3);
cla3p::dns::RdMatrix hostB(3, 3);
hostA = 3.;
hostB = 2.;
hostA >> A; // Transfer to GPU
hostB >> B; // Transfer to GPU
std::cout << "A:\n" << A;
std::cout << "B:\n" << B << "\n";
/*
* Perform the operation (A * B) using operators and the mult function respectively
*/
std::cout << "C1:\n" << C1;
std::cout << "C2:\n" << C2 << "\n";
/*
* Perform the operation (Cx += A * B) using operators and the mult function respectively
*/
C1 += A * B;
std::cout << "C1:\n" << C1;
std::cout << "C2:\n" << C2;
return 0;
}
XxMatrix< real_t > RdMatrix
void mult(T_Scalar alpha, op_t opA, const dns::XxMatrix< T_Scalar > &A, op_t opB, const dns::XxMatrix< T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C, CuBlasHandler &cuBlasHandler=globalCuBlasHandler())
Updates a general matrix with a matrix-matrix product.
XxMatrix< real_t > RdMatrix
Double precision real matrix.
Definition dense.hpp:55