ViennaCL - The Vienna Computing Library  1.5.2
viennacl/linalg/opencl/vandermonde_matrix_operations.hpp
Go to the documentation of this file.
00001 #ifndef VIENNACL_LINALG_OPENCL_VANDERMONDE_MATRIX_OPERATIONS_HPP_
00002 #define VIENNACL_LINALG_OPENCL_VANDERMONDE_MATRIX_OPERATIONS_HPP_
00003 
00004 /* =========================================================================
00005    Copyright (c) 2010-2014, Institute for Microelectronics,
00006                             Institute for Analysis and Scientific Computing,
00007                             TU Wien.
00008    Portions of this software are copyright by UChicago Argonne, LLC.
00009 
00010                             -----------------
00011                   ViennaCL - The Vienna Computing Library
00012                             -----------------
00013 
00014    Project Head:    Karl Rupp                   rupp@iue.tuwien.ac.at
00015 
00016    (A list of authors and contributors can be found in the PDF manual)
00017 
00018    License:         MIT (X11), see file LICENSE in the base directory
00019 ============================================================================= */
00020 
00025 #include "viennacl/forwards.h"
00026 #include "viennacl/ocl/backend.hpp"
00027 #include "viennacl/scalar.hpp"
00028 #include "viennacl/vector.hpp"
00029 #include "viennacl/tools/tools.hpp"
00030 #include "viennacl/fft.hpp"
00031 //#include "viennacl/linalg/kernels/coordinate_matrix_kernels.h"
00032 
00033 namespace viennacl
00034 {
00035   namespace linalg
00036   {
00037     namespace opencl
00038     {
00039 
00048         template<class SCALARTYPE, unsigned int ALIGNMENT>
00049         void prod_impl(const viennacl::vandermonde_matrix<SCALARTYPE, ALIGNMENT> & mat,
00050                       const viennacl::vector_base<SCALARTYPE> & vec,
00051                             viennacl::vector_base<SCALARTYPE> & result)
00052         {
00053           viennacl::ocl::context & ctx = const_cast<viennacl::ocl::context &>(viennacl::traits::opencl_handle(mat).context());
00054           viennacl::linalg::opencl::kernels::fft<SCALARTYPE>::init(ctx);
00055 
00056           viennacl::ocl::kernel & kernel = ctx.get_kernel(viennacl::linalg::opencl::kernels::fft<SCALARTYPE>::program_name(), "vandermonde_prod");
00057           viennacl::ocl::enqueue(kernel(viennacl::traits::opencl_handle(mat),
00058                                         viennacl::traits::opencl_handle(vec),
00059                                         viennacl::traits::opencl_handle(result),
00060                                         static_cast<cl_uint>(mat.size1())));
00061         }
00062 
00063     } //namespace opencl
00064   } //namespace linalg
00065 } //namespace viennacl
00066 
00067 
00068 #endif