All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dense_blas.cpp File Reference
`#include "viennacl/matrix.hpp"`
`#include "viennacl/matrix_proxy.hpp"`
`#include "viennacl/vector.hpp"`
`#include "viennacl/vector_proxy.hpp"`
`#include "viennacl/linalg/inner_prod.hpp"`
`#include "viennacl/linalg/prod.hpp"`
`#include "viennacl/linalg/lu.hpp"`
`#include "viennacl/tools/timer.hpp"`
`#include <iomanip>`
`#include <stdlib.h>`

Go to the source code of this file.

## Macros

#define | BENCHMARK_OP(OPERATION, NAME, PERF, INDEX)

## Functions

template<class T , class F >
void | init_random (viennacl::matrix< T, F > &M)
template<class T >
void | init_random (viennacl::vector< T > &x)
template<class T >
void | bench (size_t BLAS1_N, size_t BLAS2_M, size_t BLAS2_N, size_t BLAS3_M, size_t BLAS3_N, size_t BLAS3_K, std::string const &prefix)
int | main ()

## Macro Definition Documentation

#define BENCHMARK_OP | ( |  | OPERATION,
|  |  | NAME,
|  |  | PERF,
|  |  | INDEX
| ) |  |

Value:
OPERATION; \
viennacl::backend::finish();\
timer.start(); \
Nruns = 0; \
time_spent = 0; \
while (time_spent < time_per_benchmark) \
{ \
time_previous = timer.get(); \
OPERATION; \
viennacl::backend::finish(); \
time_spent += timer.get() - time_previous; \
Nruns+=1; \
} \
time_spent/=(double)Nruns; \
std::cout << prefix << NAME " : " << PERF << " " INDEX << std::endl; \
viennacl::backend::finish
void finish()
Synchronizes the execution. finish() will only return after all compute kernels (CUDA, OpenCL) have completed.
Definition: memory.hpp:54

## Function Documentation

template<class T >

void bench | ( | size_t | BLAS1_N,
|  | size_t | BLAS2_M,
|  | size_t | BLAS2_N,
|  | size_t | BLAS3_M,
|  | size_t | BLAS3_N,
|  | size_t | BLAS3_K,
|  | std::string const & | prefix
| ) |  |

Definition at line 51 of file dense_blas.cpp.

template<class T , class F >

void init_random | ( | viennacl::matrix< T, F > & | M | ) |

Definition at line 32 of file dense_blas.cpp.

template<class T >

void init_random | ( | viennacl::vector< T > & | x | ) |

Definition at line 42 of file dense_blas.cpp.

int main | ( |  | ) |

Definition at line 131 of file dense_blas.cpp.