Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/atan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ inline fvar<T> atan(const fvar<T>& x) {
*
* @tparam T autodiff value type
* @param[in] z argument
* @return arc tanget of the argument
* @return arc tangent of the argument
*/
template <typename T>
inline std::complex<fvar<T>> atan(const std::complex<fvar<T>>& z) {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/fwd/fun/read_fvar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class read_fvar_functor {

/**
* Function applying the read_fvar_functor to extract the values
* and tangets of a given fvar matrix into separate matrices.
* and tangents of a given fvar matrix into separate matrices.
*
* @tparam EigFvar type of the Eigen container of fvar.
* @tparam EigOut type of the Eigen containers to copy to
Expand Down
8 changes: 4 additions & 4 deletions stan/math/fwd/functor/finite_diff.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ inline auto aggregate_tangent(const FuncTangent& tangent, const InputArg& arg) {

/**
* Construct an fvar<T> where the tangent is calculated by finite-differencing.
* Finite-differencing is only perfomed where the scalar type to be evaluated is
* `fvar<T>.
* Finite-differencing is only performed where the scalar type to be evaluated
* is `fvar<T>.
*
* Higher-order inputs (i.e., fvar<var> & fvar<fvar<T>>) are also implicitly
* supported through auto-diffing the finite-differencing process.
Expand Down Expand Up @@ -95,8 +95,8 @@ inline auto finite_diff(const F& func, const TArgs&... args) {

/**
* Construct an fvar<T> where the tangent is calculated by finite-differencing.
* Finite-differencing is only perfomed where the scalar type to be evaluated is
* `fvar<T>.
* Finite-differencing is only performed where the scalar type to be evaluated
* is `fvar<T>.
*
* This overload is used when no fvar<T> arguments are passed and simply
* evaluates the functor with the provided arguments.
Expand Down
2 changes: 1 addition & 1 deletion stan/math/memory/stack_alloc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class stack_alloc {
/**
* Return number of bytes allocated to this instance by the heap.
* This is not the same as the number of bytes allocated through
* calls to memalloc_. The latter number is not calculatable
* calls to memalloc_. The latter number is not calculable
* because space is wasted at the end of blocks if the next
* alloc request doesn't fit. (Perhaps we could trim down to
* what is actually used?)
Expand Down
8 changes: 4 additions & 4 deletions stan/math/opencl/kernel_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* into a single OpenCL kernel. This is much simpler than writing
* multi-operation kernels by hand.
*
* Because global GPU memory loads and stores are relativly slow compared to
* Because global GPU memory loads and stores are relatively slow compared to
* calculations in a kernel, using one kernel for multiple operations is faster
* than using one kernel per operation.
*
Expand All @@ -27,13 +27,13 @@
* Element-wise functions can be added using one of the macros in
* `elt_functions.hpp`.
*
* New kernel generator classes must satsify the conditions below:
* New kernel generator classes must satisfy the conditions below:
*
* 1. The class must be derived from a class inheriting from `operation_cl`.
* Optionally, if the operation should support being assigned to, it can be
* derived from a class inheriting `operation_cl_lhs` instead.
* 2. It's parent template arguments should be set to derived type, type of
* scalar and types of any expression arguements.
* scalar and types of any expression arguments.
* 3. Member type `Scalar` should be defined as scalar type of the result of
* the operation.
* 4. Member function `deep_copy` should make a copy of the expression.
Expand Down Expand Up @@ -97,7 +97,7 @@
*
* A new operation should also have a user-facing function that accepts
* arguments to the operation and returns the operation object. Arguments should
* be passed trough function `as_operation_cl` so that they are wrapped in
* be passed through function `as_operation_cl` so that they are wrapped in
* operations if they are not operations themselves. If the operation defines
* `modify_argument_indices` this function should make copies of arguments by
* calling `deep_copy()` on them internally.
Expand Down
6 changes: 3 additions & 3 deletions stan/math/opencl/kernel_generator/broadcast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class broadcast_
}

/**
* Sets index/indices along broadcasted dimmension(s) to 0.
* Sets index/indices along broadcasted dimension(s) to 0.
* @param[in, out] row_index_name row index
* @param[in, out] col_index_name column index
*/
Expand Down Expand Up @@ -129,7 +129,7 @@ inline auto broadcast(T&& a) {
}

/**
* Broadcast an expression in rowwise dimmension. The argument must have single
* Broadcast an expression in rowwise dimension. The argument must have single
* column. Further expressions can use this expression as if it had any number
* of columns, repeating the values.
*
Expand All @@ -147,7 +147,7 @@ inline auto rowwise_broadcast(T&& a) {
}

/**
* Broadcast an expression in colwise dimmension. The argument must have single
* Broadcast an expression in colwise dimension. The argument must have single
* row. Further expressions can use this expression as if it had any number of
* rows, repeating the values.
*
Expand Down
4 changes: 2 additions & 2 deletions stan/math/opencl/kernel_generator/check_cl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class check_cl_ : public operation_cl_lhs<check_cl_<T>, bool> {

/**
* Adds all write events on any matrices used by nested expression to a list.
* Ignores read events anc clears no events.
* Ignores read events and clears no events.
* @param[out] events List of all events.
*/
inline void get_clear_read_write_events(
Expand Down Expand Up @@ -189,7 +189,7 @@ class check_cl_ : public operation_cl_lhs<check_cl_<T>, bool> {
/**
* Assignment of a scalar bool triggers the scalar check.
* @param condition whether the state is ok.
* @throws std::domain_error condition is false (chack failed).
* @throws std::domain_error condition is false (check failed).
*/
void operator=(bool condition); // implemented in multi_result_kernel.hpp
};
Expand Down
6 changes: 3 additions & 3 deletions stan/math/opencl/kernel_generator/colwise_reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ namespace internal {
class colwise_reduction_base {};

/**
* Determine number of work groups in rows direction that will be run fro
* Determine number of work groups in rows direction that will be run for
* colwise reduction of given size.
* @param n_rows number of rows of expression to resuce
* @param n_cols number of columns of expression to resuce
* @param n_rows number of rows of expression to reduce
* @param n_cols number of columns of expression to reduce
* @return number of work groups in rows direction
*/
inline int colwise_reduction_wgs_rows(int n_rows, int n_cols) {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernel_generator/constant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class constant_ : public operation_cl<constant_<T>, T> {
*
* In most cases scalars should be directly used instead of this. This is,
* however, useful for initializing some expression to specific value if that
* expresssion could also be plain `matrix_cl`.
* expression could also be plain `matrix_cl`.
*
* @tparam T type of argument
* @param a input argument
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernel_generator/elt_function_cl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class elt_function_cl : public operation_cl<Derived, Scal, T...> {

/**
* Generates a class and function for an unary function, defined by OpenCL with
* special property that it passes trough zero. That is \f$ f(0)=0 \f$. Such a
* special property that it passes through zero. That is \f$ f(0)=0 \f$. Such a
* function can have triangular view equal to its argument's.
* @param fun function name
*/
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernel_generator/holder_cl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace internal {
* Second step in implementation of construction `holder_cl` from a functor.
* @tparam T type of the result expression
* @tparam Is index sequence for `ptrs`
* @tparam Args types of pointes to heap
* @tparam Args types of points to heap
* @param expr result expression
* @param ptrs pointers to heap that need to be released when the expression is
* destructed
Expand Down
8 changes: 4 additions & 4 deletions stan/math/opencl/kernel_generator/matrix_cl_conversion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ template <typename T>
template <typename Expr,
require_all_kernel_expressions_and_none_scalar_t<Expr>*,
require_not_matrix_cl_t<Expr>*>
matrix_cl<T>::matrix_cl(const Expr& expresion) : rows_(0), cols_(0) {
results(*this) = expressions(expresion);
matrix_cl<T>::matrix_cl(const Expr& expression) : rows_(0), cols_(0) {
results(*this) = expressions(expression);
}

template <typename T>
template <typename Expr,
require_all_kernel_expressions_and_none_scalar_t<Expr>*,
require_not_matrix_cl_t<Expr>*>
matrix_cl<T>& matrix_cl<T>::operator=(const Expr& expresion) {
results(*this) = expressions(expresion);
matrix_cl<T>& matrix_cl<T>::operator=(const Expr& expression) {
results(*this) = expressions(expression);
return *this;
}
/** @}*/
Expand Down
4 changes: 2 additions & 2 deletions stan/math/opencl/kernel_generator/opencl_code.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace math {
*/
/**
* Represents output variable of custom code in kernel generator expressions.
* @tparam T_code intantiation of `opencl_code_` class template this is output
* @tparam T_code instantiation of `opencl_code_` class template this is output
* of
* @tparam T_scalar scalar type of the output variable
*/
Expand Down Expand Up @@ -319,7 +319,7 @@ class opencl_code_ : public operation_cl_base {
}

/**
* Get object representing output variable of ccustom code.
* Get object representing output variable of custom code.
* @param var_name name of the variable output object represents
*/
template <typename T_scalar>
Expand Down
6 changes: 3 additions & 3 deletions stan/math/opencl/kernel_generator/optional_broadcast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class optional_broadcast_
}

/**
* Sets index/indices along broadcasted dimmension(s) to 0.
* Sets index/indices along broadcasted dimension(s) to 0.
* @param[in, out] row_idx_name row index
* @param[in, out] col_idx_name column index
*/
Expand Down Expand Up @@ -207,7 +207,7 @@ optional_broadcast(T&& a) {
}

/**
* Broadcast an expression in rowwise dimmension if the number of columns equals
* Broadcast an expression in rowwise dimension if the number of columns equals
* to 1. In that case further expressions can use this expression as if had any
* number of columns, repeating the values.
*
Expand All @@ -225,7 +225,7 @@ inline auto rowwise_optional_broadcast(T&& a) {
}

/**
* Broadcast an expression in colwise dimmension if the number of rows equals
* Broadcast an expression in colwise dimension if the number of rows equals
* to 1. In that case further expressions can use this expression as if had any
* number of rows, repeating the values.
*
Expand Down
4 changes: 2 additions & 2 deletions stan/math/opencl/kernel_generator/rowwise_reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct matvec_mul_opt<elt_multiply_<Mat, broadcast_<VecT, true, false>>> {
/**
* Generates kernel code for the argument of rowwise reduction, applying the
* optimization - ignoring the triangular view of the vector, as it is already
* handeled by rowwise reduction.
* handled by rowwise reduction.
* @param mul argument of the rowwise reduction
* @param[in,out] generated map from (pointer to) already generated local
* operations to variable names
Expand Down Expand Up @@ -116,7 +116,7 @@ struct matvec_mul_opt<elt_multiply_<Mat, broadcast_<VecT, true, false>>> {
* @tparam T type of first argument
* @tparam operation type with member function generate that accepts two
* variable names and returns OpenCL source code for reduction operation_cl
* @tparam PassZero whether \c operation passes trough zeros
* @tparam PassZero whether \c operation passes through zeros
*/
template <typename Derived, typename T, typename operation, bool PassZero>
class rowwise_reduction
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/mrrr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static constexpr const char* get_eigenvectors_kernel_code = STRINGIFY(
/**
* Calculates shifted LDL and UDU factorizations. Combined with twist index
* they form twisted factorization for calculation of an eigenvector
* corresponding to eigenvalue that is equal to the shift. Tha algorithm is
* corresponding to eigenvalue that is equal to the shift. The algorithm is
* sometimes called diferential twisted quotient-differences with shifts
* (dtwqds). L * D * L^T - shift * I = L+ * D+ * L+^T = U- * D- * U-^T D, D+
* and D- are diagonal, L and L+ are lower unit triangular (diagonal
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
* `C` and `D`. When executing `C`'s operation, `A` and `B` are assigned
* events to their read event stack while `C` is assigned an event to it's write
*event stack. Once `A` and `B` have finished their write event the kernel to
*compute `C` can begin. The excution to create `D` also waits for the write
*compute `C` can begin. The execution to create `D` also waits for the write
*events of `A` and `B`, but does not have to wait for the execution of `C` to
*finish. Executing `E` requires waiting for for the write events of both `C`
*and `D`.
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/add_diag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace math {
* @param mat input kernel generator expression
* @param to_add scalar value or input kernel generator expression to add along
* the diagonal
* @return a kernel generator expressio with to_add added along main diagonal
* @return a kernel generator expression with to_add added along main diagonal
*/
template <typename T_m, typename T_a,
require_all_kernel_expressions_and_none_scalar_t<T_m>* = nullptr,
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace math {
* that is implemented in OpenCL.
* @tparam T_y_cl type of independent variable;
* this can be a `matrix_cl` vector of intercepts or a single
* value (wich will be broadcast - used for all instances);
* value (which will be broadcast - used for all instances);
* @tparam T_x_cl type of the design matrix
* @tparam T_alpha_cl type of the intercept(s);
* this can be a vector (of the same length as y) of intercepts or a single
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/beta_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ inline return_type_t<T_y_cl, T_scale_succ_cl, T_scale_fail_cl> beta_lpdf(
auto alpha_beta_expr = alpha_val + beta_val;

auto zero_expr
= as_operation_cl(0); // simplifiy the kernel by only using one zero
= as_operation_cl(0); // simplify the kernel by only using one zero
auto logp_expr = colwise_sum(
static_select<include_summand<propto, T_scale_succ_cl>::value>(
-lgamma(alpha_val), zero_expr)
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/beta_proportion_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace math {
* @tparam T_loc_cl type of prior location
* @tparam T_prec_cl type of prior precision
*
* @param y (Sequence of) dependant variable(s)
* @param y (Sequence of) dependent variable(s)
* @param mu (Sequence of) location parameter(s)
* @param kappa (Sequence of) precision parameter(s)
* @return The log of the product of densities.
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/exp_mod_normal_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exp_mod_normal_lpdf(const T_y_cl& y, const T_loc_cl& mu,
using std::isnan;

check_consistent_sizes(function, "Random variable", y, "Location parameter",
mu, "Scale parameter", sigma, "Inv_scale paramter",
mu, "Scale parameter", sigma, "Inv_scale parameter",
lambda);
const size_t N = max_size(y, mu, sigma, lambda);
if (N == 0) {
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace math {
* prim/prob/neg_binomial_2_log_glm_lpdf.hpp that is implemented in OpenCL.
* @tparam T_y_cl type of independent variable;
* this can be a `matrix_cl` vector of intercepts or a single
* value (wich will be broadcast - used for all instances);
* value (which will be broadcast - used for all instances);
* @tparam T_x_cl type of the design matrix
* @tparam T_alpha_cl type of the intercept(s);
* this can be a vector (of the same length as y) of intercepts or a single
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/normal_id_glm_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace math {
* that is implemented in OpenCL.
* @tparam T_y_cl type of independent variable;
* this can be a `matrix_cl` vector of intercepts or a single
* value (wich will be broadcast - used for all instances);
* value (which will be broadcast - used for all instances);
* @tparam T_x_cl type of the design matrix
* @tparam T_alpha_cl type of the intercept(s);
* this can be a (optionally `var_value` containing) `matrix_cl` column vector
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/poisson_log_glm_lpmf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace math {
* that is implemented in OpenCL.
* @tparam T_y_cl type of independent variable;
* this can be a `matrix_cl` vector of intercepts or a single
* value (wich will be broadcast - used for all instances);
* value (which will be broadcast - used for all instances);
* @tparam T_x_cl type of the design matrix
* @tparam T_alpha_cl type of the intercept(s);
* this can be a `matrix_cl` vector (of the same length as y) of intercepts or a
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/prod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace math {
/**
* Calculates product of given kernel generator expression elements.
* @tparam T type of the expression
* @param m expression to calcualte product of
* @param m expression to calculate product of
* @return product of given expression
*/
template <typename T,
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/prim/skew_double_exponential_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ skew_double_exponential_lpdf(const T_y_cl& y, const T_loc_cl& mu,
using std::isnan;

check_consistent_sizes(function, "Random variable", y, "Location parameter",
mu, "Scale parameter", sigma, "Inv_scale paramter",
mu, "Scale parameter", sigma, "Inv_scale parameter",
tau);
const size_t N = max_size(y, mu, sigma, tau);
if (N == 0) {
Expand Down
3 changes: 2 additions & 1 deletion stan/math/opencl/prim/skew_normal_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ inline return_type_t<T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl> skew_normal_lpdf(
using std::isnan;

check_consistent_sizes(function, "Random variable", y, "Location parameter",
mu, "Scale parameter", sigma, "Shape paramter", alpha);
mu, "Scale parameter", sigma, "Shape parameter",
alpha);
const size_t N = max_size(y, mu, sigma, alpha);
if (N == 0) {
return 0.0;
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/rev/add_diag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace math {
* @param mat input kernel generator expression
* @param to_add scalar value or input kernel generator expression to add along
* the diagonal
* @return a kernel generator expressio with to_add added along main diagonal
* @return a kernel generator expression with to_add added along main diagonal
*/
template <typename T_m, typename T_a,
require_all_nonscalar_prim_or_rev_kernel_expression_t<T_m>* = nullptr,
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/rev/arena_matrix_cl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class arena_matrix_cl : public matrix_cl_base {
matrix_cl<T> eval() const& { return *impl_; }
matrix_cl<T> eval() && { return std::move(*impl_); }

// Wrapers to functions with explicit template parameters are implemented
// Wrappers to functions with explicit template parameters are implemented
// without macros.
template <matrix_cl_view matrix_view = matrix_cl_view::Entire>
inline void zeros_strict_tri() {
Expand Down
Loading