ViennaCL - The Vienna Computing Library  1.2.0
coordinate_matrix_kernels.h
Go to the documentation of this file.
1 #ifndef _VIENNACL_COORDINATE_MATRIX_KERNELS_HPP_
2 #define _VIENNACL_COORDINATE_MATRIX_KERNELS_HPP_
6 #include "viennacl/ocl/utils.hpp"
8 
9 //Automatically generated file from aux-directory, do not edit manually!
10 namespace viennacl
11 {
12  namespace linalg
13  {
14  namespace kernels
15  {
16  template<class TYPE, unsigned int alignment>
17  struct coordinate_matrix;
18 
19 
21  template <>
22  struct coordinate_matrix<float, 1>
23  {
24  static std::string program_name()
25  {
26  return "f_coordinate_matrix_1";
27  }
28  static void init()
29  {
31  static std::map<cl_context, bool> init_done;
33  if (!init_done[context_.handle()])
34  {
35  std::string source;
36  source.append(coordinate_matrix_align1_vec_mul);
37  std::string prog_name = program_name();
38  #ifdef VIENNACL_BUILD_INFO
39  std::cout << "Creating program " << prog_name << std::endl;
40  #endif
41  context_.add_program(source, prog_name);
42  viennacl::ocl::program & prog_ = context_.get_program(prog_name);
43  prog_.add_kernel("vec_mul");
44  init_done[context_.handle()] = true;
45  } //if
46  } //init
47  }; // struct
48 
49  template <>
50  struct coordinate_matrix<float, 128>
51  {
52  static std::string program_name()
53  {
54  return "f_coordinate_matrix_128";
55  }
56  static void init()
57  {
59  static std::map<cl_context, bool> init_done;
61  if (!init_done[context_.handle()])
62  {
63  std::string source;
64  source.append(coordinate_matrix_align1_vec_mul);
65  std::string prog_name = program_name();
66  #ifdef VIENNACL_BUILD_INFO
67  std::cout << "Creating program " << prog_name << std::endl;
68  #endif
69  context_.add_program(source, prog_name);
70  viennacl::ocl::program & prog_ = context_.get_program(prog_name);
71  prog_.add_kernel("vec_mul");
72  init_done[context_.handle()] = true;
73  } //if
74  } //init
75  }; // struct
76 
77 
78 
80  template <>
81  struct coordinate_matrix<double, 1>
82  {
83  static std::string program_name()
84  {
85  return "d_coordinate_matrix_1";
86  }
87  static void init()
88  {
90  static std::map<cl_context, bool> init_done;
92  if (!init_done[context_.handle()])
93  {
94  std::string source;
97  std::string prog_name = program_name();
98  #ifdef VIENNACL_BUILD_INFO
99  std::cout << "Creating program " << prog_name << std::endl;
100  #endif
101  context_.add_program(source, prog_name);
102  viennacl::ocl::program & prog_ = context_.get_program(prog_name);
103  prog_.add_kernel("vec_mul");
104  init_done[context_.handle()] = true;
105  } //if
106  } //init
107  }; // struct
108 
109  template <>
110  struct coordinate_matrix<double, 128>
111  {
112  static std::string program_name()
113  {
114  return "d_coordinate_matrix_128";
115  }
116  static void init()
117  {
119  static std::map<cl_context, bool> init_done;
121  if (!init_done[context_.handle()])
122  {
123  std::string source;
124  std::string fp64_ext = viennacl::ocl::current_device().double_support_extension();
126  std::string prog_name = program_name();
127  #ifdef VIENNACL_BUILD_INFO
128  std::cout << "Creating program " << prog_name << std::endl;
129  #endif
130  context_.add_program(source, prog_name);
131  viennacl::ocl::program & prog_ = context_.get_program(prog_name);
132  prog_.add_kernel("vec_mul");
133  init_done[context_.handle()] = true;
134  } //if
135  } //init
136  }; // struct
137 
138 
139  } //namespace kernels
140  } //namespace linalg
141 } //namespace viennacl
142 #endif