Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math::load_< T, AssignOp > Class Template Reference

Detailed Description

template<typename T, assign_op_cl AssignOp = assign_op_cl::equals>
class stan::math::load_< T, AssignOp >

Represents an access to a matrix_cl in kernel generator expressions.

Template Parameters
Tmatrix_cl
AssignOptells higher level operations whether the final operation should be an assignment or a type of compound assignment.

Definition at line 32 of file load.hpp.

#include <load.hpp>

+ Inheritance diagram for stan::math::load_< T, AssignOp >:

Public Types

using Scalar = typename std::remove_reference_t< T >::type
 
using base = operation_cl< load_< T, AssignOp >, Scalar >
 
using Deriv = Derived
 
using ArgsTuple = std::tuple< Args... >
 
using view_transitivity = std::tuple< std::is_same< Args, void >... >
 

Public Member Functions

 load_ (T &&a)
 Constructor.
 
load_< T &, AssignOp > deep_copy () &
 Creates a deep copy of this expression.
 
load_< const T &, AssignOp > deep_copy () const &
 
load_< T, AssignOp > deep_copy () &&
 
kernel_parts 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 expression.
 
std::string generate_body (const std::string &row_index_name, const std::string &col_index_name, const bool view_handled, const char *arg_var_name) const
 Generates kernel code for main body of this expression.
 
kernel_parts get_kernel_parts_lhs (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) const
 Generates kernel code for this expression if it appears on the left hand side of an assignment.
 
kernel_parts generate_lhs (const std::string &row_index_name, const std::string &col_index_name) const
 Generates kernel code for this expression if it appears on the left hand side of an assignment.
 
void 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 this expression.
 
void add_read_event (cl::Event &e) const
 Adds read event to the matrix used in this expression.
 
void add_write_event (cl::Event &e) const
 Adds write event to the matrix used in this expression.
 
void get_clear_read_write_events (std::vector< cl::Event > &events) const
 Adds all read and write events on the matrix used by this expression to a list and clears them from the matrix.
 
void get_write_events (std::vector< cl::Event > &events) const
 Adds all write events on the matrix used by this expression to a list.
 
int rows () const
 Number of rows of a matrix that would be the result of evaluating this expression.
 
int cols () const
 Number of columns of a matrix that would be the result of evaluating this expression.
 
matrix_cl_view view () const
 View of a matrix that would be the result of evaluating this expression.
 
void set_view (int bottom_diagonal, int top_diagonal, int bottom_zero_diagonal, int top_zero_diagonal) const
 Sets the view of the matrix depending on which of its parts are written to.
 
std::pair< int, int > extreme_diagonals () const
 Determine indices of extreme sub- and superdiagonals written.
 
const T & eval () const
 Evaluates the expression.
 
void check_assign_dimensions (int rows, int cols) const
 If needed resizes underlying matrix to desired number of rows and cols.
 
void 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.
 
kernel_parts generate_lhs (const std::string &row_index_name, const std::string &col_index_name, const std::string &var_name_arg) const
 Generates kernel code for this and nested expressions if this expression appears on the left hand side of an assignment.
 
Derived & derived ()
 Casts the instance into its derived type.
 
const Derived & derived () const
 Casts the instance into its derived type.
 
const auto & get_arg () const
 Returns an argument to this operation.
 
void evaluate_into (T_lhs &lhs) const
 Evaluates this expression into given left-hand-side expression.
 
std::string get_kernel_source_for_evaluating_into (const T_lhs &lhs) const
 Generates kernel source for evaluating this expression into given left-hand-side expression.
 
kernel_parts get_whole_kernel_parts (std::unordered_map< const void *, const char * > &generated, std::unordered_map< const void *, const char * > &generated_all, name_generator &ng, const std::string &row_index_name, const std::string &col_index_name, const T_result &result) const
 Generates kernel code for assigning this expression into result expression.
 
kernel_parts generate (const std::string &row_index_name, const std::string &col_index_name, const bool view_handled, const std::string &var_name_arg) const
 Generates kernel code for this expression.
 
void modify_argument_indices (std::string &row_index_name, std::string &col_index_name) const
 Does nothing.
 
int size () const
 Size of a matrix that would be the result of evaluating this expression.
 
int thread_rows () const
 Number of rows threads need to be launched for.
 
int thread_cols () const
 Number of columns threads need to be launched for.
 

Public Attributes

std::string var_name_
 

Static Public Attributes

static constexpr assign_op_cl assignment_op = AssignOp
 
static const bool require_specific_local_size
 
static constexpr int dynamic
 

Protected Attributes

a_
 
std::tuple< Args... > arguments_
 

Static Protected Attributes

static constexpr int N = sizeof...(Args)
 

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