Automatic Differentiation
 
Loading...
Searching...
No Matches
as_operation_cl.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_AS_OPERATION_CL_HPP
2#define STAN_MATH_OPENCL_KERNEL_GENERATOR_AS_OPERATION_CL_HPP
3#ifdef STAN_OPENCL
4
11#include <type_traits>
12
13namespace stan {
14namespace math {
15
28template <assign_op_cl AssignOp = assign_op_cl::equals, typename T_operation,
29 typename = std::enable_if_t<std::is_base_of<
30 operation_cl_base, std::remove_reference_t<T_operation>>::value>>
31inline T_operation&& as_operation_cl(T_operation&& a) {
32 return std::forward<T_operation>(a);
33}
34
43template <assign_op_cl AssignOp = assign_op_cl::equals, typename T_scalar,
46inline scalar_<T_scalar> as_operation_cl(const T_scalar a) {
47 return scalar_<T_scalar>(a);
48}
49
58template <assign_op_cl AssignOp = assign_op_cl::equals>
59inline scalar_<char> as_operation_cl(const bool a) {
60 return scalar_<char>(a);
61}
62
72template <assign_op_cl AssignOp = assign_op_cl::equals, typename T_matrix_cl,
76 return load_<T_matrix_cl, AssignOp>(std::forward<T_matrix_cl>(a));
77}
78
90template <typename T, assign_op_cl AssignOp = assign_op_cl::equals>
92 = std::conditional_t<std::is_lvalue_reference<T>::value,
93 decltype(as_operation_cl<AssignOp>(std::declval<T>())),
94 std::remove_reference_t<decltype(
95 as_operation_cl<AssignOp>(std::declval<T>()))>>;
96
98} // namespace math
99} // namespace stan
100
101#endif
102#endif
Represents an access to a matrix_cl in kernel generator expressions.
Definition load.hpp:34
Represents a scalar in kernel generator expressions.
Definition scalar.hpp:29
require_t< std::is_arithmetic< std::decay_t< T > > > require_arithmetic_t
Require type satisfies std::is_arithmetic.
T_operation && as_operation_cl(T_operation &&a)
Converts any valid kernel generator expression into an operation.
std::conditional_t< std::is_lvalue_reference< T >::value, decltype(as_operation_cl< AssignOp >(std::declval< T >())), std::remove_reference_t< decltype(as_operation_cl< AssignOp >(std::declval< T >()))> > as_operation_cl_t
Type that results when converting any valid kernel generator expression into operation.
require_not_t< std::is_same< std::decay_t< T >, std::decay_t< S > > > require_not_same_t
Require types T and S does not satisfy std::is_same.
assign_op_cl
Ops that decide the type of assignment for LHS operations.
std::enable_if_t< math::disjunction< Checks... >::value > require_any_t
If any condition is true, template is enabled.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...