In this tutorial it is shown how BLAS level 3 functionality in ViennaCL can be used.
We begin with defining preprocessor constants and including the necessary headers.
#ifndef NDEBUG
#define NDEBUG
#endif
#include <iostream>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/triangular.hpp>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/lu.hpp>
#include <boost/numeric/ublas/io.hpp>
#define VIENNACL_WITH_UBLAS 1
#include "Random.hpp"
#include "../benchmarks/benchmark-utils.hpp"
#define BLAS3_MATRIX_SIZE 400
using namespace boost::numeric;
Later in this tutorial we will iterate over all available OpenCL devices. To ensure that this tutorial also works if no OpenCL backend is activated, we need this dummy-struct.
#ifndef VIENNACL_WITH_OPENCL
struct dummy
{
std::size_t
size()
const {
return 1; }
};
#endif
We don't need additional auxiliary routines, so let us start straight away with main():
Level 3 Functionality