All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
viennacl::device_specific::template_base Class Referenceabstract

`#include <template_base.hpp>`

Inheritance diagram for viennacl::device_specific::template_base:

## Classes

class | invalid_template_exception
struct | loop_body_base
struct | parameters_type

## Public Member Functions

| template_base (binding_policy_t binding_policy)
virtual | ~template_base ()
std::vector< std::string > | generate (std::string const &kernel_prefix, statements_container const &statements, viennacl::ocl::device const &device)
virtual int | check_invalid (statements_container const &statements, viennacl::ocl::device const &device) const =0
| returns whether or not the profile has undefined behavior on particular device More...
virtual void | enqueue (std::string const &kernel_prefix, std::vector< lazy_program_compiler > &programs, statements_container const &statements)=0
virtual tools::shared_ptr < template_base > | clone () const =0

## Protected Member Functions

void | set_arguments (statements_container const &statements, viennacl::ocl::kernel &kernel, unsigned int &current_arg)

## Static Protected Member Functions

static void | generate_prototype (utils::kernel_generation_stream &stream, std::string const &name, std::string const &first_arguments, std::vector< mapping_type > const &mappings, statements_container const &statements, std::map< std::string, unsigned int > const &widths)
static void | generate_prototype (utils::kernel_generation_stream &stream, std::string const &name, std::string const &first_arguments, std::vector< mapping_type > const &mappings, statements_container const &statements)
static void | fetching_loop_info (fetching_policy_type policy, std::string const &bound, utils::kernel_generation_stream &stream, std::string &init, std::string &upper_bound, std::string &inc, std::string const &domain_id, std::string const &domain_size)
static bool | is_node_trans (scheduler::statement::container_type const &array, vcl_size_t root_idx, leaf_t leaf_type)
static std::string | append_simd_suffix (std::string const &str, unsigned int i)
static bool | is_striding_operator (scheduler::statement_node const &node)
static bool | has_strided_access (statements_container const &statements)
static vcl_size_t | vector_size (scheduler::statement_node const &node, bool up_to_internal_size)
static void | element_wise_loop_1D (utils::kernel_generation_stream &stream, loop_body_base const &loop_body, fetching_policy_type fetch, unsigned int simd_width, std::string const &i, std::string const &bound, std::string const &domain_id, std::string const &domain_size)
static std::string | vstore (unsigned int simd_width, std::string const &value, std::string const &offset, std::string const &ptr)
static std::string | vload (unsigned int simd_width, std::string const &offset, std::string const &ptr)

## Detailed Description

Definition at line 54 of file template_base.hpp.

## Constructor & Destructor Documentation

viennacl::device_specific::template_base::template_base | ( | binding_policy_t | binding_policy | ) |

inline

Definition at line 486 of file template_base.hpp.

virtual viennacl::device_specific::template_base::~template_base | ( |  | ) |

inline virtual

Definition at line 488 of file template_base.hpp.

## Member Function Documentation

static std::string viennacl::device_specific::template_base::append_simd_suffix | ( | std::string const & | str,
|  | unsigned int | i
| ) |  |

inline static protected

Definition at line 373 of file template_base.hpp.

virtual int viennacl::device_specific::template_base::check_invalid | ( | statements_container const & | statements,
|  | viennacl::ocl::device const & | device
| ) |  | const

pure virtual

returns whether or not the profile has undefined behavior on particular device

Implemented in viennacl::device_specific::template_base_impl< TemplateType, ParametersType >, and viennacl::device_specific::template_base_impl< matrix_product_template, matrix_product_parameters >.

virtual tools::shared_ptr<template_base> viennacl::device_specific::template_base::clone | ( |  | ) | const

pure virtual

Implemented in viennacl::device_specific::template_base_impl< TemplateType, ParametersType >, and viennacl::device_specific::template_base_impl< matrix_product_template, matrix_product_parameters >.

static void viennacl::device_specific::template_base::element_wise_loop_1D | ( | utils::kernel_generation_stream & | stream,
|  | loop_body_base const & | loop_body,
|  | fetching_policy_type | fetch,
|  | unsigned int | simd_width,
|  | std::string const & | i,
|  | std::string const & | bound,
|  | std::string const & | domain_id,
|  | std::string const & | domain_size
| ) |  |

inline static protected

Definition at line 439 of file template_base.hpp.

virtual void viennacl::device_specific::template_base::enqueue | ( | std::string const & | kernel_prefix,
|  | std::vector< lazy_program_compiler > & | programs,
|  | statements_container const & | statements
| ) |  |

pure virtual

Implemented in viennacl::device_specific::matrix_product_template.

static void viennacl::device_specific::template_base::fetching_loop_info | ( | fetching_policy_type | policy,
|  | std::string const & | bound,
|  | utils::kernel_generation_stream & | stream,
|  | std::string & | init,
|  | std::string & | upper_bound,
|  | std::string & | inc,
|  | std::string const & | domain_id,
|  | std::string const & | domain_size
| ) |  |

inline static protected

Definition at line 330 of file template_base.hpp.

std::vector<std::string> viennacl::device_specific::template_base::generate | ( | std::string const & | kernel_prefix,
|  | statements_container const & | statements,
|  | viennacl::ocl::device const & | device
| ) |  |

inline

Definition at line 490 of file template_base.hpp.

static void viennacl::device_specific::template_base::generate_prototype | ( | utils::kernel_generation_stream & | stream,
|  | std::string const & | name,
|  | std::string const & | first_arguments,
|  | std::vector< mapping_type > const & | mappings,
|  | statements_container const & | statements,
|  | std::map< std::string, unsigned int > const & | widths
| ) |  |

inline static protected

Definition at line 290 of file template_base.hpp.

static void viennacl::device_specific::template_base::generate_prototype | ( | utils::kernel_generation_stream & | stream,
|  | std::string const & | name,
|  | std::string const & | first_arguments,
|  | std::vector< mapping_type > const & | mappings,
|  | statements_container const & | statements
| ) |  |

inline static protected

Definition at line 304 of file template_base.hpp.

static bool viennacl::device_specific::template_base::has_strided_access | ( | statements_container const & | statements | ) |

inline static protected

Definition at line 388 of file template_base.hpp.

static bool viennacl::device_specific::template_base::is_node_trans | ( | scheduler::statement::container_type const & | array,
|  | vcl_size_t | root_idx,
|  | leaf_t | leaf_type
| ) |  |

inline static protected

Definition at line 353 of file template_base.hpp.

static bool viennacl::device_specific::template_base::is_striding_operator | ( | scheduler::statement_node const & | node | ) |

inline static protected

Definition at line 381 of file template_base.hpp.

void viennacl::device_specific::template_base::set_arguments | ( | statements_container const & | statements,
|  | viennacl::ocl::kernel & | kernel,
|  | unsigned int & | current_arg
| ) |  |

inline protected

Definition at line 309 of file template_base.hpp.

static vcl_size_t viennacl::device_specific::template_base::vector_size | ( | scheduler::statement_node const & | node,
|  | bool | up_to_internal_size
| ) |  |

inline static protected

Definition at line 414 of file template_base.hpp.

static std::string viennacl::device_specific::template_base::vload | ( | unsigned int | simd_width,
|  | std::string const & | offset,
|  | std::string const & | ptr
| ) |  |

inline static protected

Definition at line 473 of file template_base.hpp.

static std::string viennacl::device_specific::template_base::vstore | ( | unsigned int | simd_width,
|  | std::string const & | value,
|  | std::string const & | offset,
|  | std::string const & | ptr
| ) |  |

inline static protected

Definition at line 465 of file template_base.hpp.

The documentation for this class was generated from the following file:

- viennacl/device_specific/templates/template_base.hpp