ViennaCL - The Vienna Computing Library: viennacl/device_specific/builtin_database/row_wise_reduction.hpp Source File

ViennaCL - The Vienna Computing Library 1.7.0 Free open-source GPU-accelerated linear algebra and solver library. |

viennacl/device_specific/builtin_database/row_wise_reduction.hpp
Go to the documentation of this file.

    00001 #ifndef VIENNACL_DEVICE_SPECIFIC_BUILTIN_DATABASE_ROW_WISE_REDUCTION_HPP_
    00002 #define VIENNACL_DEVICE_SPECIFIC_BUILTIN_DATABASE_ROW_WISE_REDUCTION_HPP_
    00003
    00004 /* =========================================================================
    00005    Copyright (c) 2010-2015, 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 manual)
    00017
    00018    License:         MIT (X11), see file LICENSE in the base directory
    00019 ============================================================================= */
    00020
    00021 #include "viennacl/device_specific/builtin_database/devices/gpu/amd/northern_islands/barts.hpp"
    00022
    00023 #include "viennacl/device_specific/builtin_database/devices/gpu/nvidia/fermi/tesla_c2050.hpp"
    00024
    00025 #include "viennacl/device_specific/builtin_database/devices/gpu/nvidia/fermi/geforce_gtx_470.hpp"
    00026
    00027 #include "viennacl/device_specific/builtin_database/devices/gpu/nvidia/maxwell/geforce_gtx_750_ti.hpp"
    00028
    00029 #include "viennacl/device_specific/builtin_database/devices/gpu/amd/northern_islands/scrapper.hpp"
    00030
    00031 #include "viennacl/device_specific/builtin_database/devices/gpu/nvidia/tesla/geforce_gtx_260.hpp"
    00032
    00033 #include "viennacl/device_specific/builtin_database/devices/gpu/amd/southern_islands/tahiti.hpp"
    00034 #include "viennacl/device_specific/builtin_database/devices/gpu/amd/northern_islands/devastator.hpp"
    00035
    00036 #include "viennacl/device_specific/builtin_database/devices/gpu/nvidia/kepler/tesla_k20m.hpp"
    00037 #include "viennacl/device_specific/builtin_database/devices/gpu/nvidia/fermi/geforce_gtx_580.hpp"
    00038
    00039 #include "viennacl/device_specific/builtin_database/devices/gpu/amd/volcanic_islands/hawaii.hpp"
    00040
    00041 #include "viennacl/device_specific/builtin_database/devices/gpu/amd/evergreen/cypress.hpp"
    00042 #include "viennacl/device_specific/builtin_database/devices/gpu/amd/evergreen/cedar.hpp"
    00043
    00044
    00045 #include "viennacl/device_specific/builtin_database/devices/gpu/nvidia/fermi/geforce_gt_540m.hpp"
    00046
    00047
    00048 #include "viennacl/ocl/device_utils.hpp"
    00049
    00050 #include "viennacl/scheduler/forwards.h"
    00051
    00052 #include "viennacl/device_specific/builtin_database/devices/accelerator/fallback.hpp"
    00053 #include "viennacl/device_specific/builtin_database/devices/cpu/fallback.hpp"
    00054 #include "viennacl/device_specific/builtin_database/devices/gpu/fallback.hpp"
    00055
    00061 namespace viennacl
    00062 {
    00063 namespace device_specific
    00064 {
    00065 namespace builtin_database
    00066 {
    00067
    00068 inline database_type<row_wise_reduction_template::parameters_type> init_row_wise_reduction_N()
    00069 {
    00070   database_type<row_wise_reduction_template::parameters_type> result;
    00071
    00072   devices::accelerator::fallback::add_4B(result, char_to_type<'N'>());
    00073   devices::accelerator::fallback::add_8B(result, char_to_type<'N'>());
    00074
    00075   devices::cpu::fallback::add_4B(result, char_to_type<'N'>());
    00076   devices::cpu::fallback::add_8B(result, char_to_type<'N'>());
    00077
    00078   devices::gpu::fallback::add_4B(result, char_to_type<'N'>());
    00079   devices::gpu::fallback::add_8B(result, char_to_type<'N'>());
    00080   devices::gpu::nvidia::fermi::geforce_gt_540m::add_4B(result, char_to_type<'N'>());
    00081   devices::gpu::nvidia::fermi::geforce_gt_540m::add_8B(result, char_to_type<'N'>());
    00082   devices::gpu::amd::evergreen::cedar::add_4B(result, char_to_type<'N'>());
    00083   devices::gpu::amd::evergreen::cypress::add_4B(result, char_to_type<'N'>());
    00084   devices::gpu::amd::evergreen::cypress::add_8B(result, char_to_type<'N'>());
    00085   devices::gpu::amd::volcanic_islands::hawaii::add_4B(result, char_to_type<'N'>());
    00086   devices::gpu::amd::volcanic_islands::hawaii::add_8B(result, char_to_type<'N'>());
    00087   devices::gpu::nvidia::fermi::geforce_gtx_580::add_4B(result, char_to_type<'N'>());
    00088   devices::gpu::nvidia::fermi::geforce_gtx_580::add_8B(result, char_to_type<'N'>());
    00089   devices::gpu::nvidia::kepler::tesla_k20m::add_4B(result, char_to_type<'N'>());
    00090   devices::gpu::nvidia::kepler::tesla_k20m::add_8B(result, char_to_type<'N'>());
    00091   devices::gpu::amd::southern_islands::tahiti::add_4B(result, char_to_type<'N'>());
    00092   devices::gpu::amd::southern_islands::tahiti::add_8B(result, char_to_type<'N'>());
    00093   devices::gpu::amd::northern_islands::devastator::add_4B(result, char_to_type<'N'>());
    00094   devices::gpu::nvidia::tesla::geforce_gtx_260::add_4B(result, char_to_type<'N'>());
    00095   devices::gpu::nvidia::tesla::geforce_gtx_260::add_8B(result, char_to_type<'N'>());
    00096   devices::gpu::amd::northern_islands::scrapper::add_4B(result, char_to_type<'N'>());
    00097   devices::gpu::nvidia::maxwell::geforce_gtx_750_ti::add_4B(result, char_to_type<'N'>());
    00098   devices::gpu::nvidia::maxwell::geforce_gtx_750_ti::add_8B(result, char_to_type<'N'>());
    00099   devices::gpu::nvidia::fermi::geforce_gtx_470::add_4B(result, char_to_type<'N'>());
    00100   devices::gpu::nvidia::fermi::geforce_gtx_470::add_8B(result, char_to_type<'N'>());
    00101   devices::gpu::nvidia::fermi::tesla_c2050::add_4B(result, char_to_type<'N'>());
    00102   devices::gpu::nvidia::fermi::tesla_c2050::add_8B(result, char_to_type<'N'>());
    00103   devices::gpu::amd::northern_islands::barts::add_4B(result, char_to_type<'N'>());
    00104
    00105   return result;
    00106 }
    00107
    00108 inline database_type<row_wise_reduction_template::parameters_type> init_row_wise_reduction_T()
    00109 {
    00110   database_type<row_wise_reduction_template::parameters_type> result;
    00111
    00112   devices::accelerator::fallback::add_4B(result, char_to_type<'T'>());
    00113   devices::accelerator::fallback::add_8B(result, char_to_type<'T'>());
    00114
    00115   devices::cpu::fallback::add_4B(result, char_to_type<'T'>());
    00116   devices::cpu::fallback::add_8B(result, char_to_type<'T'>());
    00117
    00118   devices::gpu::fallback::add_4B(result, char_to_type<'T'>());
    00119   devices::gpu::fallback::add_8B(result, char_to_type<'T'>());
    00120   devices::gpu::nvidia::fermi::geforce_gt_540m::add_4B(result, char_to_type<'T'>());
    00121   devices::gpu::amd::evergreen::cedar::add_4B(result, char_to_type<'T'>());
    00122   devices::gpu::amd::evergreen::cypress::add_4B(result, char_to_type<'T'>());
    00123   devices::gpu::amd::evergreen::cypress::add_8B(result, char_to_type<'T'>());
    00124   devices::gpu::amd::volcanic_islands::hawaii::add_4B(result, char_to_type<'T'>());
    00125   devices::gpu::amd::volcanic_islands::hawaii::add_8B(result, char_to_type<'T'>());
    00126   devices::gpu::nvidia::fermi::geforce_gtx_580::add_4B(result, char_to_type<'T'>());
    00127   devices::gpu::nvidia::fermi::geforce_gtx_580::add_8B(result, char_to_type<'T'>());
    00128   devices::gpu::nvidia::kepler::tesla_k20m::add_4B(result, char_to_type<'T'>());
    00129   devices::gpu::nvidia::kepler::tesla_k20m::add_8B(result, char_to_type<'T'>());
    00130   devices::gpu::amd::southern_islands::tahiti::add_4B(result, char_to_type<'T'>());
    00131   devices::gpu::amd::southern_islands::tahiti::add_8B(result, char_to_type<'T'>());
    00132   devices::gpu::amd::northern_islands::devastator::add_4B(result, char_to_type<'T'>());
    00133   devices::gpu::nvidia::tesla::geforce_gtx_260::add_4B(result, char_to_type<'T'>());
    00134   devices::gpu::nvidia::tesla::geforce_gtx_260::add_8B(result, char_to_type<'T'>());
    00135   devices::gpu::amd::northern_islands::scrapper::add_4B(result, char_to_type<'T'>());
    00136   devices::gpu::nvidia::maxwell::geforce_gtx_750_ti::add_4B(result, char_to_type<'T'>());
    00137   devices::gpu::nvidia::maxwell::geforce_gtx_750_ti::add_8B(result, char_to_type<'T'>());
    00138   devices::gpu::nvidia::fermi::geforce_gtx_470::add_4B(result, char_to_type<'T'>());
    00139   devices::gpu::nvidia::fermi::geforce_gtx_470::add_8B(result, char_to_type<'T'>());
    00140   devices::gpu::nvidia::fermi::tesla_c2050::add_4B(result, char_to_type<'T'>());
    00141   devices::gpu::nvidia::fermi::tesla_c2050::add_8B(result, char_to_type<'T'>());
    00142   devices::gpu::amd::northern_islands::barts::add_4B(result, char_to_type<'T'>());
    00143
    00144   return result;
    00145 }
    00146
    00147 static database_type<row_wise_reduction_template::parameters_type> row_wise_reduction_N = init_row_wise_reduction_N();
    00148 static database_type<row_wise_reduction_template::parameters_type> row_wise_reduction_T = init_row_wise_reduction_T();
    00149
    00150 template<class NumericT>
    00151 device_specific::row_wise_reduction_template::parameters_type const & row_wise_reduction_params(ocl::device const & device, char A_trans)
    00152 {
    00153   assert(A_trans=='N' || A_trans=='T');
    00154   database_type<row_wise_reduction_template::parameters_type> * db;
    00155   if (A_trans=='T')
    00156     db = &row_wise_reduction_T;
    00157   else
    00158     db = &row_wise_reduction_N;
    00159   return get_parameters<NumericT>(*db, device);
    00160 }
    00161
    00162
    00163 }
    00164 }
    00165 }
    00166
    00167 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines