ViennaCL - The Vienna Computing Library  1.7.1
Free open-source GPU-accelerated linear algebra and solver library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
global_variables.cpp
Go to the documentation of this file.
1 /* =========================================================================
2  Copyright (c) 2010-2016, Institute for Microelectronics,
3  Institute for Analysis and Scientific Computing,
4  TU Wien.
5  Portions of this software are copyright by UChicago Argonne, LLC.
6 
7  -----------------
8  ViennaCL - The Vienna Computing Library
9  -----------------
10 
11  Project Head: Karl Rupp rupp@iue.tuwien.ac.at
12 
13  (A list of authors and contributors can be found in the PDF manual)
14 
15  License: MIT (X11), see file LICENSE in the base directory
16 ============================================================================= */
17 
22 //
23 // *** System
24 //
25 #include <iostream>
26 #include <algorithm>
27 #include <cmath>
28 
29 //
30 // *** ViennaCL
31 //
32 #include "viennacl/scalar.hpp"
33 #include "viennacl/vector.hpp"
34 #include "viennacl/matrix.hpp"
37 #include "viennacl/ell_matrix.hpp"
38 #include "viennacl/hyb_matrix.hpp"
39 #ifdef VIENNACL_WITH_OPENCL
44 #endif
45 
46 
47 // forward declarations of global variables:
50 
53 
55 
56 // instantiation of global variables:
59 
62 
64 //viennacl::matrix<int> m2;
65 
66 // TODO: Add checks for other types
67 
68 //
69 // -------------------------------------------------------------
70 //
71 int main()
72 {
73  std::cout << std::endl;
74  std::cout << "----------------------------------------------" << std::endl;
75  std::cout << "----------------------------------------------" << std::endl;
76  std::cout << "## Test :: Instantiation of global variables" << std::endl;
77  std::cout << "----------------------------------------------" << std::endl;
78  std::cout << "----------------------------------------------" << std::endl;
79  std::cout << std::endl;
80 
81  s1 = viennacl::scalar<float>(1.0f);
82  s2 = viennacl::scalar<int>(1);
83 
85  v2 = viennacl::vector<int>(5);
86 
87  m1 = viennacl::matrix<float>(5, 4);
88  //m2 = viennacl::matrix<int>(5, 4);
89 
90  std::cout << std::endl;
91  std::cout << "------- Test completed --------" << std::endl;
92  std::cout << std::endl;
93 
94 
95  return EXIT_SUCCESS;
96 }
97 //
98 // -------------------------------------------------------------
99 //
100 
Implementation of the dense matrix class.
A dense matrix class.
Definition: forwards.h:375
viennacl::scalar< int > s2
int main()
viennacl::scalar< float > s1
Implementation of the coordinate_matrix class.
viennacl::vector< float > v1
Implementation of the hyb_matrix class.
Implementation of the hankel_matrix class for efficient manipulation of Hankel matrices. Experimental.
Implementation of the circulant_matrix class for efficient manipulation of circulant matrices...
Implementation of the compressed_matrix class.
Implementation of the ell_matrix class.
Implementation of the vandermonde_matrix class for efficient manipulation of Vandermonde matrices...
viennacl::vector< int > v2
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
viennacl::matrix< float > m1
Implementation of the ViennaCL scalar class.
Implementation of the toeplitz_matrix class for efficient manipulation of Toeplitz matrices...