Skip to content

Commit 0255450

Browse files
committed
update docs
1 parent bfcd222 commit 0255450

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

stan/math/opencl/kernel_generator/as_operation_cl.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace math {
2020
/**
2121
* Converts any valid kernel generator expression into an operation. This is an
2222
* overload for operations - a no-op
23+
* @tparam AssignOp ignored
2324
* @tparam T_operation type of the input operation
2425
* @param a an operation
2526
* @return operation
@@ -34,6 +35,7 @@ inline T_operation&& as_operation_cl(T_operation&& a) {
3435
/**
3536
* Converts any valid kernel generator expression into an operation. This is an
3637
* overload for scalars (arithmetic types). It wraps them into \c scalar_.
38+
* @tparam AssignOp ignored
3739
* @tparam T_scalar type of the input scalar
3840
* @param a scalar
3941
* @return \c scalar_ wrapping the input
@@ -48,6 +50,7 @@ inline scalar_<T_scalar> as_operation_cl(const T_scalar a) {
4850
* Converts any valid kernel generator expression into an operation. This is an
4951
* overload for bool scalars. It wraps them into \c scalar_<char> as \c bool can
5052
* not be used as a type of a kernel argument.
53+
* @tparam AssignOp ignored
5154
* @param a scalar
5255
* @return \c scalar_<char> wrapping the input
5356
*/
@@ -57,6 +60,8 @@ inline scalar_<char> as_operation_cl(const bool a) { return scalar_<char>(a); }
5760
/**
5861
* Converts any valid kernel generator expression into an operation. This is an
5962
* overload for \c matrix_cl. It wraps them into into \c load_.
63+
* @tparam AssignOp an optional `assign_op_cl` that dictates whether the object
64+
* is assigned using standard or compound assign.
6065
* @tparam T_matrix_cl \c matrix_cl
6166
* @param a \c matrix_cl
6267
* @return \c load_ wrapping the input
@@ -75,6 +80,9 @@ inline load_<T_matrix_cl, AssignOp> as_operation_cl(T_matrix_cl&& a) {
7580
* as_operation_cl_t<T>. If the return value of \c as_operation_cl() would be a
7681
* rvalue reference, the reference is removed, so that a variable of this type
7782
* actually stores the value.
83+
* @tparam T a `matrix_cl` or `Scalar` type
84+
* @tparam AssignOp an optional `assign_op_cl` that dictates whether the object
85+
* is assigned using standard or compound assign.
7886
*/
7987
template <typename T, assign_op_cl AssignOp = assign_op_cl::equals>
8088
using as_operation_cl_t = std::conditional_t<

stan/math/opencl/kernel_generator/multi_result_kernel.hpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ class results_cl {
327327
* Incrementing \c results_ object by \c expressions_cl object
328328
* executes the kernel that evaluates expressions and increments results by
329329
* those expressions.
330+
* @tparam AssignOp an optional `assign_op_cl` that dictates whether the object
331+
* is assigned using standard or compound assign.
330332
* @tparam T_expressions types of expressions
331333
* @param exprs expressions
332334
*/
@@ -360,7 +362,7 @@ class results_cl {
360362
}
361363

362364
/**
363-
* Incrementing \c results_ object by \c expressions_cl object
365+
* Decrement \c results_ object by \c expressions_cl object
364366
* executes the kernel that evaluates expressions and increments results by
365367
* those expressions.
366368
* @tparam T_expressions types of expressions
@@ -374,7 +376,7 @@ class results_cl {
374376
}
375377

376378
/**
377-
* Incrementing \c results_ object by \c expressions_cl object
379+
* Elementwise divide \c results_ object by \c expressions_cl object
378380
* executes the kernel that evaluates expressions and increments results by
379381
* those expressions.
380382
* @tparam T_expressions types of expressions
@@ -388,7 +390,7 @@ class results_cl {
388390
}
389391

390392
/**
391-
* Incrementing \c results_ object by \c expressions_cl object
393+
* Elementwise multiply \c results_ object by \c expressions_cl object
392394
* executes the kernel that evaluates expressions and increments results by
393395
* those expressions.
394396
* @tparam T_expressions types of expressions
@@ -581,6 +583,10 @@ class results_cl {
581583
/**
582584
* Makes a std::pair of one result and one expression and wraps it into a
583585
* tuple.
586+
* @tparam AssignOp an optional `assign_op_cl` that dictates whether the object
587+
* is assigned using standard or compound assign.
588+
* @tparam T_result An non scalar type that is normally an `result_cl` operation holding a `matrix_cl`
589+
* @tparam T_expression An expression of set of operations on `matrix_cl` and scalar types.
584590
* @param result result
585591
* @param expression expression
586592
* @return a tuple of pair of result and expression
@@ -600,6 +606,10 @@ class results_cl {
600606

601607
/**
602608
* If an expression does not need to be calculated this returns an empty tuple
609+
* @tparam AssignOp an optional `assign_op_cl` that dictates whether the object
610+
* is assigned using standard or compound assign.
611+
* @tparam T_result An non scalar type that is normally an `result_cl` operation holding a `matrix_cl`
612+
* @tparam T_expression An expression of set of operations on `matrix_cl` and scalar types.
603613
* @param result result
604614
* @param expression expression
605615
* @return a tuple of pair of result and expression
@@ -614,6 +624,10 @@ class results_cl {
614624
/**
615625
* Checks on scalars are done separately in this overload instead of in
616626
* kernel.
627+
* @tparam AssignOp an optional `assign_op_cl` that dictates whether the object
628+
* is assigned using standard or compound assign.
629+
* @tparam T_check A scalar type
630+
* @tparam T_pass An integral type
617631
* @param result result - check
618632
* @param pass bool scalar
619633
* @return an empty tuple

stan/math/opencl/rev/adjoint_results.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ class adjoint_results_cl : protected results_cl<T_results...> {
102102

103103
/**
104104
* Selects assignments that have non-scalar var results.
105+
* @tparam AssignOp an optional `assign_op_cl` that dictates whether the object
106+
* is assigned using standard or compound assign.
105107
* @tparam T_result type of result. This overload is used for non-scalar vars.
106108
* @tparam T_expression type of expression
107109
* @param result result
@@ -119,6 +121,8 @@ class adjoint_results_cl : protected results_cl<T_results...> {
119121
}
120122
/**
121123
* Selects assignments that have non-scalar var results.
124+
* @tparam AssignOp an optional `assign_op_cl` that dictates whether the object
125+
* is assigned using standard or compound assign.
122126
* @tparam T_result type of result. This overload is used for results that are
123127
* either scalars or not vars.
124128
* @tparam T_expression type of expression

0 commit comments

Comments
 (0)