ViennaCL - The Vienna Computing Library  1.1.2
/build/buildd/viennacl-1.1.2/viennacl/ocl/utils.hpp
Go to the documentation of this file.
00001 /* =======================================================================
00002    Copyright (c) 2010, Institute for Microelectronics, TU Vienna.
00003    http://www.iue.tuwien.ac.at
00004                              -----------------
00005                      ViennaCL - The Vienna Computing Library
00006                              -----------------
00007                             
00008    authors:    Karl Rupp                          rupp@iue.tuwien.ac.at
00009                Florian Rudolf                     flo.rudy+viennacl@gmail.com
00010                Josef Weinbub                      weinbub@iue.tuwien.ac.at
00011 
00012    license:    MIT (X11), see file LICENSE in the ViennaCL base directory
00013 ======================================================================= */
00014 
00015 #ifndef _VIENNACL_OCL_UTILS_HPP_
00016 #define _VIENNACL_OCL_UTILS_HPP_
00017 
00022 #include <vector>
00023 #include "viennacl/ocl/backend.hpp"
00024 #include "viennacl/ocl/device.hpp"
00025 
00026 namespace viennacl
00027 {
00028   namespace ocl
00029   {
00030     
00033     template <typename ScalarType>
00034     struct DOUBLE_PRECISION_CHECKER
00035     {
00036       static void apply() {} 
00037     };
00038     
00039     template <>
00040     struct DOUBLE_PRECISION_CHECKER<double>
00041     {
00042       static void apply()
00043       {
00044         if (!viennacl::ocl::current_device().double_support())
00045           throw viennacl::ocl::double_precision_not_provided_error();
00046       }
00047     };
00048     
00049     
00050 
00051   } //ocl
00052 } //viennacl
00053 #endif