Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math::opencl_code_< Code, T_arguments > Class Template Reference

Detailed Description

template<const char * Code, typename... T_arguments>
class stan::math::opencl_code_< Code, T_arguments >

Represents custom code in kernel generator expressions.

Template Parameters
Codecustom code
T_argumentstypes of argument expressions

Definition at line 145 of file opencl_code.hpp.

#include <opencl_code.hpp>

+ Inheritance diagram for stan::math::opencl_code_< Code, T_arguments >:

Public Types

using names_tuple = std::tuple< typename std::pair< const char *, T_arguments >::first_type... >
 
using Deriv = internal::opencl_code_impl< Code, T_arguments... >
 

Public Member Functions

 opencl_code_ (const names_tuple &names, T_arguments &&... arguments)
 Constructor.
 
 opencl_code_ (const opencl_code_< Code, T_arguments... > &other)
 Copy constructor.
 
auto get_kernel_parts (std::unordered_map< const void *, const char * > &generated, std::unordered_map< const void *, const char * > &generated_all, name_generator &name_gen, const std::string &row_index_name, const std::string &col_index_name, bool view_handled) const
 Generates kernel code for this and nested expressions.
 
auto set_args (std::unordered_map< const void *, const char * > &generated, std::unordered_map< const void *, const char * > &generated_all, cl::Kernel &kernel, int &arg_num) const
 Sets kernel arguments for nested expressions.
 
auto add_read_event (cl::Event &e) const
 Adds read event to any matrices used by nested expressions.
 
auto get_write_events (std::vector< cl::Event > &events) const
 Adds all write events on any matrices used by nested expressions to a list.
 
template<int N = sizeof...(T_arguments), std::enable_if_t<(N > 0)> * = nullptr>
auto rows () const
 Number of rows of a matrix that would be the result of evaluating this expression.
 
template<int N = sizeof...(T_arguments), std::enable_if_t<(N==0)> * = nullptr>
auto rows () const
 
template<int N = sizeof...(T_arguments), std::enable_if_t<(N > 0)> * = nullptr>
auto cols () const
 Number of columns of a matrix that would be the result of evaluating this expression.
 
template<int N = sizeof...(T_arguments), std::enable_if_t<(N==0)> * = nullptr>
auto cols () const
 
template<int N = sizeof...(T_arguments), std::enable_if_t<(N > 0)> * = nullptr>
auto thread_rows () const
 Number of rows threads need to be launched for.
 
template<int N = sizeof...(T_arguments), std::enable_if_t<(N==0)> * = nullptr>
auto thread_rows () const
 
template<int N = sizeof...(T_arguments), std::enable_if_t<(N > 0)> * = nullptr>
auto thread_cols () const
 Number of columns threads need to be launched for.
 
template<int N = sizeof...(T_arguments), std::enable_if_t<(N==0)> * = nullptr>
auto thread_cols () const
 
auto extreme_diagonals () const
 Determine indices of extreme sub- and superdiagonals written.
 
auto get_unique_matrix_accesses (std::vector< int > &uids, std::unordered_map< const void *, int > &id_map, int &next_id) const
 Collects data that is needed beside types to uniqly identify a kernel generator expression.
 
auto deep_copy () const
 Creates a deep copy of this expression.
 
template<typename T_scalar >
auto output (const char *var_name) const
 Get object representing output variable of ccustom code.
 

Public Attributes

std::shared_ptr< internal::opencl_code_impl< Code, T_arguments... > > impl_
 
std::string & var_name_
 

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