ViennaCL - The Vienna Computing Library  1.5.1
start.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_TRAITS_START_HPP_
2 #define VIENNACL_TRAITS_START_HPP_
3 
4 /* =========================================================================
5  Copyright (c) 2010-2014, Institute for Microelectronics,
6  Institute for Analysis and Scientific Computing,
7  TU Wien.
8  Portions of this software are copyright by UChicago Argonne, LLC.
9 
10  -----------------
11  ViennaCL - The Vienna Computing Library
12  -----------------
13 
14  Project Head: Karl Rupp rupp@iue.tuwien.ac.at
15 
16  (A list of authors and contributors can be found in the PDF manual)
17 
18  License: MIT (X11), see file LICENSE in the base directory
19 ============================================================================= */
20 
25 #include <string>
26 #include <fstream>
27 #include <sstream>
28 #include "viennacl/forwards.h"
29 
31 
32 namespace viennacl
33 {
34  namespace traits
35  {
36  //
37  // start: Mostly for vectors
38  //
39 
40  // Default: Try to get the start index from the .start() member function
41  template <typename T>
42  typename result_of::size_type<T>::type
43  start(T const & obj)
44  {
45  return obj.start();
46  }
47 
48  //ViennaCL vector leads to start index 0:
49  template <typename ScalarType, unsigned int ALIGNMENT>
52  {
53  return 0;
54  }
55 
56 
57  //
58  // start1: Row start index
59  //
60 
61  // Default: Try to get the start index from the .start1() member function
62  template <typename T>
64  start1(T const & obj)
65  {
66  return obj.start1();
67  }
68 
69  //ViennaCL matrix leads to start index 0:
70  template <typename ScalarType, typename F, unsigned int ALIGNMENT>
73  {
74  return 0;
75  }
76 
77 
78  //
79  // start2: Column start index
80  //
81  template <typename T>
83  start2(T const & obj)
84  {
85  return obj.start2();
86  }
87 
88  //ViennaCL matrix leads to start index 0:
89  template <typename ScalarType, typename F, unsigned int ALIGNMENT>
92  {
93  return 0;
94  }
95 
96 
97  } //namespace traits
98 } //namespace viennacl
99 
100 
101 #endif
This file provides the forward declarations for the main types used within ViennaCL.
result_of::size_type< T >::type start1(T const &obj)
Definition: start.hpp:64
A dense matrix class.
Definition: forwards.h:293
result_of::size_type< T >::type start2(T const &obj)
Definition: start.hpp:83
result_of::size_type< T >::type start(T const &obj)
Definition: start.hpp:43
A vector class representing a linear memory sequence on the GPU. Inspired by boost::numeric::ublas::v...
Definition: forwards.h:208
T::size_type type
Definition: result_of.hpp:186
Generic meta-function for retrieving the size_type associated with type T.
Definition: result_of.hpp:184
A collection of compile time type deductions.